Commit graph

7095 commits

Author SHA1 Message Date
Leonardo de Moura
fb27537b8e fix: appUnexpander name resolution
fixes issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Scoping.20for.20delaborator.3F
2021-10-09 08:29:26 -07:00
Gabriel Ebner
34eda689a1 fix: use eraseMacroScopes on trace classes 2021-10-08 11:13:19 -07:00
Leonardo de Moura
81729d96f9 fix: make sure Quot primitives stay in eta expanded form
fixes #716
2021-10-08 09:36:06 -07:00
Leonardo de Moura
15ac3c2542 test: small repro for issue #716 2021-10-08 09:36:06 -07:00
Leonardo de Moura
b742f0005f chore: fix test 2021-10-06 19:58:29 -07:00
Leonardo de Moura
697e0ce2db feat: apply cleanup tactic before applying decreasing tactic
Alternative design: apply it only before reporting a failure.
2021-10-06 19:56:57 -07:00
Leonardo de Moura
85150731b7 test: put unit back, but rename it to someVal
It is the simple and more efficient.
We just set `someVal` with the first value of `vars`.
Recall that `vars` is never empty.
2021-10-06 18:09:06 -07:00
Leonardo de Moura
f64753c106 test: simplify ac_expr.lean
We don't want to avoid proofs at `List.getIdx` and `Expr` when doing proofs by reflection.
The new encoding avoids that by using the fact that `vars` in
`Context` should never be empty.

To be honest, the best approach is still the old `unit`. We can just
rename it to `inhabitant` to make sure users don't assume it is the
unit of the AC operator. Then, we can just set it with the first element
of `vars` and avoid proofs at `denote`.
2021-10-06 17:56:26 -07:00
Leonardo de Moura
079ad47f02 fix: mixed unary and non-unary functions 2021-10-06 17:33:51 -07:00
Leonardo de Moura
790a22c5df test: mutual recursion by well-founded recursion 2021-10-06 16:38:42 -07:00
Leonardo de Moura
7f660af4c6 feat: add repeat tactic to conv mode 2021-10-06 14:05:44 -07:00
Leonardo de Moura
1f2e92ea04 feat: make sure #check produces some result even when there are pending TC problems
Lean 3 uses the same approach.

closes #714
2021-10-06 13:37:06 -07:00
Leonardo de Moura
8ec9fda6c4 fix: improve widening operator used at the ElimDeadBranches abstract interpreter 2021-10-06 12:54:07 -07:00
Leonardo de Moura
988e43d2b4 fix: WF should reject definitions that do not take any arguments 2021-10-04 13:24:30 -07:00
Leonardo de Moura
85c49cfeb3 feat: apply termination tactic provided by user 2021-10-03 18:47:52 -07:00
Leonardo de Moura
23740778d4 refactor: termination hints 2021-10-03 18:09:35 -07:00
Leonardo de Moura
a12ade3da4 chore: fix test 2021-10-03 17:20:16 -07:00
Leonardo de Moura
42773941ed chore: fix test 2021-10-02 17:00:07 -07:00
Leonardo de Moura
1e44902243 fix: add withFreshMacroScope at expandMacroImpl? 2021-10-02 16:57:25 -07:00
Leonardo de Moura
15347272c7 feat: elaborate wait_* notation
We can use to define `if-then-else` using macros
2021-10-02 16:27:22 -07:00
Leonardo de Moura
b510bb305d feat: elaborate let_mvar% 2021-10-02 16:12:50 -07:00
Leonardo de Moura
acd21052c0 chore: remove old notation 2021-10-02 15:06:40 -07:00
Daniel Fabian
e1f591ba61 test: do no use unit in ac_expr.lean.
It is not necessary to define a unit element for the proof to go through.
2021-10-02 11:11:08 -07:00
Leonardo de Moura
2546a2cf7e test: add test for if-then-else issue
The issue was reported here:
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Required.20type.20annotation.20using.20Array
2021-09-30 22:23:22 -07:00
Leonardo de Moura
28d81ee456 fix: do not extract closed terms containing constants being defined
It may produce crashes during initialization.
2021-09-30 12:46:38 -07:00
Leonardo de Moura
837677cb4c test: doc string 2021-09-30 11:27:09 -07:00
Leonardo de Moura
ff38774b95 test: printDecls 2021-09-29 17:44:21 -07:00
Leonardo de Moura
09d0c93589 feat: declare functions in mutual block using auxiliary fuction defined using WF 2021-09-29 11:24:52 -07:00
Leonardo de Moura
608417b946 fix: check number of explicit variables at induction/cases alternatives when @ is not used
fixes #690
2021-09-29 07:39:38 -07:00
Leonardo de Moura
3fed9c9df7 feat: reject partial when if constant is not a function
fixes #697
2021-09-28 21:07:14 -07:00
Leonardo de Moura
200a38e20c feat: improve letIdLhs parser
The extra space is only really needed to distinguish an array update (NIY)
```
let x[i] := ...
```
from a declaration taking an instance argument
```
let f [Monad m] := ...
```

