Commit graph

91 commits

Author SHA1 Message Date
Leonardo de Moura
e68e448070 fix: convert inductive type instance implicit parameters to implicit when building SizeOf instance
It is better for TC resolution since the parameter can be inferred by
typing constraints, and it addresses issue #1373
2022-07-26 12:42:47 -07:00
Wojciech Nawrocki
122748ab06 test: strip some more indices 2022-07-25 08:01:27 -07:00
Wojciech Nawrocki
5183887722 test: fix infoTree.lean 2022-07-25 08:01:27 -07:00
Leonardo de Moura
b6860968ff fix: catch exception at elabMutualDef
closes #1301
2022-07-12 18:39:30 -07:00
Leonardo de Moura
5e333191a2 feat: improve binop% and binrel% elaboration functions
Add support for operators that may not have homogeneous instances for
all types. For example, we have `HPow Nat Nat Nat` and `HPow Int Nat Int`,
but we don't have `HPow Int Int Int`.
2022-07-12 18:12:20 -07:00
Leonardo de Moura
7553dc12c0 chore: fix tests 2022-07-10 07:43:01 -07:00
Leonardo de Moura
aa52eebcdc feat: add instance GetElem (Array α) USize α fun xs i => LT.lt i.toNat xs.size where 2022-07-09 16:18:29 -07:00
Leonardo de Moura
1caff852fb chore: remove getOp functions 2022-07-09 16:09:28 -07:00
Leonardo de Moura
0074038405 fix: missing term info 2022-07-09 12:19:10 -07:00
Sebastian Ullrich
6303fb77d2 fix: expansion info for macro commands
TODO: investigate that pp error
2022-07-05 13:18:59 +02:00
Leonardo de Moura
64edb50687 chore: fix tests 2022-07-04 06:35:21 -07:00
Leonardo de Moura
e4b472a9a2 chore: fix tests 2022-07-02 15:17:01 -07:00
Sebastian Ullrich
3a56db2812 chore: fix tests 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
0bd864deca fix: nesting of pattern info nodes 2022-06-27 22:37:02 +02:00
Sebastian Ullrich
1b51bab4a1 feat: turn on info trees by default 2022-05-10 06:24:31 -07:00
Leonardo de Moura
7ce0471f28 feat: improve binrel% elaborator
It now relies on `binop%` too, and addresses issue reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Regression.20in.20coercion.20inference/near/281737387
2022-05-09 18:39:52 -07:00
Leonardo de Moura
57c3114875 fix: simpAll and tests
We need another `update stage0` to remove workaround at `AC.lean`
2022-04-21 15:00:07 -07:00
Leonardo de Moura
e4304ea1de fix: always save completion info at resolveName
See new test.
2022-04-10 08:00:03 -07:00
Leonardo de Moura
4d077214f9 feat: jump to definition for match pattern variables 2022-04-09 15:36:42 -07:00
Leonardo de Moura
7d99f6f555 perf: isClassQuick? was incorrectly producing undef
Then `isClassExpensive?` was being invoked too often. In some
benchmarks the performance hit was substantial. For example,
in the new test `state8.lean`. The runtime on my machine went from 2s
to 0.76s.
2022-04-09 10:38:49 -07:00
Leonardo de Moura
417421dbae fix: auto completion when autoBoundImplicit is active 2022-04-09 09:11:45 -07:00
Leonardo de Moura
3cf425ba52 fix: pattern hover information
We annotate patterns with the corresponding `Syntax` during
elaboration, and do not populate the info tree. Reason: the set of
pattern variables is not known during pattern elaboration.
2022-04-08 15:03:42 -07:00
Leonardo de Moura
1107705525 fix: jump to definition inside recursive definitions was not working on VS Code
Remark: it was working on Emacs.
2022-04-06 14:27:49 -07:00
Leonardo de Moura
574927ab0d fix: jump to definition for recursive declarations 2022-04-06 13:01:16 -07:00
Leonardo de Moura
86432f1833 feat: improve let-pattern and have-pattern macro expansion 2022-03-29 07:33:22 -07:00
Leonardo de Moura
3193acecfa fix: flush the CoreM and MetaM caches at modifyEnv
This fix may impact performance. Note that we don't need to flush the
cache if we are "adding" stuff to the environment. We only need to
flush the caches if the change is not monotonic. BTW, most of the
changes are monotonic. I think this is why we did not hit this bug before.

