Leonardo de Moura
f1ed13efff
feat: improve elabMatchAux
...
We now (try to) postpone `match ... with` elaboration when pattern
variables and patterns still contain metavariables before invoking `mkMatcher`.
This improvement makes sure we can elaborate an example submitted by
Daniel Selsam.
Remark: this update may create performance problems since we
backtrack `elabMatchTypeAndDiscrs` and `elabMatchAltView`.
We hope this is not a problem in practice since we use the "quick-check"
`waitExpectedTypeAndDiscrs`. Recall that we could compile Lean
without this commit. So, it suggests cases where we need to postpone
after `elabMatchAltView` are rare.
2021-01-18 15:33:48 -08:00
Leonardo de Moura
711d1754a6
chore: improve error message
...
closes #276
2021-01-17 07:51:08 -08:00
Leonardo de Moura
eb25b97501
fix: pattern variables cannot shadow each other
2021-01-16 08:23:45 -08:00
Leonardo de Moura
7e0d76aff0
fix: losing local instances at assertAfter
...
closes #270
2021-01-15 19:30:03 -08:00
Leonardo de Moura
f73eb1246a
feat: add pp.safe_shadowing
...
When `pp.safe_shadowing` is set to true, we still use the
suggested name if the "body" does not contain a free variable with the
suggested name. This is the approach used in Lean 3, and I think it
improved the result in all affected tests.
The implementation was simple. The only nasty case was `delabAppMatch`.
The main motivation for this feature was hovering information such as
```lean
f : {α_1 : Type} → α_1 → α_1
```
when hovering over the `f` at
```lean
def g (α : Type) (a : α) :=
f a
```
With `safe_shadowing`, we get the nicer
```lean
f : {α : Type} → α → α
```
cc @Kha
2021-01-15 18:53:25 -08:00
Leonardo de Moura
dcc2283426
fix: refineCore
...
closes #269
2021-01-15 17:03:40 -08:00
Leonardo de Moura
58d51bc764
feat: add FieldInfo
2021-01-15 15:01:45 -08:00
Wojciech Nawrocki
f3ab908888
fix: substring APIs
2021-01-15 13:29:22 -08:00
Wojciech Nawrocki
310a2ab6a3
feat: minimal hovers MVP
2021-01-15 13:29:22 -08:00
Leonardo de Moura
223a5d5ded
fix: bug at isDefEqOffset
...
closes #268
2021-01-15 13:08:37 -08:00
Leonardo de Moura
ae60360d7a
feat: add resolveName' which produces Syntax with position information for each field
2021-01-15 11:19:01 -08:00
Sebastian Ullrich
d7fe05b29d
chore: script to copy .produced.out ~> .expected.out
2021-01-15 16:27:59 +01:00
Sebastian Ullrich
b2b78eb222
test: use printMessageEndPos for leantests
2021-01-15 16:27:59 +01:00
Leonardo de Moura
6a39c65bd2
feat: improve match error message
2021-01-14 14:58:34 -08:00
Leonardo de Moura
d2cdef85ea
chore: fix tests
2021-01-14 14:25:41 -08:00
Leonardo de Moura
791388400b
feat: improve do error messages
...
cc @Kha @Vtec234
2021-01-14 14:18:56 -08:00
Leonardo de Moura
25c9727a92
feat: add TermInfo for LVal
...
@Vtec234 Added the missing info.
Given
```lean
def f3 (s : Nat × Array (Array Nat)) : Array Nat :=
s.2[1].push s.1
```
We produce the following `InfoTree` for the body (originally at line 30)
```
Array.push (Array.getOp s.snd 1) s.fst : Array Nat @ ⟨30, 2⟩-⟨30, 17⟩
s : Nat × Array (Array Nat) @ ⟨30, 2⟩-⟨30, 3⟩
Prod.snd : {α β : Type} → α × β → β @ ⟨30, 4⟩-⟨30, 5⟩
Array.getOp : {α : Type} → [inst : Inhabited α] → Array α → Nat → α @ ⟨30, 5⟩-⟨30, 6⟩
1 : Nat @ ⟨30, 6⟩-⟨30, 7⟩
Array.push : {α : Type} → Array α → α → Array α @ ⟨30, 9⟩-⟨30, 13⟩
s.fst : Nat @ ⟨30, 14⟩-⟨30, 17⟩
s : Nat × Array (Array Nat) @ ⟨30, 14⟩-⟨30, 15⟩
Prod.fst : {α β : Type} → α × β → α @ ⟨30, 16⟩-⟨30, 17⟩
```
2021-01-14 12:19:21 -08:00
Leonardo de Moura
fb52ec8ef5
feat: store binder information in the InfoTree
...
@Vtec234 I am storing the binder information using `TermInfo`.
If it helps, I can add a custom `Info` constructor.
Example: `| Info.ofBinderInfo (i : BinderInfo)`.
2021-01-14 12:19:21 -08:00
Leonardo de Moura
e5b93783b0
test: TC issue repro
2021-01-13 18:41:01 -08:00
Leonardo de Moura
6e3792e995
chore: fix tests
2021-01-13 18:31:50 -08:00
Leonardo de Moura
7a1fe0d235
chore: fix tests
2021-01-13 10:35:38 -08:00
Leonardo de Moura
8ddde1443c
test: sorry warning
2021-01-13 10:30:35 -08:00
Leonardo de Moura
0c629b4a26
chore: fix tests
2021-01-12 17:19:38 -08:00
Leonardo de Moura
42b5e780f5
chore: fix test
2021-01-12 08:14:16 -08:00
Leonardo de Moura
7160a010d1
chore: fix test
2021-01-12 06:58:35 -08:00
Leonardo de Moura
b5fdc5e364
fix: expand abbreviations at isClass?
2021-01-12 06:56:23 -08:00
Leonardo de Moura
1ebf69e163
fix: simple-match macro
2021-01-12 06:41:32 -08:00
Leonardo de Moura
36008271ea
feat: ensure no unassigned metavariables in the declaration header when type is explicitly provided
2021-01-11 16:40:14 -08:00
Leonardo de Moura
8d0085ae31
feat: unification hints + type classes
2021-01-11 15:34:57 -08:00
Leonardo de Moura
f0992c7022
chore: fix tests
2021-01-11 13:01:04 -08:00
Leonardo de Moura
84f78edb31
feat: store declaration ranges
2021-01-11 12:50:11 -08:00
Leonardo de Moura
3388c63e11
fix: typo at ParamInfo.isExplicit
2021-01-11 07:08:17 -08:00
Leonardo de Moura
7dec568ef6
fix: missing withDeclName
2021-01-11 06:50:55 -08:00
Leonardo de Moura
300fcc3321
fix: bug at getStuckMVar?
2021-01-11 06:43:08 -08:00
Leonardo de Moura
ac4961fa37
test: check stdlib doc strings
2021-01-10 07:36:16 -08:00
Leonardo de Moura
308c61027a
feat: save doc strings
...
We can now document `let rec` too.
2021-01-10 07:13:33 -08:00
Leonardo de Moura
873634be7e
feat: hierarchical InfoTree
2021-01-09 14:10:11 -08:00
Leonardo de Moura
b069b1174f
fix: nasty interaction between macro scopes and auto bound implicit names
...
See issue #255
2021-01-08 06:33:30 -08:00
Leonardo de Moura
11c7ca40c3
fix: missing case at Match.lean
2021-01-07 17:38:22 -08:00
Leonardo de Moura
fcd73e72c1
feat: add getModuleOf
...
cc @Kha @Vtec234
2021-01-07 15:20:29 -08:00
Leonardo de Moura
5baa162713
chore: lean 3 behavior for apply
2021-01-05 12:29:29 -08:00
Sebastian Ullrich
a8c04388bb
chore: disable flaky test
2021-01-04 15:44:03 +01:00
Leonardo de Moura
93f3c98780
test: add partial/unsafe tests
2021-01-01 18:46:12 -08:00
Leonardo de Moura
e517d72bee
feat: simpForall
2021-01-01 17:24:56 -08:00
Leonardo de Moura
244b72befd
feat: simpArrow
2021-01-01 17:15:15 -08:00
Leonardo de Moura
15c052d44a
feat: basic simpLet
2021-01-01 15:54:29 -08:00
Leonardo de Moura
493d089878
feat: add support for simp { contextual := true }
2021-01-01 15:39:41 -08:00
Leonardo de Moura
e742dd1348
feat: allow user to set Simp.Config at simp
2021-01-01 15:12:18 -08:00
Leonardo de Moura
ac394e4fdf
fix: simp at hypotheses and using hypotheses
2021-01-01 12:05:38 -08:00
Leonardo de Moura
ce09e795b9
feat: finalizeProof at rewrite step
2021-01-01 11:33:34 -08:00