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
c3bb948009
feat: ignore nested proofs in patterns
2021-09-05 15:46:03 -07:00
Leonardo de Moura
4abbb3d74c
chore: cleanup
2021-08-11 16:05:07 -07:00
Leonardo de Moura
7e1bb3e65b
refactor: add MatchAltView.lean and PatternVar.lean
2021-06-28 08:29:47 -07:00
Leonardo de Moura
7f986c62ba
refactor: add Arg.lean
2021-06-28 08:10:16 -07:00
Sebastian Ullrich
eb1e285e26
chore: style
2021-06-21 10:17:26 -07:00
Leonardo de Moura
af4485f40e
fix: fixes #482
2021-05-21 19:20:24 -07:00
Leonardo de Moura
8eceb07caf
feat: new discriminant refinement procedure
2021-05-21 18:08:11 -07:00
Leonardo de Moura
73797841ba
feat: add findDiscrRefinementPath
...
The new method is going to be used to improve the discriminant
refinement procedure.
2021-05-20 21:54:48 -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
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
b0f0a59729
refactor: elabDiscrs
...
Elaborate discriminants forward and infer match-type backwards.
2021-05-18 19:59:11 -07:00
Leonardo de Moura
8f5c39e2b8
chore: fix typo
2021-05-18 19:35:55 -07:00
Leonardo de Moura
96ed029308
refactor: use StateRefT at elabDiscrs
2021-05-18 19:29:25 -07:00
Leonardo de Moura
7cabbc814d
chore: cleanup before extending match
2021-05-18 18:29:23 -07:00
Leonardo de Moura
475f5fecaa
feat: improve error recovery at Tactic.elabTerm
2021-05-06 20:44:36 -07:00
Sebastian Ullrich
6303c134a9
feat: add term info at resolveId?
2021-05-05 18:54:47 +02:00
Leonardo de Moura
eaa7582e60
feat: add toPattern
2021-05-03 11:44:40 -07:00
Leonardo de Moura
0a018f2369
chore: add support for binop% in patterns
2021-04-30 18:38:44 -07:00
Sebastian Ullrich
9301e05a7e
feat: double-quoted quotation semantics and basic precheck hooks
2021-04-27 16:38:37 -07:00
Leonardo de Moura
26b6953558
chore: remove dead code
...
Tuple notation is a macro now.
2021-04-27 16:14:45 -07:00
Leonardo de Moura
18085b9712
fix: improve match generalizing feature
2021-04-26 19:22:03 -07:00
Leonardo de Moura
762cebbbfc
fix: match generalization bug
2021-04-19 18:37:25 -07:00
Leonardo de Moura
157ef80c5a
feat: match auto generalization
2021-04-16 21:48:38 -07:00
Leonardo de Moura
3bd34182ee
chore: generalizing skeleton
2021-04-16 09:51:12 -07:00
Leonardo de Moura
1c23d68c6a
feat: add (generalizing := true/false) optional attribute to match
2021-04-15 17:04:25 -07:00
Leonardo de Moura
292bab5a11
fix: loop due to error recovery
2021-04-13 08:12:39 -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
98c6fd1151
fix: another antipattern
2021-04-07 10:42:54 -07:00
Leonardo de Moura
a22d8dd924
fix: the code is reachable
2021-04-02 11:10:06 -07:00
Sebastian Ullrich
30062b8988
fix: nomatch with non-fvar terms
2021-04-02 16:04:47 +02:00
Leonardo de Moura
9f9529467e
chore: document recent modifications
2021-03-30 13:29:23 -07:00
Leonardo de Moura
b3a665118a
feat: add isAtomicDiscr?
2021-03-30 13:09:56 -07:00
Leonardo de Moura
19e0a84817
fix: make the match behavior more uniform
2021-03-30 12:19:31 -07:00
Leonardo de Moura
6cfc8d0937
fix: ensure discriminants are distinct variables
2021-03-26 16:28:21 -07:00
Leonardo de Moura
4a5368fd93
fix: accidental name capture
2021-03-26 16:28:21 -07:00
Leonardo de Moura
3176be136c
feat: improve "discriminant refinement"
2021-03-24 21:05:08 -07:00
Leonardo de Moura
66a8683f08
fix: updateMatchType may generate type incorrect terms
...
If generated type is not correct, we should abort "discriminant
refinement", and use the original error message because users may
be confused by a type error on something they did not write.
2021-03-24 19:41:25 -07:00
Leonardo de Moura
4044308090
chore: use double quoted names
2021-03-24 12:36:18 -07:00
Leonardo de Moura
e31c02522b
feat: closes #327
2021-03-24 12:29:33 -07:00
Leonardo de Moura
d86164cf54
fix: simple match case
2021-03-24 11:46:55 -07:00
Leonardo de Moura
1eb9d16690
chore: fix typos
2021-03-23 20:47:56 -07:00
Leonardo de Moura
5742b078af
feat: "discriminant refinement" for match-expressions
2021-03-23 20:40:07 -07:00
Leonardo de Moura
17907a7829
fix: perform topological sort on pattern variables
2021-03-22 20:35:07 -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
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
4bbcd305b5
fix: disable implicit-lambdas when elaborating patterns
...
@Kha, Jason's example on issue #337 suggests that injecting
implicit-lambdas while elaborating patterns is problematic.
The elaborator was injecting `fun {Γ} =>` before the
pattern variable `ftm`.
So, I disabled the implicit-lambda during pattern elaboration. I
didn't find an example where it would be useful.
see #337
cc @JasonGross
2021-03-08 15:45:30 -08:00
Leonardo de Moura
0e3aa2c29b
fix: scope of forallTelescopeReducing
...
Nested constructors were being processed using an extended local context.
Fix issue reported by @JasonGross at Zulip.
closes #338
2021-03-08 08:29:48 -08:00