Commit graph

7446 commits

Author SHA1 Message Date
Leonardo de Moura
46d1111d3d fix: typo at unfoldBothDefEq 2022-03-06 13:54:42 -08:00
Leonardo de Moura
ff0f3bfc61 fix: interaction between overloaded notation and delayed coercions
The new test exposes this issue.
2022-03-06 09:49:15 -08:00
Leonardo de Moura
e9909020e8 test: add delay helper contructor 2022-03-06 08:08:51 -08:00
Leonardo de Moura
1450a86c4d feat: include types in the "ambiguous, possible interpretations" error message 2022-03-06 07:26:31 -08:00
Leonardo de Moura
d3b2028a05 feat: add Fin.succ 2022-03-05 17:36:38 -08:00
Leonardo de Moura
3f9c854194 feat: auto local implicit chaining 2022-03-05 17:30:15 -08:00
Leonardo de Moura
22731c02b0 fix: auto implicit locals in inductive families 2022-03-05 15:47:20 -08:00
Leonardo de Moura
613cf19509 fix: discrimination trees and "stuck" terms
See comments and new test.
2022-03-05 15:12:20 -08:00
Leonardo de Moura
9e76cd7d65 fix: toName function at elabAppFnId
closes #1038
2022-03-04 16:56:02 -08:00
Leonardo de Moura
a670ed1e2d fix: use withoutErrToSorry at apply
closes #1037
2022-03-04 14:36:10 -08:00
Leonardo de Moura
82b056aa75 chore: fix test 2022-03-03 19:53:35 -08:00
Leonardo de Moura
8b248e2d8c feat: elaborate for h : x in xs do ... notation 2022-03-03 19:52:26 -08:00
Leonardo de Moura
b4ddcd600b chore: fix test 2022-03-03 19:15:07 -08:00
Leonardo de Moura
b745c4f51a fix: recursive overapplication at WF/Fix.lean 2022-03-03 18:13:34 -08:00
Leonardo de Moura
4657d47c16 chore: fix tests 2022-03-03 18:13:34 -08:00
Leonardo de Moura
043d338271 feat: add getForbiddenByTrivialSizeOf 2022-03-03 11:12:32 -08:00
Leonardo de Moura
1f2618adba feat: delaborate cond using bif-then-else 2022-03-03 07:41:39 -08:00
Leonardo de Moura
8dd76868ff test: plan for supporting combinators (e.g., List.foldl) in WF recursion 2022-03-02 15:18:25 -08:00
Leonardo de Moura
e091e7fb30 test: simplify proofs 2022-03-02 13:57:43 -08:00
Leonardo de Moura
4ba97c22ec test: proving properties of mutually defined functions 2022-03-02 13:40:19 -08:00
Leonardo de Moura
14ef4b4304 test: add WF test that exposes the need for better error messages 2022-03-02 12:47:19 -08:00
Leonardo de Moura
52403fca83 feat: add support for guessing (very) simple WF relations
There are a lot of TODOs, but it is already useful for simple cases.

