Documentation

Lean.Elab.Tactic.Do.Internal.VCGen.Driver

Worklist driver for vcgen. Wraps solve with a queue of pending goals and emits VCs (or invariant holes) for those solve cannot decompose further.

Try to elaborate the user's invariant alt for invariant number n inline, discharging mv if successful. Looks up Context.invariantAlts[n]? (pre-parsed in Frontend) and dispatches to exact $rhs for bullet form or rename_i $args*; exact $rhs for labelled form. Returns whether elaboration succeeded. Numbering is 1-based; out-of-order labelled forms (e.g. | inv2 => … before | inv1 => …) are supported because the map is keyed by parsed number, not position.

Instances For

    Called when decomposing the goal further did not succeed; in this case we emit a VC for the goal. Invariant subgoals are handled separately by handleInvariantSubgoals directly inside work, so they never reach this path.

    Instances For
      • invariants : Array MVarId

        All invariant goals emitted during VC generation, in emit order. The MVarId at index i carries tag inv{i+1}, so callers can treat the array index as the invariant number. Some entries may already be assigned (inline-elaborated by Driver.emitVC); the caller is responsible for filtering before discharging.

      • Unassigned VCs. Each shares the parent Grind.Goal's state.

      • inlineHandledInvariants : Std.HashSet Nat

        Invariant numbers handled inline by Driver.emitVC. Used by Frontend to avoid spurious "alt does not match any invariant" warnings for inline-consumed alts.

      • unmatchedFrames : Array Syntax

        Frame terms of frames alternatives whose program pattern matched no program.

      Instances For
        def Lean.Elab.Tactic.Do.Internal.VCGen.run (goal : Meta.Grind.Goal) (ctx : Context) (scope : Scope) (stepLimit? : Option Nat := none) (frameDB : FrameDB := { }) :

        Generate verification conditions for a goal of the form pre ⊑ wp e post epost s₁ ... sₙ by repeatedly decomposing e using registered @[spec] theorems. Return the VCs and invariant goals.

        stepLimit?, when some n, seeds the fuel counter to n; when none, fuel is unlimited.

        Instances For