feat: support mvcgen' inside sym => … blocks#13680
Merged
Merged
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
26930ff to
a493166
Compare
a493166 to
a34e101
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`).
a34e101 to
9145499
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 makes
mvcgen'usable as a step insidesym => …blocks. Leftover VCs become subgoals for subsequent grind steps;mvcgen' invariantsworks inline,mvcgen' invariants?is rejected.A
grind-mode step operates on aGrind.Goal, which carries the E-graph and internalized hypotheses built up by earlier steps in the block. The VC driver now consumes aGrind.Goaldirectly and emits each VC as aGrind.Goalcarrying the same state, so the next grind step continues from wheremvcgen'left off instead of rebuilding the E-graph from scratch.