closes #847
2022-03-02 11:52:00 -08:00
Leonardo de Moura
1e205d635e fix: bug at wfRecursion
"After compilation" attributes were being applied to soon when we did
not need to generate auxiliary functions.
2022-03-01 17:48:06 -08:00
Leonardo de Moura
2daf8d62ac test: LazyList with Thunk 2022-03-01 16:55:56 -08:00
Leonardo de Moura
da55789c26 feat: add a proper BEq instance for Nat 2022-03-01 09:01:08 -08:00
Gabriel Ebner
3746005f5f fix: reject projection (_ : ∃ x, p).2
The inferred type of this projection does not even type check, in general.
2022-03-01 09:00:46 -08:00
Leonardo de Moura
4e310ac63d feat: improve SimpTheorem preprocessor 2022-02-28 18:27:36 -08:00
Leonardo de Moura
adf3510e08 chore: increase maxHeartbeats default values
We now increase the number of heartbeats at `expr_eq_fn`. Thus, the
old default values are too small.
2022-02-28 15:44:08 -08:00
Leonardo de Moura
e455df9c95 fix: use a def-eq aware mapping at toLinearExpr
The new test exposes the problem fixed by this commit.
In the termination proof we have two `sizeOf xs` terms that are not
syntactically identical (only definitional equal) because the
instances are different.
2022-02-28 13:46:36 -08:00
Leonardo de Moura
10657f5e81 feat: add trace <string> tactic 2022-02-28 11:16:42 -08:00
Leonardo de Moura
63a5cd5056 fix: trace_state messages should not be lost during backtracking 2022-02-28 11:07:41 -08:00
Sebastian Ullrich
53d313c74c chore: fix function name 2022-02-28 16:16:22 +01:00
Leonardo de Moura
c5fdd54cd8 feat: support for acyclicity at unifyEqs
closes #1022
2022-02-27 10:03:40 -08:00
Leonardo de Moura
89f88b1caa feat: simplify nested arith expressions 2022-02-27 09:01:52 -08:00
Leonardo de Moura
2c00823da9 test: simp_arith 2022-02-27 09:01:52 -08:00
Leonardo de Moura
90055fb7d4 chore: clarify error message at decreasing_tactic 2022-02-26 10:15:05 -08:00
Leonardo de Moura
f22b48b226 fix: display all remaining goals at fail tactic error message 2022-02-26 09:49:06 -08:00
Leonardo de Moura
f7f886dcb2 feat: improve error message for decreasing_tactic failures 2022-02-26 09:42:59 -08:00
Leonardo de Moura
cabd599de1 feat: add fail tactic 2022-02-26 09:31:19 -08:00
Leonardo de Moura
0242eb7ede feat: use simp (config := { arith := true }) at decreasing_tactic
closes #262
2022-02-26 09:12:34 -08:00
Leonardo de Moura
ff76958959 feat: basic support for linear Nat arithmetic at simp 2022-02-26 08:58:32 -08:00
Leonardo de Moura
41a5c2bce4 feat: add support for negation at simpCnstr? 2022-02-25 18:30:09 -08:00
Leonardo de Moura
7217ee7754 fix: GE.ge and GT.gt support at simpCnstr? 2022-02-25 17:12:27 -08:00
Leonardo de Moura
3f636b9f83 feat: add Lean.Meta.Linear.Nat.simpCnstr? 2022-02-25 16:27:21 -08:00
Leonardo de Moura
049273afee fix: add workarounds to code generator
The issue is only going to be properly fixed when we rewrite `csimp`
in Lean. The `csimp` performs transformations that do not preserve
typability, but it also uses the kernel `infer_type` which assumes the
input is type correct. In the new `csimp`, we must have a different
`infer_type` which returns an `Any` type in this kind of situation.

The workaround in this commit simply disables optimizations when
`infer_type` fails. It does not fix all occurrences of this problem,
but the two places that issue #1030 triggered.

closes #1030
2022-02-25 08:47:56 -08:00
Leonardo de Moura
4f7067fe7f fix: substEqs may close input goal
closes #1029
2022-02-25 08:07:23 -08:00
Leonardo de Moura
7920db9521 feat: check for invalid projections during elaboration
It produces a better error message than the one produced by the
kernel.
2022-02-25 07:43:37 -08:00
Leonardo de Moura
db38bc4043 fix: missing check at infer_proj
We should not allow `h.1` if `h` is a proposition and the result is
not. The recursor for `h`'s type can only eliminate into `Prop`.
2022-02-25 07:15:34 -08:00
Leonardo de Moura
e04ad112b2 fix: store levelNames in the SavedContext 2022-02-24 17:47:26 -08:00
Leonardo de Moura
2961e9cbf0 fix: heuristic for deciding which additional propositions must be included in equality theorems 2022-02-24 17:17:07 -08:00