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
Leonardo de Moura
bdea43a52a
feat: while and repeat macros
2022-02-24 16:26:07 -08:00
Leonardo de Moura
05be43455a
feat: add src/Init/Data/Nat/Linear.lean
2022-02-24 13:45:17 -08:00
Leonardo de Moura
43c2169f78
fix: when performing contextual simplification, and arrow may become a dependent arrow
...
fixes #1024
2022-02-23 18:43:32 -08:00
Leonardo de Moura
49c64040a2
feat: add support for HEq at injections tactic
2022-02-23 17:31:17 -08:00
Leonardo de Moura
07d1ec1926
fix: simp_all was "self-simplifying" simplified hypotheses
...
fixes #1027
2022-02-23 16:48:28 -08:00
Leonardo de Moura
16b8800607
chore: fix tests
2022-02-23 16:30:27 -08:00
Leonardo de Moura
0125db40a2
fix: remove [..] annotation from if simp theorems
...
fixes #1025
2022-02-23 16:28:12 -08:00
Leonardo de Moura
52b53ab7a2
fix: heuristic for generating equation theorem types
...
closes #1026
2022-02-23 13:10:30 -08:00
Leonardo de Moura
1ac9c1263b
test: add helper theorems
2022-02-23 11:52:03 -08:00
Leonardo de Moura
dbe9bf61c5
fix: unfold auxiliary theorems created by decreasing_tactic
2022-02-23 09:02:23 -08:00
Leonardo de Moura
52ff840321
feat: support for HEq at injection
2022-02-22 17:24:11 -08:00
Leonardo de Moura
c9f8ec71df
fix: invalid rewrite when proving equation theorems for declaration using well-founded recursion
2022-02-22 16:38:51 -08:00
Leonardo de Moura
d36027d2fa
test: add Certificate.of_combine_isUnsat
2022-02-22 16:04:23 -08:00
Leonardo de Moura
77fc0d3223
test: cleanup
2022-02-22 07:23:07 -08:00
Leonardo de Moura
c932d9d33c
test: combine two inequalities
2022-02-21 15:13:37 -08:00
Leonardo de Moura
e9ee8ee86f
test: add cancelation theorems for <= and <
2022-02-21 08:49:50 -08:00
Leonardo de Moura
0986696758
test: add cancelation example
2022-02-20 17:35:33 -08:00
Leonardo de Moura
a8427702e8
test: reverse direction for cancelation procedure
2022-02-20 17:03:11 -08:00
Leonardo de Moura
4ccab41819
test: proof by reflection example
2022-02-20 10:11:40 -08:00
Leonardo de Moura
cf0f7a30c4
test: add Monomials.cancel
2022-02-19 21:29:33 -08:00
Leonardo de Moura
855b71299f
test: arith by reflection
2022-02-19 17:54:32 -08:00
Leonardo de Moura
7a81589c49
feat: improve "constant approximation" heuristic used at isDefEq
2022-02-19 08:09:31 -08:00
Leonardo de Moura
e61d0be561
feat: isolate fixed prefix at well-founded recursion
...
closes #1017
2022-02-18 10:40:32 -08:00
Leonardo de Moura
70312191f7
feat: make sure packDomain and packMutual ignore the fixed arguments
...
TODO: adapt `elabWFRel`, `mkFix`, and etc.
This is needed for #1017
2022-02-17 17:43:06 -08:00
Leonardo de Moura
9ee529e5ce
fix: use PSum instead of Sum when using well-founded recursion
...
See new test for example that did not work with `Sum` because type
alpha was `Sort u`.
2022-02-17 16:14:34 -08:00