Leonardo de Moura
52b52b22ef
fix: to do unfold matcher applications that cannot be reduced when smartUnfolding is true
...
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/How.20to.20WHNF.20without.20exposing.20recursors.3F
2021-08-17 21:32:32 -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
Sebastian Ullrich
756d7643f0
chore: rename syntaxMaxDepth option for consistency and discoverability
...
/cc @leodemoura
2020-12-21 16:25:01 +01:00
Sebastian Ullrich
29c2023410
fix: adapt to new matchAlt syntax
2020-12-16 18:52:56 +01:00
Leonardo de Moura
ac85650e0a
feat: add optional where clause at declarations
...
closes #191
@Kha Note that it expands into a "let rec".
There are many other places where an optional `where`-clause is
useful. We can add them later. It is relatively easy to add support in
other places using the new helper functions
`expandWhereDeclsOpt` and `expandMatchAltsWhereDecls`
2020-11-23 12:04:51 -08:00
Leonardo de Moura
db9e390b4d
chore: remove new_frontend from tests
2020-10-25 09:16:38 -07:00
Leonardo de Moura
908e5f7acd
fix: elabDiscrsWitMatchType
2020-10-15 11:00:33 -07:00
Leonardo de Moura
4e99b19a96
fix: expandMatchDiscr cannot be a macro
...
The `matchType` created by the macro is bad for dependent pattern
matching. The `tst8` and `tst9` at `matchTac` failed to be elaborated
when using the macro.
2020-09-15 13:29:28 -07:00
Leonardo de Moura
2214d81e84
test: add match with proofs example
2020-09-09 16:59:45 -07:00
Leonardo de Moura
d3de12fa09
test: another dependent pattern matching test
2020-09-09 16:51:46 -07:00
Leonardo de Moura
c9f4f858b1
feat: ellipsis in constructor application patterns
...
Given
```
inductive Foo
| mk₁ (x y z w : Nat)
| mk₂ (x y z w : Nat)
```
We can now write
```
def Foo.z : Foo → Nat
| mk₁ (z := z) .. => z
| mk₂ (z := z) .. => z
```
instead of
```
def Foo.z : Foo → Nat
| mk₁ _ _ z _ => z
| mk₂ _ _ z _ => z
```
cc @Kha
2020-09-09 10:21:06 -07:00
Leonardo de Moura
276e6a55ba
feat: improve collectPatternVars
...
Add support for `@` and named parameters.
Fix how ctor fields are processed.
2020-09-09 09:52:25 -07:00
Leonardo de Moura
2e11053eb5
fix: matchAlt macros should not consume implicit arguments
...
As in Lean3, the following example is a valid definition
```
def head : {α : Type} → List α → Option α
| _, a::as => some a
| _, _ => none
```
2020-09-08 17:31:57 -07:00
Leonardo de Moura
7809fe0b01
fix: def+match macro
2020-09-07 11:34:53 -07:00
Leonardo de Moura
70c42456b9
feat: expand intro+matchAlts macro
2020-09-04 18:22:56 -07:00
Leonardo de Moura
ef64e1c25a
feat: fun+match macro
...
Example:
```
fun
| 0 => true
| _ => false
```
2020-09-04 16:23:01 -07:00
Leonardo de Moura
f67181baf3
chore(*): remove support for Lua
2016-02-11 17:17:55 -08:00
Leonardo de Moura
d6a483fe84
feat(library): add idx_metavar module
2015-06-08 16:02:37 -07:00
Leonardo de Moura
57ea660963
refactor(*): start process for eliminating of opaque definitions from the kernel
...
see issue #576
2015-05-08 16:06:04 -07:00
Leonardo de Moura
f79f43c702
refactor(library/match): use "special" meta-variables instead of free variables to represent placholders in the higher-order matcher
2015-02-03 15:15:04 -08:00
Leonardo de Moura
4946f55290
refactor(frontends/lean): constant/axiom are top-level commands, parameter/variable/hypothesis/conjecture are section/context-level commands
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-02 17:55:34 -07:00
Leonardo de Moura
364bba2129
feat(frontends/lean/inductive_cmd): prefix introduction rules with the name of the inductive datatype
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 17:26:36 -07:00
Leonardo de Moura
8743394627
refactor(kernel/inductive): replace recursor name, use '.rec' instead of '_rec'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 15:04:57 -07:00
Leonardo de Moura
e51c4ad2e9
feat(frontends/lean): rename 'using' command to 'open'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 16:00:38 -07:00
Leonardo de Moura
e6ffda0c51
feat(library/match): add basic match_plugin that just invokes whnf before failing
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-05 08:37:03 -07:00