Leonardo de Moura
aa68057c85
chore: more general type universes in example
2022-03-15 05:19:02 -07:00
Leonardo de Moura
4e261b15e5
fix: smart unfolding bug in over applications
2022-03-14 19:17:21 -07:00
Leonardo de Moura
eb7539ef77
fix: mkEqnTypes overapplied lhs in equational theorems
...
This issue was exposed by the "Dependent de Bruijn indices" from CPDT.
2022-03-14 17:42:21 -07:00
Leonardo de Moura
7fda1f47f8
test: add test for issue fixed in previous commit
2022-03-14 14:11:08 -07:00
Leonardo de Moura
ef154ec0cf
test: add TreeNode example using for in notation
2022-03-14 11:52:54 -07:00
Leonardo de Moura
2ac9cfb7b1
fix: eta expand partial applications of recursive function being defined
2022-03-14 10:05:33 -07:00
Leonardo de Moura
801552e1ac
chore: fix tests
2022-03-14 10:05:33 -07:00
Leonardo de Moura
d2cc5b4a83
chore: fix test
2022-03-13 15:53:21 -07:00
Leonardo de Moura
fa0964c07e
fix: preserve variable name at WF decreasing goals when function has only one non fixed argument
2022-03-13 13:20:07 -07:00
Leonardo de Moura
060be7e7ec
fix: :: is infix right
2022-03-13 09:25:56 -07:00
Leonardo de Moura
672a889c83
test: add hlist pattern match example
2022-03-13 09:15:55 -07:00
Leonardo de Moura
5707cab7bf
feat: improve #eval command
...
Now, if it fails to synthesize the TC instance, it applies `whnf` and
tries again.
2022-03-12 19:55:15 -08:00
Leonardo de Moura
3cd41acd14
test: HList with notation overloads
2022-03-12 19:47:57 -08:00
Leonardo de Moura
af5a24140a
test: simple type checker at CPDT
2022-03-12 18:44:52 -08:00
Leonardo de Moura
7e3519a3a2
test: add CPDT first example
2022-03-12 17:06:20 -08:00
Leonardo de Moura
f0c31d7e28
feat: allow rw to unfold nonrecursive definitions too
2022-03-12 15:44:52 -08:00
Leonardo de Moura
cf0ca026fb
feat: equation theorems at rw
2022-03-12 13:53:02 -08:00
Leonardo de Moura
a6bfefe5bd
fix: nasty performance problem at isDefEq
...
This problem was originally exposed by the `Array.eraseIdxAux`.
2022-03-12 10:44:43 -08:00
Leonardo de Moura
eddcedb58c
fix: pattern normalization code
2022-03-12 06:07:04 -08:00
Leonardo de Moura
a4f47adf9e
fix: normalize method at Match.lean
2022-03-11 18:19:37 -08:00
larsk21
64dba41b4c
feat: enable fuzzy matching for completion
2022-03-11 16:25:26 -08:00
Leonardo de Moura
5caf1bc692
chore: style
...
Use `·` instead of `.` for structuring tactics.
2022-03-11 16:12:46 -08:00
Leonardo de Moura
ddf93d2f8a
feat: support for arrow types in the dot notation
...
cc @gebner
2022-03-11 15:39:41 -08:00
Leonardo de Moura
8d42978e63
feat: generate error message when induction tactic is used on a nested inductive type without specifying an eliminator
2022-03-11 14:45:57 -08:00
Leonardo de Moura
712e9b7d45
chore: add custom induction principle for LazyList
2022-03-11 14:21:35 -08:00
Leonardo de Moura
7d5da95434
fix: remove unused hypotheses from conditional equation theorems
2022-03-11 14:10:57 -08:00
Leonardo de Moura
272dd5533f
chore: style use · instead of . for lambda dot notation
...
We are considering removing `.` as an alternative for `·` in the
lambda dot notation (e.g., `(·+·)`).
Reasons:
- `.` is not a perfect replacement for `·` (e.g., `(·.insert ·)`)
- `.` is too overloaded: `(f.x)` and `(f .x)` and `(f . x)`. We want to keep the first two.
2022-03-11 07:49:03 -08:00
Leonardo de Moura
e1fa9c131c
feat: inferring namespace from expected type a la Swift
...
Now that `PatternVars.lean` has been redesigned, it is feasible to
implement issue #944 .
closes #944
2022-03-10 16:55:25 -08:00
Leonardo de Moura
3214a20d33
feat: allow overloaded notation in patterns
2022-03-10 12:51:34 -08:00
Leonardo de Moura
fddc8b06ac
fix: missing case at getStuckMVar?
...
Fix issue reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/'rewrite'.20failed.20but.20it.20should.20work/near/274870747
2022-03-10 10:33:11 -08:00
Leonardo de Moura
7850dc023b
fix: make sure the structure instance notation does not leak auxiliary type annotations (e.g., autoParam and optParam)
2022-03-10 08:41:00 -08:00
Leonardo de Moura
efc89eb4e1
fix: make sure inferProjType consume auxiliary type annotations
2022-03-10 08:15:34 -08:00
Leonardo de Moura
0ef8aaeda0
feat: make sure minor premises in recursors do not include auxiliary type annotations (e.g., autoParam and optParam)
2022-03-10 08:08:36 -08:00
Leonardo de Moura
33883e9d2a
fix: resulting type of projection functions should not include auxiliary type annotations (e.g., autoParam)
2022-03-10 07:47:38 -08:00
Leonardo de Moura
38668308ef
fix: do not rename metavariables that are already in the patternVars array
...
It fixes a regression introduced yesterday.
2022-03-10 05:53:54 -08:00
Leonardo de Moura
ca253c43e1
refactor: pattern elaboration
...
We don't use the following hack anymore:
- /- HACK: `fvarId` is not in the scope of `mvarId`
- If this generates problems in the future, we should update the metavariable declarations. -/
- assignExprMVar mvarId (mkFVar fvarId)
This hack was corrupting the `InfoTree`.
2022-03-09 18:19:14 -08:00
Leonardo de Moura
b6dc3dda04
chore: fix tests
2022-03-09 14:02:13 -08:00
Leonardo de Moura
74411aa472
fix: do not display implicit fields
2022-03-09 12:33:22 -08:00
Leonardo de Moura
50ae170bcc
feat: allow mkLambdaFVars and mkForallFVars to abstract unassigned metavars too
2022-03-09 11:27:58 -08:00
Leonardo de Moura
164f07a5e5
feat: generalize Expr.abstractRange
...
It now takes free variables **and** metavariables.
This is the first step to make `mkForallFVars` and `mkLambdaFVars`
more general.
2022-03-08 18:19:17 -08:00
Leonardo de Moura
4ee131981d
feat: in an inductive family the longest fixed prefix of indices is now promoted to parameters
...
This modification is relevant for fixing regressions on recent changes
to the auto implicit behavior for inductive families.
The following declarations are now accepted:
```lean
inductive HasType : Fin n → Vector Ty n → Ty → Type where
| stop : HasType 0 (ty :: ctx) ty
| pop : HasType k ctx ty → HasType k.succ (u :: ctx) ty
inductive Sublist : List α → List α → Prop
| slnil : Sublist [] []
| cons l₁ l₂ a : Sublist l₁ l₂ → Sublist l₁ (a :: l₂)
| cons2 l₁ l₂ a : Sublist l₁ l₂ → Sublist (a :: l₁) (a :: l₂)
inductive Lst : Type u → Type u
| nil : Lst α
| cons : α → Lst α → Lst α
```
TODO: universe inference for `inductive` should be improved. The
current approach is not good enough when we have auto implicits.
TODO: allow implicit fixed indices that do not depend on indices that
cannot be moved to become parameters.
2022-03-08 17:56:34 -08:00
Leonardo de Moura
234046521a
feat: print number of parameters for an inductive type
2022-03-08 17:48:46 -08:00
Leonardo de Moura
7b84b4cdaa
fix: improve inductive indices elaboration
...
TODO: convert fixed indices to parameters. Motivation: types such as
```lean
inductive Foo : List α → Type
| mk : Foo []
```
Users should not need to write
```lean
inductive Foo {α} : List α → Type
| mk : Foo []
```
2022-03-08 17:48:46 -08:00
Jonathan Coates
11cce61e4d
chore: Clean up LSP folding a little
...
- Wait for all terms to be elaborated before showing folding regions.
May want to change this to support partial results.
- Use .span to extract import statements, rather than mutually
recursive functions.
- Some tiny other bits of cleanup
2022-03-07 17:23:35 +01:00
Jonathan Coates
04e60cebd1
feat: LSP code folding support
...
The following constructs are foldable:
- Sections and namespaces
- Blocks of import/open statements
- Multi-line commands (so mostly definitions)
- Mutual definitions
- Module-level doc comments
- Top-level definition doc comments
Fixes #1012
2022-03-07 17:23:35 +01:00
Sebastian Ullrich
f2d5470f19
feat: allow interpretation of constants initialized by native code
2022-03-07 10:59:49 +01:00
Leonardo de Moura
dddfb65660
test: use notation
2022-03-06 19:28:01 -08:00
Leonardo de Moura
7c5604996a
test: unfoldr
2022-03-06 19:26:04 -08:00
Leonardo de Moura
10bccfe501
test: remove workaround
2022-03-06 13:58:42 -08:00
Leonardo de Moura
46d1111d3d
fix: typo at unfoldBothDefEq
2022-03-06 13:54:42 -08:00