feat: support mvcgen' inside sym => … blocks#13680
Draft
sgraf812 wants to merge 1 commit into
Draft
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
76aa5d2 to
26930ff
Compare
This PR registers `mvcgen'` as a step in the `grind` syntax category, so it can be used inside `sym => …` blocks. Each leftover VC becomes a fresh `Grind.Goal` built in the surrounding block's `Grind.GrindM`, with its local hypotheses internalized (`processHypotheses`) and the block's user-supplied e-match theorems activated (`assertExtra`), so subsequent grind steps see them without explicit `internalize_all` or having to re-pass the lemmas. Spec lookup (`mkBackwardRuleFromSpec`) wraps its three triple-defeq checks in `Meta.withDefault`. The ambient grind transparency is `reducible` (set by `Grind.withGTransparency` because `Grind.Config.reducible := true`), under which instance projections like `WPMonad.toWP` don't unfold and so don't compare equal to a direct `WP` instance. Standalone `mvcgen'` happens to inherit default transparency from `MetaM`, so the issue only surfaces when called from inside an outer `Grind.GrindM`. `Driver.runFromGoal` is renamed to `Driver.run`; callers seed the `Grind.Goal` themselves (via `Grind.mkGoalCore` from `TacticM`, or `getMainGoal` from `Grind.GrindTacticM`).
26930ff to
a493166
Compare
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 registers
mvcgen'as a step in thegrindsyntax category, so it can be used insidesym => …blocks. Leftover VCs become fresh subgoals for subsequent grind steps.The
: grinddeclaration mirrors the existing: tacticsurface; the builtin grind handler re-tags the syntax kind and dispatches to the regularelabMVCGen', then wraps the leftover MVarIds as freshGrind.Goals viamkGoalCore.