Skip to content

Conversation

@kmill
Copy link
Collaborator

@kmill kmill commented Jun 14, 2025

This PR makes the clear_value tactic preserve the order of variables in the local context. This is done by adding Lean.MVarId.withRevertedFrom, which reverts all local variables starting from a given variable, rather than only the ones that depend on it.

Note: an alternative implementation might convert the ldecl to a cdecl and then reset the meta cache. This assumes that there are no other caches that might still remember the value of the ldecl.

@kmill kmill added the changelog-language Language features and metaprograms label Jun 14, 2025
@kmill kmill requested a review from leodemoura as a code owner June 14, 2025 23:40
@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 Jun 15, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jun 15, 2025

Mathlib CI status (docs):
Forcing Mathlib CI because the force-mathlib-ci label is present, despite problem: - ❗ Batteries CI can not be attempted yet, as the nightly-testing-2025-06-12 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Batteries CI should run now. (2025-06-15 00:09:10)

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 15, 2025
This PR makes the `clear_value` tactic preserve the order of variables in the local context. This is done by adding `Lean.MVarId.withRevertedFrom`, which reverts all local variables starting from a given variable, rather than only the ones that depend on it.

Note: an alternative implementation might convert the ldecl to a cdecl and then reset the meta cache.
@kmill kmill force-pushed the kmill_clear_value_preserve_order branch from 3ed0627 to 2785c9e Compare June 18, 2025 02:23
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 18, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 18, 2025
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Jun 18, 2025
@kmill kmill added this pull request to the merge queue Jun 18, 2025
Merged via the queue into leanprover:master with commit 6240cd5 Jun 18, 2025
20 checks passed
algebraic-dev pushed a commit to algebraic-dev/lean4 that referenced this pull request Jun 18, 2025
…er#8792)

This PR makes the `clear_value` tactic preserve the order of variables
in the local context. This is done by adding
`Lean.MVarId.withRevertedFrom`, which reverts all local variables
starting from a given variable, rather than only the ones that depend on
it.

Note: an alternative implementation might convert the ldecl to a cdecl
and then reset the meta cache. This assumes that there are no other
caches that might still remember the value of the ldecl.
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
…er#8792)

This PR makes the `clear_value` tactic preserve the order of variables
in the local context. This is done by adding
`Lean.MVarId.withRevertedFrom`, which reverts all local variables
starting from a given variable, rather than only the ones that depend on
it.

Note: an alternative implementation might convert the ldecl to a cdecl
and then reset the meta cache. This assumes that there are no other
caches that might still remember the value of the ldecl.
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 and metaprograms force-mathlib-ci 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.

2 participants