The main solve step. Runs once per worklist iteration and either fully
decomposes the current goal into subgoals, or reports why no further
progress is possible (SolveResult).
The reason why no further VC generation progress is possible on the current goal.
- outOfFuel : StopReason
Out of fuel.
- untilPatternMatched
(m : Expr)
: StopReason
until <pat>matched. - noEntailment
(target : Expr)
: StopReason
The target was not of the form
pre ⊑ rhs. - noProgress
(pre rhs : Expr)
: StopReason
The target was of the form
pre ⊑ rhs, but we couldn't make further progress. - noSpecFound
(e monad : Expr)
(thms : Array SpecAttr.SpecTheorem)
: StopReason
No spec was found for the program
einpre ⊑ wp e post epost s₁ ... sₙ. Candidates werethms, but none matched the monad. Reached only whenerrorOnMissingSpecisfalse.
Instances For
The result of one solve step of VC generation.
- goals
(scope : Scope)
(subgoals : List MVarId)
: SolveResult
Successfully decomposed the goal. These are the subgoals, sharing
scope. - stop
(reason : StopReason)
: SolveResult
No further progress possible; emit the current goal as a VC.
Instances For
Find an unretired frames alternative matching the program (earliest source order wins),
elaborate its frame at the resource type resourceTy, and retire it so it applies at most once.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The main VC generation step. Operates on a plain MVarId with no knowledge of grind.
Returns .goals subgoals when the goal was decomposed, or a classification result
(.noEntailment, .noProgramOrLatticeFoundInTarget, etc.) when no further decomposition is
possible.
The function performs the following steps in order:
- Forall introduction: If the target is a
∀, simp it and introduce binders. - Target-let handling: zeta-substitute duplicable top-level lets, otherwise introduce them.
- Triple unfolding: If the target is
⦃P⦄ x ⦃Q; E⦄, unfold intoP ⊑ wp x Q E. - Syntactic rfl: close
pre ⊑ rhsbyPartialOrder.rel_reflwhen both sides unify. - Embedded pure precondition introduction: lift a
⌜φ⌝precondition into the local context, before state-argument introduction would apply it to the introduced arguments. - State-argument introduction: If the lattice carrier is a function type
σ₁ → ... → σₙ → Base, introduce all excess state arguments. - Bare pure precondition introduction: on the
Proplattice, replace aTrueprecondition by⊤and lift any other precondition into the local context. - EPost projection reduction: reduce an
EPost.Cons.headRHS to the projected component. - Lattice decomposition: decompose
⊓,⇨,⌜p⌝and⊤RHS connectives. - Lifted-hypothesis discharge: close a residual
pre ⊑ ⌜φ⌝entailment against the most recently lifted preconditionh : φin the local context, cached inScope.lastLiftedPre?. - WP decomposition: when the RHS is
wp e post epost s₁ ... sₙ, in order: hoist/zeta program-head lets, splitite/dite/match, zeta-unfold fvar program heads, reduce projection heads, and finally apply a registered@[spec]theorem.
Equations
- One or more equations did not get rendered due to their size.