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).
- noEntailment
(target : Expr)
: SolveResult
targetwas not of the formH ⊢ₛ T. - noProgramFoundInTarget
(T : Expr)
: SolveResult
The
TinH ⊢ₛ Twas not of the formwp⟦e⟧ Q s₁ ... sₙ. - noStrategyForProgram
(e : Expr)
: SolveResult
Don't know how to handle
einH ⊢ₛ wp⟦e⟧ Q s₁ ... sₙ. - noSpecFoundForProgram
(e monad : Expr)
(thms : Array SpecAttr.SpecTheoremNew)
: SolveResult
Did not find a spec for the
einH ⊢ₛ wp⟦e⟧ Q s₁ ... sₙ. Candidates werethms, but none of them matched the monad. - goals
(subgoals : List MVarId)
: SolveResult
Successfully decomposed the goal. These are the subgoals.
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, .noProgramFoundInTarget, etc.) when no further decomposition is possible.
The function performs the following steps in order:
- Forall introduction: If the target is a
∀, introduce binders viaSym.intros. - Triple unfolding: If the target is
⦃P⦄ x ⦃Q⦄, unfold intoP ⊢ₛ wp⟦x⟧ Q. - PostCond.entails decomposition: Split
PostCond.entailsinto its components. - Lambda introduction: If the RHS
TinH ⊢ₛ Tis a lambda, introduce an extra state variable viaSPred.entails_cons_intro. - Proj/beta reduction: Reduce
Prod.fst/Prod.sndprojections and beta redexes in bothHandT(e.g.,(fun _ => T, Q.snd).fst s→T). - Syntactic rfl: If
Tis not aPredTrans.apply, try closing bySPred.entails.refl. - Let-hoisting: Hoist let-expressions from the program head to the goal target.
7a. Let-zeta/intro: If the target starts with
let, zeta immediately if duplicable, else introduce into the local context viaintrosSimp. 7b. Fvar zeta: Unfold local let-bound fvars on demand when they appear as the program head. - Iota reduction: Reduce matchers/recursors with concrete discriminants.
- ite/dite/match splitting: Apply the appropriate split backward rule.
- Spec application: Look up a registered
@[spec]theorem (triple or simp) and apply its cached backward rule.
Equations
- One or more equations did not get rendered due to their size.