Commit graph

116 commits

Author SHA1 Message Date
Leonardo de Moura
f5509ab867 fix: equational lemma generation for definitions using named patterns
closes #945
2022-01-19 17:45:54 -08:00
Leonardo de Moura
ef449e816f chore: improve trace messages 2022-01-19 14:29:04 -08:00
Leonardo de Moura
873a2ba8a6 feat: unfold namedPattern applications at equation theorems 2022-01-18 15:03:20 -08:00
Leonardo de Moura
1e21815e41 fix: equality theorem generation when named patterns are used
closed #945
2022-01-18 14:37:51 -08:00
Leonardo de Moura
c12fa6f0e2 fix: error message
The equation theorems may fail for other reasons.
2022-01-18 14:11:54 -08:00
Leonardo de Moura
1c1e6d79a7 feat: add equality proof for named patterns
The user can optionally name the equality proof.
The new test demostrates how to name the equality proof.

closes #501
2022-01-18 12:43:01 -08:00
Leonardo de Moura
42fe01a3eb feat: add new flag to caseValues 2022-01-18 12:15:29 -08:00
Leonardo de Moura
6631f1d5b3 chore: use namedPatternOld 2022-01-17 17:18:03 -08:00
Leonardo de Moura
2c690926cf feat: update namedPattern parser 2022-01-17 16:49:20 -08:00
Leonardo de Moura
bac91b9b5b chore: remove arbitrary 2022-01-15 12:14:27 -08:00
Leonardo de Moura
df6095e580 fix: casesOnStuckLHS method
It was not general enough.
2022-01-06 13:54:17 -08:00
Leonardo de Moura
68bd55af32 chore: fix codebase 2021-12-10 13:12:09 -08:00
Leonardo de Moura
41040a81de fix: auxiliary matcher definitions should be treated as abbreviations
The motivation is to prevent performance problems such as the one
described at issue #854.

Fixes #854 after a update stage0
2021-12-07 16:43:20 -08:00
Leonardo de Moura
d806344ee2 fix: set etaStruct := false at MatchEqns 2021-11-25 11:31:00 -08:00
Leonardo de Moura
58430704e5 refactor: move inaccessible? to Expr.lean 2021-10-20 15:54:18 -07:00
Leonardo de Moura
35c7081377 feat: improve casesOnStuckLHS 2021-09-19 08:28:10 -07:00
Leonardo de Moura
38090fa3c0 feat: improve casesOnStuckLHS 2021-09-17 18:48:45 -07:00
Leonardo de Moura
6eff84a7bb refactor: add generic mkBaseNameFor 2021-09-17 16:30:09 -07:00
Leonardo de Moura
6b235b05d2 feat: avoid code generation after stage1 for match auxiliary functions 2021-09-11 13:41:38 -07:00
Leonardo de Moura
0cf2c19fc2 fix: condition for selecting split target
Only discriminants must not have loose bound variables
2021-09-10 14:56:15 -07:00
Leonardo de Moura
445cc3085f refactor: avoid Name, MVarId, and FVarId confusion 2021-09-07 19:06:50 -07:00
Leonardo de Moura
a8044eb252 feat: improve Match module for patterns containing Fin and UInt literals 2021-09-05 20:43:40 -07:00
Leonardo de Moura
2375447b4d chore: remove temporary trace messages 2021-08-31 12:13:07 -07:00
Leonardo de Moura
0a215ac1d2 feat: store the number of parameters in each match splitter alternative 2021-08-30 20:57:18 -07:00
Leonardo de Moura
92cf7c987f chore: cleanup 2021-08-30 16:33:05 -07:00
Leonardo de Moura
02224548d2 chore: generalize signatures 2021-08-30 07:05:40 -07:00
Leonardo de Moura
9d5f211c28 feat: add environment extension for storing match conditional equations and splitter 2021-08-28 14:49:20 -07:00
Leonardo de Moura
2f8d2e8a12 feat: add procedure for solving subgoals generated by mkSplitterProof 2021-08-24 20:23:13 -07:00
Leonardo de Moura
2b9fded6b7 feat: add splitter theorem 2021-08-24 18:37:12 -07:00
Leonardo de Moura
14b65499e6 feat: construct proof template for the auto generated extended elimination principle 2021-08-24 17:13:42 -07:00
Leonardo de Moura
214f2f7bb6 fix: toFVarsRHSArgs 2021-08-24 16:50:03 -07:00
Leonardo de Moura
269a3478e0 refactor: cleanup mkEquationsFor
and build eliminator type where alternatives have the extra
conditions that ensure none of the previous alternatives are applicable.
2021-08-23 20:19:24 -07:00
Leonardo de Moura
ca747e9b27 feat: use contradiction at leaves
closes #644
2021-08-22 18:41:02 -07:00
Leonardo de Moura
49520aa2ee feat: generate conditional equation theorems for match expressions 2021-08-19 19:33:31 -07:00
Leonardo de Moura
3c519887d1 chore: generate error message when MatchEqs fail
TODO: we currently do not generate equation theorems
for `match` expressions using array literals.
2021-08-19 17:04:52 -07:00
Leonardo de Moura
1624e42a5d chore: cleaup 2021-08-19 14:39:58 -07:00
Leonardo de Moura
bffefa61bd feat: extend contradiction for MatchEqs.lean 2021-08-19 12:52:50 -07:00
Leonardo de Moura
a6529a795b feat: add casesOnStuckLHS 2021-08-19 11:22:13 -07:00
Leonardo de Moura
015df19808 feat: add trySubst 2021-08-19 07:08:02 -07:00
Leonardo de Moura
45d3b85d5a refactor: cleanup MatchEqs and simplify SplitIf 2021-08-18 18:34:34 -07:00
Leonardo de Moura
83eaa47e0a chore: move MatchEqs 2021-08-17 21:32:32 -07:00
Leonardo de Moura
a821dcbff2 chore: enforce naming convention for theorems
see issue #402

fix: `ElabTerm.lean`
2021-08-07 12:48:38 -07:00
Leonardo de Moura
bba9353619 fix: make sure isDefEqOffset does not expose kernel nat literals
This issue is similar to a bug where `isDefEqOffset` was exposing
`Nat.add` when processing `HAdd.hAdd`.

Fixes #561
The example at issue #561 is now working, but we may have other places
where raw literals are being accidentally exposed.
2021-08-02 11:27:00 -07:00
Gabriel Ebner
3cff5ceb99 perf: make trace[...] ... notation lazy 2021-06-23 00:07:27 -07:00
Daniel Fabian
9200de01ef refactor: fix code review comments. 2021-06-06 06:40:09 -07:00
Daniel Fabian
4e88fdc99a feat: add getMkMatcherInputInContext. 2021-06-06 06:40:09 -07:00
Leonardo de Moura
28b055463f fix: fixes #471 2021-05-22 15:42:52 -07:00
Daniel Fabian
42bd44ab82 refactor: Capture environment modification in mkMatcher.
Doing this allows us to add the declaration in the backtracking case of structural recursion.
2021-05-20 15:20:16 -07:00
Daniel Fabian
91ecbb5b5c feat: Add withMkMatcherInput.
This is the inverse function to `mkMatcher`, i.e. a way to turn a matcher into an input.
2021-05-19 07:28:14 -07:00
Daniel Fabian
cf030a1634 refactor: Add MkMatcherInput.
Since we are going to make `mkMatcher` reversible, it's quite useful to have the input be a `structure`. This way we make sure, that the inverse function always returns the same type as `mkMatcher` needs as input.
2021-05-19 07:28:14 -07:00