Commit graph

101 commits

Author SHA1 Message Date
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
Leonardo de Moura
b4a7d28cff fix: inconsistent inaccessible annotations 2021-05-05 10:45:38 -07:00
Leonardo de Moura
eaa7582e60 feat: add toPattern 2021-05-03 11:44:40 -07:00
Leonardo de Moura
9d45ea6721 feat: try to improve dependent pattern matching failure error message 2021-03-30 23:40:11 -07:00
Leonardo de Moura
f20fc6328c fix: better error message when cases fails and there are no alternatives 2021-03-26 16:28:21 -07:00
Leonardo de Moura
650c6df380 feat: try other variables after failure 2021-03-22 21:02:26 -07:00
Leonardo de Moura
3749213e08 fix: missing whnf at Unify.unify 2021-03-21 22:38:46 -07:00
Leonardo de Moura
8227d3afcd feat: support for simplifying match discriminants 2021-03-16 15:51:36 -07:00
Leonardo de Moura
be841a7cad chore: throwError! => throwError, throwErrorAt! => throwErrorAt
@Kha I marked the corresponding methods as `protected`.
I currently can't stand `throw_error`, and I am optimistic about
server highlighting feature you are working on :)
2021-03-11 11:59:45 -08:00
Leonardo de Moura
68143ca8ba chore: trace[...]! ==> trace[...]
@Kha I think this one is a good change, there is no real reason for
using the `!` suffix here.
2021-03-10 18:44:43 -08:00
Leonardo de Moura
e1f6965266 feat: allow user to define rewrite lemmas with (local) match expressions 2021-02-19 15:18:19 -08:00
Leonardo de Moura
15e6ae2cdb chore: cleanup 2021-02-16 16:16:21 -08:00
Leonardo de Moura
6c119a1921 chore: use register_builtin_option 2021-01-26 18:24:56 -08:00
Leonardo de Moura
ea0fda39bc chore: Declaration.lean naming convention
`Declaration.lean` was one of the first Lean 4 files, and was still
using an old naming convention.

cc @Kha
2021-01-20 17:07:02 -08:00
Leonardo de Moura
6a39c65bd2 feat: improve match error message 2021-01-14 14:58:34 -08:00
Leonardo de Moura
11c7ca40c3 fix: missing case at Match.lean 2021-01-07 17:38:22 -08:00