Skip to content
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

fix: type class issues with maxSynthPendingDepth := 1 #4119

Merged
merged 4 commits into from
May 14, 2024
Merged

Conversation

leodemoura
Copy link
Member

Summary:

  • Take synthPendingDepth into account when caching TC results
  • Add maxSynthPendingDepth option with default := 2.
  • Add support for tracking synthPending failures when using set_option diagnostics true

closes #2522
closes #3313
closes #3927

Identical to #4114 but with maxSynthPendingDepth := 1

closes #4114

cc @semorrison

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc May 10, 2024 00:11 Inactive
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label May 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request May 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request May 10, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label May 10, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented May 10, 2024

Mathlib CI status (docs):

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc May 10, 2024 01:25 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request May 10, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request May 10, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels May 11, 2024
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc May 11, 2024 00:24 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request May 11, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request May 11, 2024
This commit also adds supports for tracking `synthPending` failures when using
`set_option diagnostics true`.

It also increases limit 2.

closes #3313
closes #3927
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan and removed builds-mathlib CI has verified that Mathlib builds against this PR labels May 14, 2024
@semorrison
Copy link
Collaborator

(Mathlib build will come good again after the toolchain rebuilds after the rebase ... It's okay locally so likely I'll merge this without waiting for a final check.)

@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc May 14, 2024 01:58 Inactive
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request May 14, 2024
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request May 14, 2024
@semorrison semorrison added this pull request to the merge queue May 14, 2024
Merged via the queue into master with commit de5e039 May 14, 2024
25 checks passed
semorrison added a commit to leanprover-community/mathlib4 that referenced this pull request May 14, 2024
The main underlying change here is leanprover/lean4#4119, which fixed a
number of typeclass search bugs. In particular, it fixed a caching bug
(the `synthPendingDepth` was being ignored during caching, resulting in
both false positive and false negatives). For the false positives (i.e.
things that synthesis was finding that it really shouldn't have been!),
we've had to introduce `set_option maxSynthPendingDepth 2 in` in places.
These are all explained with `#adaptation_notes`.

There's also leanprover/lean4#4061, which makes well-founded definitions
irreducible by default. This helps avoid some horrible run-away
unfoldings, and was surprisingly un-painful to Mathlib to (credit to
@nomeata for discovering this!) There are some minor adaptations still
required, however.

---------

Co-authored-by: sgouezel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
3 participants