closes #696
2021-09-28 18:10:25 -07:00
Leonardo de Moura
b85d95b7b6 fix: panic in monadic polymorphic code
fixes #695
2021-09-28 17:46:19 -07:00
Leonardo de Moura
d0462153a0 fix: bug at smart unfolding procedure
It fixes an issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Simplifications.20in.20proofs.2Ftype-checking.20not.20happening.3B.20wh.2E.2E.2E
2021-09-28 10:45:54 -07:00
Leonardo de Moura
ceb9889b0e feat: elaborate temination_by term 2021-09-25 16:54:41 -07:00
Leonardo de Moura
a5b27952b5 fix: panic messages on invalid input
fixes #689
2021-09-25 09:01:01 -07:00
Leonardo de Moura
1282fb2d97 fix: getMatchWithExtra
`getMatchKeyArgs` returns arguments in reverse order.
2021-09-25 08:36:12 -07:00
Leonardo de Moura
58c938cef8 feat: 'termination_by' goodies 2021-09-22 21:09:33 -07:00
Chris Lovett
ad7c5b26a7
fix: UTF-8 file path support for lean on Windows
* fix msys2 windows build so the windows apps support utf-8 file paths.

* use windres to compile default-manifest.o

* windres is in binutils.

* stop modifying default-manifest.o

* copy to stage0

* fix semicolon joining of lists in add_custom_target

* undo changes to stage0 as per CR feedback.

* fix makefile

* fix: revert cmakelists.txt COMMAND_EXPAND_LISTS  change

* fix: msys2 dependencies

* add unit test for decoding UTF-8 chars to prove "lean.exe" can read utf-8 encoded files where utf-8 is also used in the file name.

* fix: utf-8 test by using windows-2022

* fix: do we really need cmake 3.11 or will 3.10 do?

* nope, really does require cmake 11.
2021-09-22 12:21:52 +02:00
Leonardo de Moura
6b1bed5c38 chore: fix test output 2021-09-21 20:37:23 -07:00
Leonardo de Moura
a909e8cf26 feat: arity mismatch error message at well-founded recursion 2021-09-21 20:34:15 -07:00
Leonardo de Moura
6a880fecc9 chore: modify findDocString? 2021-09-21 17:29:40 -07:00
Leonardo de Moura
640fc964b6 feat: basic termination_by bookkeeping 2021-09-21 15:24:42 -07:00
Leonardo de Moura
d43876ac2d chore: fix test 2021-09-21 14:54:45 -07:00
Leonardo de Moura
9085167872 test: Fin match test that relies heavily on contradiction
This example is based on a Lean 3 issue described at
https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/equation.20compiler.20help.20me.20plz
2021-09-21 12:57:08 -07:00
Leonardo de Moura
0351c96831 feat: better error message for induction tactic on mutually inductives 2021-09-21 06:56:17 -07:00
Sebastian Ullrich
15109b5f23 chore: remove obsolete file 2021-09-21 15:54:16 +02:00
Leonardo de Moura
2cbf0ba8e9 test: add "parameters" that are fixed in all equations 2021-09-20 12:58:22 -07:00
Leonardo de Moura
41a58459d7 test: equational theorem generation 2021-09-20 11:12:42 -07:00
Leonardo de Moura
9e980b2a78 fix: bug at decAux?
We are getting a few "stuck at universe constraint" errors after the
fix. We may need to add some kind of approximation in the future.
2021-09-20 07:12:57 -07:00
Leonardo de Moura
f2a418a7ae chore: smartUnfolding cleanup
We remove dead code, update comments, and add new tests

See #445
2021-09-19 15:29:11 -07:00