The VCGenM monad: its read-only Context (a fixed bundle of pre-built
BackwardRules + user-customisable simp methods) and its mutable State
(rule caches, accumulated invariants/VCs, simp cache).
A lazily elaborated until pattern, stored behind an IO.Ref so the first force caches its
result. The pattern is elaborated against the monad of the first program encountered in solve
(supplied as the expected type).
- deferred
(elabFn : Expr → MetaM Meta.Sym.Pattern)
: UntilPatternThunk
Not yet elaborated;
elabFn melaborates the pattern against the program monadm. - elaborated
(pat : Meta.Sym.Pattern)
: UntilPatternThunk
Already elaborated and cached.
Instances For
Force the thunk in ref against the program monad m, elaborating, tracing, and caching the
pattern on first use; later calls return the cached pattern.
Equations
- One or more equations did not get rendered due to their size.
Instances For
- entailsConsIntroRule : Meta.Sym.BackwardRule
The backward rule for
SPred.entails_cons_intro. - entailsNilPureIntroRule : Meta.Sym.BackwardRule
The backward rule for
SPred.entails_nil_pure_intro. Preferred overentails_nil_introwhen the LHS is⌜φ⌝, as it unwraps.downon the pure assertion. - entailsNilIntroRule : Meta.Sym.BackwardRule
The backward rule for
SPred.entails_nil_intro. Fallback when LHS is not⌜φ⌝. - applyPureConsEntailsLRule : Meta.Sym.BackwardRule
The backward rule for
SPred.apply_pure_cons_entails_l. Peels a state arg fromSPred.pure (σ::σs) φ son the LHS of an entailment. - applyPureConsEntailsRRule : Meta.Sym.BackwardRule
The backward rule for
SPred.apply_pure_cons_entails_r. Peels a state arg fromSPred.pure (σ::σs) φ son the RHS of an entailment. - downPureIntroRule : Meta.Sym.BackwardRule
The backward rule for
SPred.down_pure_intro. Reduces a target of the form(SPred.pure [] φ).downtoφ. - pureElimRule : Meta.Sym.BackwardRule
The backward rule for
SPred.pure_elim'. - pureIntroRule : Meta.Sym.BackwardRule
The backward rule for
SPred.pure_intro. - postCondEntailsRflRule : Meta.Sym.BackwardRule
The backward rule for
PostCond.entails.rfl. Tried first to close by reflexivity. - postCondEntailsMkRule : Meta.Sym.BackwardRule
The backward rule for
PostCond.entails.mk. - exceptCondsEntailsRflRule : Meta.Sym.BackwardRule
The backward rule for
ExceptConds.entails.rfl. - exceptCondsEntailsPureRule : Meta.Sym.BackwardRule
The backward rule for
ExceptConds.entails.pure. Closes the exception side for pure PostShapes, whereExceptConds.entailsreduces toTrue. - exceptCondsEntailsFalseRule : Meta.Sym.BackwardRule
The backward rule for
ExceptConds.entails_false. - exceptCondsEntailsTrueRule : Meta.Sym.BackwardRule
The backward rule for
ExceptConds.entails_true. - tripleOfEntailsWPRule : Meta.Sym.BackwardRule
The backward rule for
Triple.of_entails_wp. - andIntroRule : Meta.Sym.BackwardRule
The backward rule for
And.intro. - hypSimpMethods : Option Meta.Sym.Simp.Methods
User-customizable simp methods used to pre-simplify hypotheses.
- trivial : Bool
- useJP : Bool
The
jpconfig option: whentrue,tryLetIntrorecognises__do_jplets whose body is a splitter and sets up shared-continuation handling instead of zeta-unfolding. Whenfalse(default, matching originalmvcgen), every call site of the JP zeta-unfolds, leading to exponential blow-up on nested splits. - errorOnMissingSpec : Bool
The
errorOnMissingSpecconfig option: whentrue(default),Driver.workraises a hard error whensolvereturns.noSpecFoundForProgram. Whenfalse, the goal is emitted as an unsolved VC for the user to discharge — useful withmvcgen' [-some_spec]patterns where the user knows the spec is intentionally removed and wants to handle the residual goal by hand. - debug : Bool
The
debugconfig option: whentrue,tryApplyRuleretries failedBackwardRule.applycalls afterunfoldReducibleand reports an error when the retry succeeds, pinpointing missing normalization steps inmvcgen'. - internalize : Bool
The
internalizeconfig option: whentrue(default),emitVCand the multi-subgoal fork inDriver.workcallGrind.processHypotheses. The tactic-mode entry point disables this when there is nowithclause. - invariantAlts : Std.HashMap Nat Syntax
Pre-parsed
invariants/invariants?alternatives, indexed by 1-based invariant number. Bullet form maps positions to entries (bullet n+1 → alt); labelled form maps the parsedinv<n>numbers (out-of-order labels are supported). Empty when noinvariantsclause is provided or ininvariants?(suggest) mode (handled separately). - untilPat? : Option (IO.Ref UntilPatternThunk)
The
untilpattern: whensome ref, VC generation stops and emits the current goal as a VC once the program inwp⟦e⟧matches the (lazily elaborated) pattern, before applying a spec.
Instances For
- specs : SpecAttr.SpecTheoremsNew
Spec database in scope: globals plus locals from in-scope hypotheses.
- jps : FVarIdMap JumpSiteInfo
__do_jpfvars currently in scope. - nextDeclIdx : Nat
Index of the next local declaration to consider for local specs.
Instances For
- specBackwardRuleCache : Std.HashMap (Name × Expr × Nat) Meta.Sym.BackwardRule
A cache mapping registered SpecThms to their backward rule to apply. The particular rule depends on the theorem name, the monad and the number of excess state arguments that the weakest precondition target is applied to.
- splitBackwardRuleCache : Std.HashMap (Name × Expr × Nat) Meta.Sym.BackwardRule
A cache mapping matchers to their splitting backward rule to apply. The particular rule depends on the matcher name, the monad and the number of excess state arguments that the weakest precondition target is applied to.
Holes of type
Invariantthat have been generated so far.- vcs : Array Meta.Grind.Goal
The verification conditions that have been generated so far. Each entry shares the parent
Grind.Goal's state. - simpState : Meta.Sym.Simp.State
Persistent cache for the
Sym.Simpsimplifier used to pre-simplify hypotheses before grind internalization. Threading this cache across VCGen iterations avoids re-simplifying shared subexpressions (e.g.,s + 1 + 1 + ...chains). - fuel : Fuel
Remaining VC-generation steps. Initialized from
Context.config.stepLimit(or.unlimitedwhen no limit is set). Decremented at each successful program-shape step (tryLetHoist,trySplit,tryFvarZeta,applySpec). When exhausted,solveshort-circuits and emits the current goal as a VC. - inlineHandledInvariants : Std.HashSet Nat
Set of invariant numbers that have been inline-elaborated by
Driver.emitVCviatryInlineInvariant. The post-hoc invariant elaboration inFrontendconsults this to know which user-provided alts have already been consumed (so it doesn't warn about them).
Instances For
Equations
Instances For
Equations
- s.registerJP fv info = { specs := s.specs, jps := s.jps.insert fv info, nextDeclIdx := s.nextDeclIdx }
Instances For
Equations
- s.knownJP? fv = Std.TreeMap.get? s.jps fv
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Walk goal's local context from scope.nextDeclIdx onward, registering any
spec-shaped hypotheses as local specs. Advances nextDeclIdx to the current
context size so siblings share work.
Equations
- One or more equations did not get rendered due to their size.
Instances For
True iff fuel has been exhausted (Fuel.limited 0).
Equations
- Lean.Elab.Tactic.Do.Internal.VCGen.outOfFuel = do let __do_lift ← get pure (match __do_lift.fuel with | Lean.Elab.Tactic.Do.Fuel.limited 0 => true | x => false)
Instances For
Decrement remaining fuel by one. No-op when fuel is .unlimited or already at zero.
Equations
- One or more equations did not get rendered due to their size.