Skip to content

fix: use withFreshZetaDeltaFVarIds to avoid leaking zetaDeltaFVarIds between different simp calls #7539

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JovanGerb
Copy link
Contributor

@JovanGerb JovanGerb commented Mar 18, 2025

This PR fixes the tracking of let variables used in simp?. It used to return too many let variables if these let variables were used in other simp calls.

The idea is: when tracking zetaDeltaFVarIds, then we set trackZetaDelta := true and zetaDeltaFVarIds := {}, and at the end we restore zetaDeltaFVarIds to the value it had originally. If this is nested inside another such tracking, we add the new zetaDeltaFVarIds to the original set.

Closes #6655

@JovanGerb JovanGerb marked this pull request as draft March 18, 2025 00:19
@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 Mar 18, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 18, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 18, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 18, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 18, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Mar 18, 2025

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan 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 Mar 18, 2025
@JovanGerb JovanGerb marked this pull request as ready for review March 18, 2025 11:20
@nomeata nomeata added the changelog-language Language features, tactics, and metaprograms label Mar 18, 2025
@leanprover-bot leanprover-bot added the P-low We are not planning to work on this issue label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features, tactics, and metaprograms P-low We are not planning to work on this issue toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simp? unfolds more let definitions than a bare simp call
4 participants