Commit graph

5872 commits

Author SHA1 Message Date
Sebastian Ullrich
20ed65605b fix: don't parenthesize juxtaposed tactics 2020-10-27 14:09:33 +01:00
Sebastian Ullrich
84692acd0e fix: do not introduce parentheses implied by indentation 2020-10-27 14:09:33 +01:00
Sebastian Ullrich
73323a7500 fix: remove obsolete workaround confusing the formatter
We don't generate antiquotations for `tparser!` anymore
2020-10-27 14:09:33 +01:00
Sebastian Ullrich
33c861a80e fix: parenthesizer: really make sure a trailing parser is of the same category as the continuation 2020-10-27 14:09:33 +01:00
Sebastian Ullrich
eb125c52f1 fix: never pretty-print whitespace before checkNoWsBefore 2020-10-27 14:09:33 +01:00
Sebastian Ullrich
43c875fd7a fix: tactic block indentation 2020-10-27 14:09:33 +01:00
Leonardo de Moura
c979d81934 refactor: add polymorphic methods for updating/querying reducibility status 2020-10-26 17:07:28 -07:00
Leonardo de Moura
79609938a8 feat: allow universe constraints to be postponed longer
Before this commit, each `isDefEq u v` invocation would fail if there
were pending universe level constraints. This commit, moves the
postponed universe constraints back to the `MetaM` state.
It also adds the combinator
```lean
withoutPostponingUniverseConstraints x
```
which executes `x` and throws an error if there are pending universe
constraints. We use the combinator at `elabApp` and `elabBinders`.
Without this commit, we would fail to elaborate simple terms such as
```lean
  Functor.map Prod.fst (x s)
```
because after elaborating `Prod.fst` and trying to ensure its type
match the expected one, we would be stuck at the universe constraint:
```
  u =?= max u ?v
```

Another benefit of the new approach is better error messages. Instead
of getting a mysterious type mismatch constraint, we get a list of
universe contraints the system is stuck at.

cc @Kha
2020-10-26 15:50:05 -07:00
Leonardo de Moura
40f99327e9 fix: missing withMainMVarContext 2020-10-26 11:35:54 -07:00
Leonardo de Moura
7e244686e9 chore: remove old notation 2020-10-26 09:16:51 -07:00
Sebastian Ullrich
b856553b4f chore: fix benchmark 2020-10-25 21:55:50 +01:00
Leonardo de Moura
e28b337a2c chore: remove old frontend support from lean.cpp
We also remove the option `-n` (for new frontend)
2020-10-25 10:16:52 -07:00
Leonardo de Moura
98d0892910 chore: update test output
@Kha the test `Reformat.lean` is "almost" working. It produces some
reasonable output, but we get parser errors. I didn't investigate.
I am updated the test output just to make sure we don't get a failure
in the CI.
2020-10-25 09:54:05 -07:00
Leonardo de Moura
db9e390b4d chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
Leonardo de Moura
fa101444b4 chore: fix tests 2020-10-25 09:11:13 -07:00
Leonardo de Moura
575db3bb3b fix: improve structure/inductive commands universe level inference and validation
chore: cleanup
2020-10-25 05:46:51 -07:00
Leonardo de Moura
a4c69ec32c chore: fix tests 2020-10-24 16:46:21 -07:00
Leonardo de Moura
0af4b6fb6f chore: remove hack that produces big search space 2020-10-24 07:21:06 -07:00
Leonardo de Moura
21587ff19b chore: move tests to new frontend 2020-10-23 16:18:52 -07:00
Leonardo de Moura
8cb1ff206c chore: move tests to new frontend 2020-10-23 14:07:26 -07:00
Leonardo de Moura
3de97ddc27 feat: run linters in the new frontend 2020-10-23 14:04:28 -07:00
Leonardo de Moura
8c03075e58 feat: improve function expected error message 2020-10-23 06:52:51 -07:00
Leonardo de Moura
f339efa100 feat: improve invalid named argument error message 2020-10-23 06:47:07 -07:00
Leonardo de Moura
40578d6d24 test: add explicit motive test 2020-10-23 06:00:51 -07:00
Leonardo de Moura
ff3d9bfbdf chore: fix test output 2020-10-23 05:43:16 -07:00
Leonardo de Moura
a7116b44c1 test: add new subst tests 2020-10-23 05:39:25 -07:00
Leonardo de Moura
474f9a3695 chore: fix tests 2020-10-22 17:46:15 -07:00
Leonardo de Moura
7c0b55ec6a chore: fix tests 2020-10-22 17:34:30 -07:00
Leonardo de Moura
de0eb8035f chore: fix test 2020-10-22 16:58:12 -07:00
Leonardo de Moura
c865abb340 refactor: remove MonadRun 2020-10-22 16:30:06 -07:00
Leonardo de Moura
85c955d77f feat: improve notation 2020-10-22 10:35:45 -07:00
Leonardo de Moura
34945dfc1c feat: elaborate notation 2020-10-22 10:20:23 -07:00
Leonardo de Moura
2041277cae fix: field default value with implicit type 2020-10-22 07:02:40 -07:00
Leonardo de Moura
6ca1768957 fix: optional := in the structure command 2020-10-22 04:39:20 -07:00
Sebastian Ullrich
ce96fab8de chore: fix passing additional LEAN(C)_OPTS to make 2020-10-22 12:00:39 +02:00
Sebastian Ullrich
4e74e36331 feat: run initializers on import
Also, refuse to evaluate an `[init]` decl in the same module (since we don't know whether the initialization is
backtrackable) and always use native symbol of a `[builtinInit]` decl
2020-10-22 11:59:55 +02:00
Leonardo de Moura
ea829b75c0 chore: remove coercions for old frontend 2020-10-21 17:37:35 -07:00
Leonardo de Moura
b555307f06 chore: move to new frontend 2020-10-21 16:35:50 -07:00
Leonardo de Moura
7111eb4d79 chore: move to new frontend 2020-10-21 13:30:43 -07:00
Leonardo de Moura
3e9c5e1653 chore: move to new frontend 2020-10-21 08:43:47 -07:00
Leonardo de Moura
192d45d867 chore: fix tests 2020-10-20 16:15:30 -07:00
Leonardo de Moura
ddbca07a0f chore: fix test output 2020-10-20 15:13:38 -07:00
Leonardo de Moura
35cf2f3d9f feat: use withSynthesize when elaborating the type of a type ascription 2020-10-20 15:12:54 -07:00
Leonardo de Moura
a052446414 feat: simplify decide! and nativeDecide! macros 2020-10-20 15:08:16 -07:00
Leonardo de Moura
27205ddff7 chore: move to new frontend 2020-10-20 09:33:50 -07:00
Leonardo de Moura
dc6305604b chore: fix test 2020-10-20 09:33:50 -07:00
Leonardo de Moura
fac2849e50 feat: forIn for PersistentArray 2020-10-20 09:33:50 -07:00
Leonardo de Moura
702ceb7a3f fix: return optional result
cc @Kha
2020-10-20 09:33:50 -07:00
Leonardo de Moura
c7efb1d37d fix: do notation else if
The following `do` block
```lean
if c_1 then
  action_1
else
  if cond_2 then
    action_2
  action_3
```
was being being parsed as
```lean
if c_1 then
  action_1
else if cond_2 then
  action_2
action_3
```

cc @Kha
2020-10-19 14:29:31 -07:00
Leonardo de Moura
437f4670ed fix: expand doIf notation before lifting nested methods 2020-10-19 11:32:51 -07:00