Leonardo de Moura
b25bb78e2a
feat: improve DiscrTree
...
Try to improve the performance issue described at #587 .
The issue is that Mathlib contains thousands of theorems where the
associated key for the discrimination tree is just
`Key.other`. The indexing is not effective for them. This happens because
1- Lambda expressions are indexed using `Key.other`. The
discrimination tree mainly focus on the first-order structure.
2- It unfolds reducible constants when inserting and retrieving
entries. The motivation is that users expect simp theorems to fire
modulo reducible constants.
Then, we have many theorems such as
```lean
map ?g ∘ map ?f = map (?g ∘ ?f)
```
when we expand the function composition on the left-hand side, we get
```lean
fun (x : List ?α) => map ?g (map ?f x)
```
Which is indexed as `Key.other`.
We should not avoid the `Array`s in the discrimination tree nodes
If the index is working effectively, these arrays are all very small.
In this commit, we try to address the problem by using a different
approach. When processing the root of a pattern, we interrupt
reduction as soon as the we hit something that would be indexed
as `Key.other`. Note that, in Lean 3, the root of a pattern also
receives special treatment.
2021-07-29 16:08:26 -07:00
Leonardo de Moura
49a87ceb4d
feat: add basic isDefEq cache
2021-07-28 16:29:44 -07:00
Leonardo de Moura
51e03837f5
fix: exact and refine succeed if they produce no new metavariables
...
closes #492
2021-07-27 18:30:14 -07:00
Leonardo de Moura
6d05daf73b
feat: add flag for allowing synthetic opaque mvars to be assigned at isDefEq
...
See issue #492
TODO: add a mechanism for detecting new metavariables.
2021-07-27 17:58:08 -07:00
Leonardo de Moura
8c12a264ee
fix: offset support at isDefEq should not use HAdd.hAdd
...
fixes #550
2021-07-27 16:16:03 -07:00
Leonardo de Moura
3f22d5f624
feat: take auto params into account in the structure instance notation
...
closes #461
2021-07-27 15:49:23 -07:00
Leonardo de Moura
714cadfb31
fix: bug at structure instance notation
...
It was exposed by the second example at #461 .
2021-07-27 11:56:33 -07:00
Wojciech Nawrocki
43190e0e63
feat: FromToJson for recursive inductives
2021-07-24 10:47:38 +02:00
Wojciech Nawrocki
d6893a3e1f
fix: more robust LspEncoding
2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
54f2769e13
fix: test
2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
776a0c71aa
feat: add UInt64 unpackings
2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
b3d9e90695
feat: IO.getRandomBytes
2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
ef34cfd513
chore: more extensive LspEncoding test
2021-07-24 10:45:28 +02:00
Wojciech Nawrocki
9664fc88e0
chore: add test
2021-07-24 10:45:28 +02:00
Leonardo de Moura
1b128848b2
chore: fix test
2021-07-23 16:04:23 -07:00
Leonardo de Moura
cce6165d4e
perf: refine tryHeuristic
2021-07-23 12:04:11 -07:00
Sebastian Ullrich
dc3d94ff61
fix: check arity in notation unexpander
...
Fixes #469
2021-07-22 16:59:19 +02:00
Sebastian Ullrich
42e681a5a6
fix: make unterminated comments consume all input
...
Fixes #549
2021-07-22 15:55:12 +02:00
Sebastian Ullrich
7e317d23db
feat: term info on where declarations
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
b76dd1a8e3
feat: go-to-definition for local variables
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
df57b43b06
fix: go-to-type on parameterized types
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
18becc7d7d
fix: plain term goal on binders
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
4a4b4c1ef4
fix: mkAtomFrom: generate synthetic position like other *From functions
...
Also consistently use binders as reference position for an elided binder type.
Before, type errors were always given extent 1, the length of the
synthetic `_` token.
2021-07-19 13:24:59 -07:00
Sebastian Ullrich
8637220927
fix: make precedence mandatory for mixfix commands
...
Resolves #577
2021-07-19 13:18:58 -07:00
Wojciech Nawrocki
55a506be84
chore: adapt test
2021-07-19 09:55:37 +02:00
Wojciech Nawrocki
7aca461a35
fix: hovers on elabFieldName fields
2021-07-19 09:55:37 +02:00
Wojciech Nawrocki
bcde967d99
feat: add dot hover test
2021-07-19 09:55:37 +02:00
Wojciech Nawrocki
b2d712a766
fix: Substring.splitOn
2021-07-19 09:55:37 +02:00
Wojciech Nawrocki
1ba802418b
fix: ToJson for single-field constructors
2021-07-08 09:01:06 +02:00
Sebastian Ullrich
e2210ec4e0
chore: fix test
2021-07-06 17:28:09 +02:00
Sebastian Ullrich
d7dd2fe3ab
fix: unbox trivial unparameterized structures as well
2021-07-06 08:19:56 -07:00
Wojciech Nawrocki
e89aa5641e
chore: auto-insert newlines
2021-07-05 19:42:01 +02:00
Wojciech Nawrocki
49e6f42a6b
chore: remove absolute paths from test
2021-07-05 19:42:01 +02:00
Wojciech Nawrocki
fd9e3d8fe6
chore: add completion test and go-to field type
2021-07-05 19:42:01 +02:00
Leonardo de Moura
5e694d4b69
fix: fixes #536
2021-06-29 18:24:46 -07:00
Leonardo de Moura
f4a7ffd8c8
chore: fix codebase and tests
2021-06-29 17:14:52 -07:00
Leonardo de Moura
90a79a0b06
chore: remove command universes
...
Now, `universe` may declare many universes. The goal is to make it
consistent with the `variable` command
2021-06-29 17:01:07 -07:00
Leonardo de Moura
818efe719e
fix: fixes #533
2021-06-29 15:20:46 -07:00
Sebastian Ullrich
20fa503803
fix: move elabCommand parts that should happen only once into new function
2021-06-29 06:34:15 -07:00
Sebastian Ullrich
a993e0baa0
fix: non-dependent arrow should not extend local context
2021-06-29 06:31:37 -07:00
Sebastian Ullrich
fc821745ae
fix: swallow exception on hover formatting
2021-06-23 23:29:46 +02:00
Wojciech Nawrocki
40f07ef6a1
fix: make mangling injective again
2021-06-23 00:08:20 -07:00
Wojciech Nawrocki
05d46348c7
fix: 32-bit Unicode name mangling
2021-06-23 00:08:20 -07:00
Sebastian Ullrich
cef3ade164
fix: info on non-atomic simp args
2021-06-23 00:08:07 -07:00
Gabriel Ebner
3cff5ceb99
perf: make trace[...] ... notation lazy
2021-06-23 00:07:27 -07:00
Sebastian Ullrich
d5810d5c6f
chore: disable LSAN in server tests for now
2021-06-23 08:53:20 +02:00
Sebastian Ullrich
8454102fc4
chore: fix tests
2021-06-22 10:45:29 +02:00
Sebastian Ullrich
30a0954424
refactor: revert MonadRef changes
2021-06-21 10:17:26 -07:00
Sebastian Ullrich
b8be90fa08
fix: do not show complex terms in hover
2021-06-21 10:17:26 -07:00
Sebastian Ullrich
736d32c026
fix: hover on synthetic sorry
2021-06-21 10:17:26 -07:00