Daniel Fabian
cb18af6184
feat: add withLocalDecls and withLocalDeclsD
...
They are array versions of `withLocalDecl` and `withLocalDeclD`, respectively. They are useful when you need to create variables dynamically.
2021-04-16 07:54:04 -07:00
Leonardo de Moura
555b978d67
refactor: add GeneralizeVars.lean
...
Helper methods for performing auto generalization.
2021-04-15 21:37:48 -07:00
Leonardo de Moura
dbc84c502c
chore: make sure we don't lift methods over binders
2021-04-15 12:06:46 -07:00
Leonardo de Moura
484a3a4e7c
fix: should only cache inferred type when there are no metavars
2021-04-11 19:10:41 -07:00
Leonardo de Moura
2694e7798a
refactor: add MonadBacktrack
...
The new class specifies an interface for saving and restoring the
backtrackable part of the state.
This commit also fixes a few issues.
- `commitWhen` at `LevelDefEq` was defining a checkpoint for
the `isDefEq` methods, and it affects how postponed universe
constraints are handled. However, the name suggests it is
similar to `commitWhenSome?`, and consequently it was used
in other places that had nothing to do with `isDefEq`.
So, I renamed it, and provided the generic `commitWhen` at the new
`MonadBacktrack.lean` file.
- We were restoring more state then needed in a few places.
For example, we were discarding all caches.
- At `SyntheticMVars.lean`, we were using the `Meta.commitWhenSome?`
method which does not restore the `Term.State`.
2021-04-11 19:10:41 -07:00
Leonardo de Moura
e56bf66d8d
chore: rename option hygienicIntro ==> tactic.hygienic
...
It is easier to find.
2021-04-10 16:09:04 -07:00
Leonardo de Moura
6dbf227cf2
fix: issues #387 part 2
...
see #387
2021-04-10 15:51:07 -07:00
Leonardo de Moura
91cb4aad2a
refactor: simplify and document SimpLemma encoding
2021-04-10 15:03:04 -07:00
Leonardo de Moura
4f09390b8e
feat: create SimpLemmas.Proof.abst at the simp tactic frontend
2021-04-10 14:17:43 -07:00
Leonardo de Moura
8be9a13679
feat: support for SimpLemma.Proof.abst
2021-04-10 12:46:48 -07:00
Leonardo de Moura
a1205afac2
feat: allow simp lemmas to be AbstractMvarsResult
2021-04-10 11:37:39 -07:00
Sebastian Ullrich
1b1ac393d8
fix: do not try to pretty-print unknown metavariables
...
Fixes #380
2021-04-08 18:16:05 +02:00
Leonardo de Moura
0a94aaabc9
feat: use expected type to prioritize completion candidates
2021-04-03 14:12:42 -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
41539a7725
fix: leftovers in the local context when applying induction
2021-03-27 19:42:22 -07:00
Leonardo de Moura
566fad77d4
chore: helper methods
2021-03-27 18:48:03 -07:00
Leonardo de Moura
b899447817
refactor: move collectFVars to Meta
2021-03-26 19:16:21 -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
dd9cc7a273
fix: typo
2021-03-25 15:57:10 -07:00
Leonardo de Moura
083301e286
fix: non-dependent arrow vs dependent arrow issue at DiscrTree
2021-03-25 13:04:24 -07:00
Leonardo de Moura
b7acc38810
feat: add support for "arrow" at DiscrTree
2021-03-25 12:21:10 -07:00
Leonardo de Moura
ce1dda8eea
fix: missing withMVarContext
2021-03-24 18:25:41 -07:00
Leonardo de Moura
650c6df380
feat: try other variables after failure
2021-03-22 21:02:26 -07:00
Leonardo de Moura
17907a7829
fix: perform topological sort on pattern variables
2021-03-22 20:35:07 -07:00
Leonardo de Moura
3749213e08
fix: missing whnf at Unify.unify
2021-03-21 22:38:46 -07:00
Leonardo de Moura
2fd0b8c663
feat: contradiction catches empty inductive types
2021-03-21 21:48:43 -07:00
Leonardo de Moura
3d6154f147
fix: contradiction
...
It must ignore auxiliary declarations.
2021-03-21 20:05:15 -07:00
Leonardo de Moura
123783d5f9
fix: some issues at cases and subst
2021-03-21 18:35:31 -07:00
Leonardo de Moura
880f1372bd
feat: set pp.inaccessibleNames true when visualizing tactic state
...
@Kha The default value (false) for `pp.inaccessibleNames == false` help when
visualizing error messages (see test
`hidingInaccessibleNames.lean`). We added this feature after to hide
intermediate variables created by `match_syntax`.
However, this default value confused me in tactic mode. For example,
it will hide a hypotheses `x : Fin 0` if nobody depends on it, but as
a user we want to know we have it since we can close the goal using
it. Thus, I added `withPPInaccessibleNames act`, it executes `act`
using `pp.inaccessibleNames true` if the user did not explicitly set
it. I use this combinator at `FileWorker` and when producing the
`unsolved goals` error message. In all other scenarios, I believe
hiding these inaccessible variables is a good thing.
2021-03-21 18:21:46 -07:00
Leonardo de Moura
d9273786c7
chore: remove when and «unless»
...
They are obsolete.
cc @Kha
2021-03-20 18:52:18 -07:00
Sebastian Ullrich
2f168e3364
feat: mkConstWithLevelParams
2021-03-20 08:28:18 -07:00
Leonardo de Moura
86a204d8a1
feat: add simp_all tactic
...
cc @Kha
2021-03-19 22:34:35 -07:00
Leonardo de Moura
d70740fef2
fix: location notation and simp
2021-03-19 19:54:22 -07:00
Leonardo de Moura
94465e8a02
feat: add helper simp methods
2021-03-19 14:11:15 -07:00
Leonardo de Moura
da8e5150c9
feat: add getNondepPropHyps
2021-03-18 14:25:50 -07:00
Leonardo de Moura
dd8ead186f
feat: allow caller to set lemma id
2021-03-18 14:25:16 -07:00
Leonardo de Moura
1af02dcaca
feat: allow users to mark definitions with [simp]
...
cc @JasonGross @Kha
2021-03-17 19:11:55 -07:00
Leonardo de Moura
3208faa192
feat: add set of declarations to unfold at SimpLemmas
2021-03-17 18:52:23 -07:00
Leonardo de Moura
5eda786f6e
feat: use False.elim when simplifying local declarations that rewrite to False
2021-03-17 15:30:54 -07:00
Leonardo de Moura
89797c4485
chore: improve congrDefault
...
We don't need `congrMatch` anymore.
2021-03-16 15:59:11 -07:00
Leonardo de Moura
8227d3afcd
feat: support for simplifying match discriminants
2021-03-16 15:51:36 -07:00
Leonardo de Moura
2970c6ca79
feat: add mkCongrDepArg and mkCongrDep
2021-03-16 15:40:48 -07:00
Leonardo de Moura
cc0712fc82
feat: add support for offset terms at DiscrTree
2021-03-14 08:23:44 -07:00
Leonardo de Moura
bf8119a5cd
chore: convert keywords to snake_case
...
Again `!` is only for functions that can panic.
2021-03-12 13:34:51 -08:00
Leonardo de Moura
865316bbf9
feat: improve error message when stuck solving universe constraints
...
closes #343
2021-03-11 17:46:44 -08: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
164577d94e
chore: remove parser! and tparser!
...
The new macros are called "leading_parser` and `trailing_parser`.
cc @Kha
2021-03-11 09:36:58 -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
30ba56126b
fix: missing case
...
Lean should not get stuck at universe constraints such as `?u =?= ?u + 1`.
2021-03-10 14:48:02 -08:00
Leonardo de Moura
a3923eecc8
feat: filter duplicate universe constraints at error message
2021-03-10 14:40:25 -08:00