-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set priority in monadic class instances #5291
Conversation
Mathlib CI status (docs):
|
The test that broke had the number from the name generator offset by 8. |
Mathlib CI status (docs):
|
Mathlib CI status (docs):
|
Mathlib CI status (docs):
|
Mathlib CI status (docs):
|
!bench |
Here are the benchmark results for commit 90ac0f7. Benchmark Metric Change
========================================
- rbmap task-clock 2.2% (23.0 σ)
- rbmap wall-clock 2.3% (24.8 σ) |
I'm concerned that there's an unexplained performance regression revealed by |
Can you benchmark it again? There seems to be nothing in the rbmap.lean benchmarking test related to the changes in this PR. |
@kim-em, can you have a look at this one again? I don't know how to verify that the slowdowns weren't real. I've now updated the PR to the new toolchain, but I'm not sure how to get it to build the accompanying Batteries and Mathlib. |
@JovanGerb, you'll need to rebase this PR onto |
This PR adds missing features and fixes bugs in the `Float32` support
Remove some noise from my assignments
…er#6211) This PR verifies the `insertMany` method on `HashMap`s for the special case of inserting lists. --------- Co-authored-by: jt0202 <johannes.tantow@gmail.com> Co-authored-by: monsterkrampe <monsterkrampe@users.noreply.github.com> Co-authored-by: Johannes Tantow <44068763+jt0202@users.noreply.github.com>
This PR improves the E-matching pattern selection heuristics in the `grind` tactic. They now take into account type predicates and transformers.
…dure (leanprover#6654) This PR improves the support for partial applications in the E-matching procedure used in `grind`.
This PR improves the diagnostic information provided in `grind` failure states. We now include the list of issues found during the search, and all search thresholds that have been reached. This PR also improves its formatting.
This PR adds some tests for `grind`, working on `List` lemmas.
This PR improves the `grind` search procedure, and adds the new configuration option: `failures`.
This PR uses `StateRefT` instead of `StateT` to equip the Lake build monad with a build store. As a IO reference, different threads may now contend with the build store. However, benchmark results indicate that this does not have a significant performance impact. On a synchronization front, the lack of a mutex should not be a concern because the build store is a memorization data structure and thus order is theoretically irrelevant.
This PR ensures that `grind` avoids case-splitting on terms congruent to those that have already been case-split.
This PR fixes a bug in the `grind` term preprocessor. It was abstracting nested proofs **before** reducible constants were unfolded. --------- Co-authored-by: Kim Morrison <kim@tqft.net>
This PR improves the canonicalizer used in the `grind` tactic and the diagnostics it produces. It also adds a new configuration option, `canonHeartbeats`, to address (some of) the issues. Here is an example illustrating the new diagnostics, where we intentionally create a problem by using a very small number of heartbeats. <img width="1173" alt="image" src="https://github.com/user-attachments/assets/484005c8-dcaa-4164-8fbf-617864ed7350" />
This PR defines `Vector.flatMap`, changes the order of arguments in `List.flatMap` for consistency, and aligns the lemmas for `List`/`Array`/`Vector` `flatMap`.
This PR adds array indexing lemmas for `Vector.flatMap`. (These were not available for `List` and `Array` due to variable lengths.)
…prover#6667) This PR aligns `List.replicate`/`Array.mkArray`/`Vector.mkVector` lemmas.
…eft_and_distrib`, `testBit_mul_two_pow`, `bitwise_mul_two_pow`, `shiftLeft_bitwise_distrib]` (leanprover#6630) This PR adds theorems `Nat.[shiftLeft_or_distrib`, shiftLeft_xor_distrib`, shiftLeft_and_distrib`, `testBit_mul_two_pow`, `bitwise_mul_two_pow`, `shiftLeft_bitwise_distrib]`, to prove `Nat.shiftLeft_or_distrib` by emulating the proof strategy of `shiftRight_and_distrib`. In particular, `Nat.shiftLeft_or_distrib` is necessary to simplify the proofs in leanprover#6476. --------- Co-authored-by: Alex Keizer <alex@keizer.dev>
52dbe66
to
8532e1c
Compare
It seems I don't understand how git works, so I've opened it as a new PR: #6725 |
I tried to !bench the new PR, but it seems that I still cannot do that myself. |
Instructions at least are unchanged, most likely noise |
This PR adds the
high
priority to some instances with monad transformers, most notably toMonadExceptOf ε (ExceptT ε m)
. This means that inExceptT α MetaM
,throw
will throw theα
instead of theException
.These instances now have
high
priority:And these instance now have
low
priority:The last one makes sure that the
OrElse
instance has lower priority thaninstOrElseOfAlternative
(this change doesn't affect the synthesis order, because the order of the files in which the instances were declared was already 'correct').In Prelude.lean, instead of setting the priority to
high
orlow
, it has to be set to10000
or100
, which is the same.The increased priority of
MonadExceptOf ε (ExceptT ε m)
affected a few files that had to be fixed.Closes #4212