Unary VCGen Internals #
Implementation details for the unary VCGen planner and close passes.
Instances For
Try to close the current goal using only immediate local information.
This is intentionally cheap: it is used while speculating on triple_bind, so it must not
launch expensive proof search on goals with unresolved cut metavariables.
Instances For
Try bounded local proof search on a closed goal.
We only invoke solve_by_elim once the target has no unresolved expression metavariables; this
avoids pathological search on speculative intermediate cuts introduced by triple_bind.
Instances For
Apply an explicit unary theorem/assumption step and try to close any easy side goals.
When requireClosed is true, the step only succeeds if no goals remain afterwards.
Instances For
Try to close the current goal (typically a Triple subgoal) using direct hypotheses,
canonical leaf rules, or bounded local consequence search.
Instances For
Finish-only closure step: includes the support-sensitive leaf rules that are too expensive
for the default vcstep hot path.
Instances For
Run one bounded finish/closure pass across all current goals.
Instances For
Try to decompose a match expression in the computation by case-splitting
on its discriminant(s). Only fires when the computation is a compiled matcher
(detected via matchMatcherApp?). Delegates to split which handles the actual
case analysis.
Instances For
Check if an expression is a lambda whose body does not use the bound variable
(i.e. a constant function fun _ => c).
Instances For
Try the strongest automatic bind step: triple_bind plus immediate closure of the
spec side-goal.
Instances For
Try only the automatic loop-invariant rules, without the structural fallback rules.
Instances For
Try only the structural loop fallback rules (succ / cons) after invariant search.
Instances For
Apply a loop invariant rule with an explicitly provided invariant.
Instances For
Find the local hypotheses that work as explicit bind cuts.
Instances For
Find the unique local hypothesis that works as an explicit bind cut.
Returns none if there are 0 or ≥ 2 viable candidates.
Instances For
Find the local hypotheses that work as explicit loop invariants.
Instances For
Find the unique local hypothesis that works as an explicit loop invariant.
Returns none if there are 0 or ≥ 2 viable candidates.
Instances For
Find the registered compiled rules whose bounded application makes progress.
Instances For
Find the first registered compiled rule whose bounded application makes progress.
Instances For
Try to close or rewrite a Pr[ ...] = Pr[ ...] goal by swapping adjacent independent binds.
Handles 0–2 layers of tsum peeling.
- swap : ProbEqAction
- congr : ProbEqAction
- congrNoSupport : ProbEqAction
- rewrite : ProbEqAction
- rewriteUnder (depth : ℕ) : ProbEqAction
Instances For
Instances For
Try to decompose a Pr[ ... | mx >>= f₁] = Pr[ ... | mx >>= f₂] goal by congruence,
then auto-intro the bound variable and support hypothesis.
Instances For
Instances For
Build a theorem that swaps adjacent binds under depth shared prefixes.
Try to rewrite one top-level bind-swap without closing the goal.
Instances For
Try to rewrite one bind-swap under depth shared prefixes on either side.
Instances For
Try a small backtracking-free sequence of probability-equality steps.
Instances For
Instances For
Instances For
Try to handle a Pr[ ...] = Pr[ ...] equality goal by swap, congr, or swap+congr.
Also tries a fallback bridge from exact probOutput equalities into relational VCGen.
Instances For
Try to handle a Pr[ ...] = Pr[ ...] equality goal by swap, congr, or swap+congr.
Instances For
Instances For
Instances For
Try to lower a probability goal into a Triple, wp, or probability-equality goal.
Instances For
Continue structural stepping on a raw wp goal after probability lowering or explicit
wp-level work. This stays deliberately smaller than the Triple path.
Instances For
Try to synthesize a support-based intermediate postcondition for a bind step.
When the computation is oa >>= f and no explicit spec is available, tries applying
triple_bind with an inferred cut and closing the spec subgoal via triple_support,
which unifies the cut to fun x => ⌜x ∈ support oa⌝.
Instances For
Structural/default unary VCGen step, excluding explicit cut/invariant/theorem-driven fallbacks and the final close/search phase.
Instances For
Choose one unary VCGen step and remember how to replay it explicitly.
Instances For
Execute one planned unary VCGen step, returning the chosen step for replay/trace.
Instances For
One step of VCGen on a Triple goal. Returns true if any progress was made.
Instances For
Run one VCGen pass across all current goals and record the chosen steps.
Instances For
Run one VCGen pass across all current goals.