Commit graph

132 commits

Author SHA1 Message Date
Leonardo de Moura
e237e12478
refactor: add tryCatchRuntimeEx combinator (#4129)
see #4079
2024-05-10 22:34:09 +00:00
Leonardo de Moura
d7c6920550
chore: remove dead functionpreprocessLevels (#4112) 2024-05-08 15:38:04 +00:00
Leonardo de Moura
5e30638725
feat: set_option diag true tracks how many times an instance is used (#4019) 2024-04-29 01:05:00 +00:00
Leonardo de Moura
3be22538d2
chore: add backward compatibility option for TC optimization (#4008) 2024-04-28 06:04:06 +00:00
Leonardo de Moura
a359586a96
perf: isDefEqProj (#4004)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
2024-04-27 23:30:35 +00:00
Leonardo de Moura
917a31f694 perf: consider at most one answer for type class resolution subgoals not containing metavariables
closes #3996
2024-04-27 21:12:19 +02:00
Leonardo de Moura
34a788110f chore: code convention 2024-04-27 21:12:19 +02:00
Leonardo de Moura
ce350f3481 perf: linearity issue 2024-04-27 21:12:19 +02:00
Leonardo de Moura
1630d9b803
feat: universe constraint approximations (#3981)
We add a new configuration flag for `isDefEq`:
`Meta.Config.univApprox`.
When it is true, we approximate the solution for universe constraints
such as
- `u =?= max u ?v`, we use `?v := u`, and ignore the solution `?v := 0`.
- `max u v =?= max u ?w`, we use `?w := v`, and ignore the solution `?w
:= max u v`.

We only apply these approximations when there the contraints cannot be
postponed anymore. These approximations prevent error messages such as
```
error: stuck at solving universe constraint
  max u ?u.3430 =?= u
```
This kind of error seems to appear in several Mathlib files.

We currently do not use these approximations while synthesizing type
class instances.
2024-04-24 20:27:51 +00:00
Leonardo de Moura
b39042b32c
fix: eta-expanded instances at SynthInstance.lean (#3638)
Remark: this commit removes the `jason1.lean` test. Motivation: It
breaks all the time due to changes we make, and it is not clear anymore
what it is testing.

---------

Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
2024-03-08 20:37:38 +00:00
Leonardo de Moura
794228a982
refactor: Offset.lean and related files (#3614)
Motivation: avoid the unfold and check idiom.
This commit also minimize dependencies at `Offset.lean`.

closes #2615
2024-03-05 19:40:15 -08:00
Henrik Böving
23e49eb519 perf: add prelude to all Lean modules 2024-02-18 14:55:17 -08:00
Leonardo de Moura
4afcdeb771 fix: fixes #2775
fixes #2744
2023-11-03 05:56:59 -07:00
Sebastian Ullrich
74b8dda181 feat: check task cancellation in elaborator 2023-10-26 08:33:09 +02:00
Leonardo de Moura
3a13200772 refactor: add configuration options to control WHNF
This commit also removes parameter `simpleReduce` from discrimination
trees, and take WHNF configuration options.
Reason: it is more dynamic now. For example, the simplifier
will be able to use different configurations for discrimination tree insertion
and retrieval. We need this feature to address issues #2669 and #2281

This commit also removes the dead Meta.Config field `zetaNonDep`.
2023-10-25 03:12:35 -07:00
Scott Morrison
fb0d0245db
Revert "Cancel outstanding tasks on document edit in the language server" (#2703)
* Revert "perf: inline `checkInterrupted`"

This reverts commit 6494af4513.

* Revert "fix: switch to C++ interruption whitelist"

This reverts commit 5aae74199b.

* Revert "fix: do not throw interrupt exceptions inside pure functions"

This reverts commit c0e3b9568e.

* Revert "feat: cancel tasks on document edit"

This reverts commit a2e2481c51.

* Revert "feat: translate `interrupted` kernel exception"

This reverts commit 14c640c15e.

* Revert "feat: check task cancellation in elaborator"

This reverts commit 2070df2328.

* Revert "feat: move `check_interrupted` from unused thread class to `Task` cancellation"

This reverts commit bf48a18cf9.
2023-10-17 00:59:11 +00:00
Sebastian Ullrich
2070df2328 feat: check task cancellation in elaborator 2023-10-13 09:52:26 +02:00
int-y1
8d7520b36f chore: fix typos in comments 2023-10-08 10:46:05 +02:00
Gabriel Ebner
1f21ababfa chore: remove etaExperiment option 2023-05-15 09:05:41 -07:00
Gabriel Ebner
9211dd6541 chore: tc: re-enable eta 2023-05-15 09:05:41 -07:00
Gabriel Ebner
4544443d98 feat: reorder tc subgoals according to out-params 2023-04-10 13:00:04 -07:00
Sebastian Ullrich
b076d488e3 feat: show typeclass and tactic names in profile output 2023-03-27 17:47:52 +02:00
Gabriel Ebner
8650804b02 perf: cache tc results with mvars 2023-03-16 15:26:38 -07:00
Gabriel Ebner
d3c55ef249 perf: do not reset tc cache when adding local instances 2023-03-16 15:26:38 -07:00
Gabriel Ebner
0cc9d7a43d fix: do not reverse subgoals of local instances 2023-03-08 15:54:07 -08:00
Gabriel Ebner
2262579f9b fix: tc: filter out assigned subgoals at the correct place 2023-03-08 15:54:07 -08:00
Gabriel Ebner
1c641b569a chore: synthInstance trace message on cache hit 2023-03-08 15:54:07 -08:00
Gabriel Ebner
adcca17991 chore: add option to enable structure eta in tc search 2023-02-21 16:41:30 -08:00
Gabriel Ebner
448f49ee91 Revert "fix: reenable structure eta during tc search"
The fix is blocked by slow defeq checks for TC instances; see issues
1986 and 2055.  Enabling it right now causes lots of timeouts in
mathlib4.
https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/bump.20to.202023-02-06/near/326223768

This reverts commit 15a045ee66.
2023-02-09 11:37:30 -08:00
Gabriel Ebner
15a045ee66 fix: reenable structure eta during tc search
Fixes #2074.
2023-02-05 11:41:00 -08:00
Leonardo de Moura
30c9f58e6a chore: remove leftover 2023-01-03 15:05:31 -08:00
Gabriel Ebner
7736c051ff fix: assigned tc mvar check 2022-12-22 02:02:55 +01:00
Gabriel Ebner
f798507bbf chore: tc: only normalize level mvars at current depth 2022-12-22 02:02:55 +01:00
Gabriel Ebner
e386d5941e refactor: replace ignoreLevelMVarDepth by levelAssignDepth 2022-12-19 20:14:17 +01:00
Leonardo de Moura
0dda3a8c02 fix: include instance implicits that depend on outParams at outParamsPos
This fixes the fix for #1852
2022-12-01 06:11:48 -08:00
Leonardo de Moura
1cc58e60ef fix: fixes #1829 2022-11-15 08:31:36 -08:00
Mario Carneiro
765ebcdbf0 feat: use withoutPosition consistently 2022-10-24 12:51:32 -07:00
David Renshaw
e4ab10dc30 doc: fix some typos
assinged -> assigned
collction -> collection
2022-10-24 16:01:39 +02:00
Mario Carneiro
583e023314 chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Mario Carneiro
dd5948d641 chore: snake-case attributes (part 1) 2022-10-19 09:28:08 -07:00
Leonardo de Moura
870de844dc chore: annotate relevant monadic code with [alwaysInline]
TODO: after we delete old code generator, we should replace
`@[alwaysInline, inline]` with `@[alwaysInline]`.

Remainder: we want the old code generator to ignore `@[alwaysInline]`
annotations, in particular, the new ones on `instance` commands that
are actually annotations for the instance methods.
2022-10-12 19:48:02 -07:00
Mario Carneiro
85119ba9d1 chore: move Std.* data structures to Lean.* 2022-09-26 05:46:04 -07:00
Leonardo de Moura
bdf89b4d85 chore: add {crossEmoji} at failure 2022-08-27 10:41:54 -07:00
Gabriel Ebner
e96afa28fe chore: use named emoji 2022-08-15 08:55:25 -07:00
Gabriel Ebner
278724786a chore: improve tc synth traces 2022-08-15 08:55:25 -07:00
Leonardo de Moura
8335a82aed refactor: improve MVarId method discoverability
See issue #1346
2022-07-24 21:36:33 -07:00
Leonardo de Moura
a62949c49b refactor: add type LevelMVarId (and abbreviation LMarId)
Motivation: make sure we do not mixup metavariable ids for
expression and universe level.

cc @bollu
2022-07-24 17:21:45 -07:00
Mario Carneiro
f6211b1a74
chore: convert doc/mod comments from /- to /--//-! (#1354) 2022-07-22 12:05:31 -07:00
Gabriel Ebner
a8cab84735 refactor: use computed fields for Expr 2022-07-11 14:19:41 -07:00
Gabriel Ebner
3176943750 refactor: use computed fields for Level 2022-07-11 14:19:41 -07:00