feat: add mkAppNS, mkAppRevS, betaRevS, betaS, and related Sym functions#13273
Merged
Conversation
…ym` functions This PR adds a comprehensive public API for constructing maximally shared expression applications and performing beta reduction in the `Sym` framework. These functions were previously defined locally in the VC generator and cbv tactic, and are needed by downstream `SymM`-based tools. New functions in `Lean.Meta.Sym.Internal` (generic over `MonadShareCommon`): - `mkAppS₆` through `mkAppS₁₁` - `mkAppRangeS`, `mkAppNS`, `mkAppRevRangeS`, `mkAppRevS` New public functions in `Lean.Meta.Sym` (`SymM`): - `betaRevS`, `betaS` - `mkForallFVarsS` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ctly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
volodeyka
pushed a commit
that referenced
this pull request
Apr 16, 2026
…ym` functions (#13273) This PR adds a comprehensive public API for constructing maximally shared expression applications and performing beta reduction in the `Sym` framework. These functions were previously defined locally in the VC generator and cbv tactic, and are needed by downstream `SymM`-based tools. New functions in `Lean.Meta.Sym.Internal` (generic over `MonadShareCommon`): - `mkAppS₆` through `mkAppS₁₁` (higher-arity application builders) - `mkAppRangeS`, `mkAppNS` (forward application over arrays/ranges) - `mkAppRevRangeS`, `mkAppRevS` (reversed application over arrays/ranges) New public functions in `Lean.Meta.Sym` (`SymM`): - `betaRevS` and `betaS` (beta reduction with max sharing) - `mkForallFVarsS` (forall abstraction with max sharing) The `AlphaShareBuilderM`-specific `mkAppRevRangeS` in `InstantiateS.lean` is replaced by the generic version from `Internal`, and the internal `betaRevS` is renamed to `betaRevS'`. The `Cbv.mkAppNS` now delegates to `Internal.mkAppNS`. --------- 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 a comprehensive public API for constructing maximally shared
expression applications and performing beta reduction in the
Symframework.These functions were previously defined locally in the VC generator and cbv
tactic, and are needed by downstream
SymM-based tools.New functions in
Lean.Meta.Sym.Internal(generic overMonadShareCommon):mkAppS₆throughmkAppS₁₁(higher-arity application builders)mkAppRangeS,mkAppNS(forward application over arrays/ranges)mkAppRevRangeS,mkAppRevS(reversed application over arrays/ranges)New public functions in
Lean.Meta.Sym(SymM):betaRevSandbetaS(beta reduction with max sharing)mkForallFVarsS(forall abstraction with max sharing)The
AlphaShareBuilderM-specificmkAppRevRangeSinInstantiateS.leanisreplaced by the generic version from
Internal, and the internalbetaRevSis renamed to
betaRevS'. TheCbv.mkAppNSnow delegates toInternal.mkAppNS.