Skip to content

feat: allow erasing cbv_eval attributes#12851

Merged
wkrozowski merged 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/cbv_eval_erase
Mar 10, 2026
Merged

feat: allow erasing cbv_eval attributes#12851
wkrozowski merged 1 commit intoleanprover:masterfrom
wkrozowski:wojciech/cbv_eval_erase

Conversation

@wkrozowski
Copy link
Copy Markdown
Contributor

This PR add support for erasing @[cbv_eval] annotations using attribute [-cbv_eval], mirroring the existing @[-simp] mechanism for simp lemmas.

The CbvEvalEntry now tracks the original declaration name (origin) so that inverted theorems (@[cbv_eval ←]) can be erased by their original name. The CbvEvalState stores individual entries alongside the composed Theorems discrimination tree, allowing the tree to be rebuilt from remaining entries after erasure. Erasure is properly scoped via modifyState, so attribute [-cbv_eval] inside a section is reverted when the section ends.

🤖 Generated with Claude Code

@wkrozowski wkrozowski requested a review from leodemoura as a code owner March 9, 2026 14:28
@wkrozowski wkrozowski added the changelog-tactics User facing tactics label Mar 9, 2026
@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 9, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e2b500b204cacbb3149f42feda880c8bdfcab7db --onto 333ab1c6f0ce11f33551d6a736054cb72812cad9. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-09 15:34:22)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase e2b500b204cacbb3149f42feda880c8bdfcab7db --onto a165292462a973c20d3cc8c8b23a3ac2334a2a4a. You can force reference manual CI using the force-manual-ci label. (2026-03-09 15:34:24)

@wkrozowski wkrozowski added this pull request to the merge queue Mar 10, 2026
Merged via the queue into leanprover:master with commit 85d38cb Mar 10, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-tactics User facing tactics 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