feat: add interactive simp tactic for sym => mode#13039
Merged
leodemoura merged 1 commit intomasterfrom Mar 22, 2026
Merged
Conversation
This PR adds the `simp` tactic to the `sym =>` interactive mode, completing the `Sym.simp` interactive infrastructure. The `simp` tactic supports: - `simp` — default (identity) variant - `simp myVariant` — named variant registered via `register_sym_simp` - `simp [thm₁, thm₂]` — default variant with extra rewrite theorems - `simp myVariant [thm₁, thm₂]` — named variant with extra theorems Extra theorems are composed into the variant's `post` chain via `>>`. Per-variant persistent caching: each unique (variant name, extra theorem list) combination gets its own `Sym.Simp.State` cache, shared across invocations within a `sym =>` block. This avoids redundant simplification of identical subterms when `simp` is called repeatedly (e.g., in branching proofs). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the
simptactic to thesym =>interactive mode, completingthe
Sym.simpinteractive infrastructure.The
simptactic supports:simp— default variant with@[sym_simp]theorem set,simpControl >> simpArrowTelescopepre,evalGround >> thms.rewritepostsimp myVariant— named variant registered viaregister_sym_simpsimp [thm₁, thm₂]— default variant with extra rewrite theorems appended topostsimp myVariant [thm₁, thm₂]— named variant with extra theoremsPer-variant persistent caching: each unique (variant name, extra theorem list)
combination gets its own
Sym.Simp.Statecache, shared across invocationswithin a
sym =>block. Test 10 verifies cache hits usingtrace.sym.simp.debug.cache.