Commit graph

24104 commits

Author SHA1 Message Date
Leonardo de Moura
c8a4252461 refactor: move OpenDecl to Data 2020-09-15 16:53:53 -07:00
Leonardo de Moura
1ce80d5ba7 feat: hide auxiliary declarations 2020-09-15 16:50:16 -07:00
Leonardo de Moura
c4c1a3fc8d chore: make it clear the free variable dependency 2020-09-15 16:39:17 -07:00
Leonardo de Moura
19a7927f10 feat: sanitizeNames
@Kha I am using `_shadowed.<idx>` suffix for marking variables that
have been shadowed. It is a bit verbose, but at least it is easy to
understand understand error messages such as
```
shadow.lean:4:0: error: type mismatch
  h
has type
  x._shadowed.1 = x._shadowed.1
but it is expected to have type
  x = x
```
It is better than the old cryptic version
```
shadow.lean:4:0: error: type mismatch
  h
has type
  x = x
but it is expected to have type
  x = x
```
2020-09-15 16:28:50 -07:00
Leonardo de Moura
9af6264aad fix: do not fail if target is not found 2020-09-15 15:06:35 -07:00
Leonardo de Moura
4e99b19a96 fix: expandMatchDiscr cannot be a macro
The `matchType` created by the macro is bad for dependent pattern
matching. The `tst8` and `tst9` at `matchTac` failed to be elaborated
when using the macro.
2020-09-15 13:29:28 -07:00
Leonardo de Moura
e7f2d7af0b chore: remove default main name 2020-09-15 10:46:40 -07:00
Leonardo de Moura
232378070f feat: parentTag propagation for apply 2020-09-15 10:46:40 -07:00
Leonardo de Moura
177c00a895 feat: case tactic should reset tag 2020-09-15 10:46:40 -07:00
Leonardo de Moura
52d6fbb906 fix: appendTagSuffix operation 2020-09-15 10:46:40 -07:00
Leonardo de Moura
b36bcf3cf1 feat: admit and done 2020-09-15 10:46:40 -07:00
Leonardo de Moura
3fa7e61b26 feat: add done and admit syntax 2020-09-15 10:46:40 -07:00
Leonardo de Moura
b44b3aeffb fix: error position for unsolved goals 2020-09-15 10:46:40 -07:00
Leonardo de Moura
b8d90d77db feat: macro scope as the single mechanism for creating fresh names
cc @Kha
2020-09-14 20:09:07 -07:00
Leonardo de Moura
fde43e071d feat: improve matchType inference 2020-09-14 19:44:45 -07:00
Leonardo de Moura
cc3b48ce16 fix: check inductive datatype parameters in constructor resulting type 2020-09-14 16:56:13 -07:00
Leonardo de Moura
634f063631 feat: finish commit "using indentation" 2020-09-14 16:40:52 -07:00
Leonardo de Moura
e66f6cdd6c feat: using indentation 2020-09-14 16:12:23 -07:00
Leonardo de Moura
a6b19cd4af feat: expand show-by and have-by macros 2020-09-14 15:08:28 -07:00
Leonardo de Moura
c49ccda46a feat: add antiquotation for indentedNonEmptySeq 2020-09-14 14:57:38 -07:00
Leonardo de Moura
05e6a779ba fix: can't use maxPrec at by
If `by` uses `maxPrec`, then `have A by B ...` is parsed as
`have (A by B) ...` :(

cc @Kha
2020-09-14 14:57:14 -07:00
Leonardo de Moura
f95675dc22 feat: add have-by and show-by syntax 2020-09-14 14:25:35 -07:00
Leonardo de Moura
fc4ab139b5 feat: indented by
@Kha This one is not as useful as the indented `do`. When writing
interactive proofs I like the error message at the `}` showing the
resulting tactic state. We can simulate it using a `skip` in the end of the sequence :)
We remove the `skip` when the proof is done. Note that, the last `;`
is usually not part of the `by`. Example:
```lean
theorem ex (x y z : Nat) : y = z → y = x → x = z :=
fun _ _ =>
  have x = y by apply Eq.symm; assumption; -- <<< the last `;` is part of the `have`
  Eq.trans this (by assumption)
```
2020-09-14 14:20:02 -07:00
Leonardo de Moura
4c6a589e6c feat: indented do blocks
@Kha it is soooooo much nicer :)
2020-09-14 13:44:51 -07:00
Leonardo de Moura
163b0a7a3f fix: protected
- `protected` outside of a namespace is an error.
- Fix `protected` in recursive definitions.

cc @Kha
2020-09-14 13:09:04 -07:00
Leonardo de Moura
7c0216595e fix: remove duplicate error messages due to variable(s)
In Lean4, we re-elaborate `variable`(s) for each command, but we don't
want the error messages due to `variable` to appear in the log
multiple times.
2020-09-14 12:44:25 -07:00
Sebastian Ullrich
f3ab43e453 doc: task_object state machine 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
fce8ca304b fix: reintroduce code that cancels all remaining tasks on task manager shutdown 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
63d60e6564 fix: more robust m_keep_alive implementation not reliant on RC 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
e8a1f36d0c fix: prevent storing ST closure in MT task 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
b214b27557 fix: prevent storing ST value in MT task object 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
e946aa9135 fix: interpreter thread-unsafety 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
a1c17ade3a fix: use-after-free in keep-alive tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
ac56a9e79f fix: run tasks to completion on task_manager shutdown to prevent leaks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
fc4428f621 fix: mark Task closures as MT 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
a93a53b4b5 feat: more IO Task functions 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
469a822cc6 chore: checkInterrupted ~> checkCanceled, requestInterrupt ~> cancel 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
77cbaa752c fix: Task: make reference and -j0 semantics eager, simplify 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
5b83ceb1b5 feat: IO.mapTask, IO.bindTask 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
307a833798 feat: implement IO.asTask as primitive using always-run tasks 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
1782352af1 feat: optionally run tasks even when already cancelled 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
c672bd657f feat: IO.asTask 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
e14e76775f fix: ensure *println functions are atomic 2020-09-14 17:57:33 +02:00
Sebastian Ullrich
bdea7c7b14 feat: lean: initialize task manager from -j flag 2020-09-14 17:57:33 +02:00
Leonardo de Moura
c3623e9a0a chore: reduce default max steps 2020-09-13 16:18:53 -07:00
Leonardo de Moura
5da7f0b50b fix: set constApprox := false at SynthInstance
We don't want contraints such as
```
?m a =?= Nat
```
to be solved as
```
?m := fun a => Nat
```
durint type class resolution.
2020-09-13 16:11:27 -07:00
Leonardo de Moura
2ee1821f13 fix: ensure expectedType at fun body 2020-09-13 13:44:05 -07:00
Leonardo de Moura
7b90f7d956 fix: synthesize pending mvars before trying coercions to Fun
`tests/lean/repr_issue.lean` cannot be elaborated with this modification.
2020-09-13 13:19:05 -07:00
Leonardo de Moura
2de7f1f4d9 doc: possible improvement 2020-09-13 13:16:03 -07:00
Leonardo de Moura
d6a3e22992 chore: add auxiliary function 2020-09-13 13:13:34 -07:00