The VCGenM monad: its read-only Context (spec database + a fixed bundle of
pre-built BackwardRules + user-customisable simp methods + pre-tactic) and
its mutable State (rule caches, accumulated invariants/VCs, simp cache).
- specThms : SpecAttr.SpecTheoremsNew
- 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.
- preTac : PreTac
Pre-tactic to try on each emitted VC.
- 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'. - 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).
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). - jps : FVarIdMap JumpSiteInfo
Map from
__do_jpfvar id to itsJumpSiteInfo. Populated whentryLetIntroregisters a join point (Context.useJP = true); consulted bytryFvarZeta/tryJumpSiteto short-circuit zeta-unfolding at call sites. - 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). - preTacFailed : Bool
Set when a pre-tactic failed on some VC;
elabMVCGen'throws if true.
Instances For
Equations
Instances For
Register a join-point JumpSiteInfo for the given fvar. Called when a
let __do_jp := … is detected as a shared continuation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Look up a previously-registered join point by fvar id.
Equations
- Lean.Elab.Tactic.Do.Internal.VCGen.knownJP? fv = do let __do_lift ← get pure (Std.TreeMap.get? __do_lift.jps fv)
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.