We may also move all these caches to an environment extension. It is
an easy way to make sure we preserve the cache when extending the
environment.

I tried a few benchmarks and did not notice a significant difference.

cc @kha @gebner

fixes #1051
2022-03-17 16:02:30 -07:00
Leonardo de Moura
d6de53a7aa perf: custom splitAnd 2022-03-15 16:59:11 -07: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
15e6dd262d chore: fix tests 2022-02-09 10:13:52 -08:00
Leonardo de Moura
9d34d9bc5a feat: cache and optimize mkCongrSimp? at simp
see #988
2022-02-07 17:01:21 -08:00
Leonardo de Moura
007f0e1d71 feat: use mkCongrSimp? at simp
TODO: cache auto generated congr theorems, and `removeUnnecessaryCasts`

see #988
2022-02-07 16:45:01 -08:00
Sebastian Ullrich
2c7d67d498 fix: make info of fields synthesized by structure update synthetic 2022-02-06 08:50:07 -08:00
Sebastian Ullrich
0ef5985b5f fix: binder info range for let rec/where 2022-02-06 07:21:51 -08:00
Leonardo de Moura
a028a69159 feat: cache isProp and isDecInst at FunInfo 2022-02-04 17:57:28 -08:00
Leonardo de Moura
f9fa24435d chore: remove problematic instance hasOfNatOfCoe
See #403
See https://github.com/leanprover-community/mathport/issues/94
2022-01-20 14:47:25 -08:00
Sebastian Ullrich
bbec84bb18 chore: more output on trace.Elab.info 2022-01-19 21:40:29 +01:00
Leonardo de Moura
de11f7e1bc feat: add sizeOf spec lemmas as simp theorems 2022-01-17 16:14:38 -08:00
Gabriel Ebner
50abc3e295 fix: correctly pretty-print @Eq 2022-01-12 09:41:41 +01:00
Leonardo de Moura
57b8912279 chore: fix tests 2022-01-10 14:33:02 -08:00
Leonardo de Moura
92a511be29 chore: fix test 2021-12-18 11:05:37 -08:00
Leonardo de Moura
89edc184fb feat: compleation at #print command 2021-12-15 13:13:39 -08:00
Gabriel Ebner
b905824024 chore: fix tests 2021-12-15 11:42:38 +00:00
Leonardo de Moura
5b14caf329 fix: missing addTermInfo at elabAtomicDiscr
closes #820
2021-12-14 17:20:46 -08:00
Sebastian Ullrich
fddbc3c09e fix: empty option completion 2021-12-10 14:19:19 -08:00
Sebastian Ullrich
77aed3a0b1 fix: add binder info nodes for parameter copies in body 2021-12-09 18:12:51 +01:00
Sebastian Ullrich
4f15805787 feat: annotate declarations with term infos 2021-11-27 07:25:15 -08:00
Sebastian Ullrich
25ebc68b87 fix: emit info tree on command without elaborator
Fixes #792
2021-11-16 10:44:17 +01:00
Sebastian Ullrich
6e4fcaaea9 fix: produce info tree even on macro or elab failure 2021-11-11 08:39:31 +01:00
Gabriel Ebner
ce15ea98c5 feat: predictable naming for macro_rules 2021-10-26 20:19:27 +02:00
Leonardo de Moura
42773941ed chore: fix test 2021-10-02 17:00:07 -07:00