Assertions at entry to and return from nodes and sweeps. The fuel arguments distinguish exhaustion from completed coverage.
Preconditions for a node call.
Postconditions for a node call, including its exit.
Preconditions for a sweep call.
- sweepPost : Nat → Nat → Bool → Nat → Nat → Nat → Nat → Option Nat → VSet n → Nat → σ → Exit × Nat × σ → Prop
Postconditions for a sweep call, including its exit and orbit index.
Instances For
Local obligations sufficient for the contracts of every recursive call. The step obligations use only the contracts of their continuations.
- node_zero (first : Bool) (level numcells : Nat) (st : σ) : C.nodePre 0 first level numcells st → C.nodePost 0 first level numcells st (Exit.fuel, st)
An exhausted node reports exhaustion without changing its state.
- node_step (fuel : Nat) (next : SweepFn σ n) : C.sweepValid fuel (n + 1) next → ∀ (first : Bool) (level numcells : Nat) (st : σ), C.nodePre (fuel + 1) first level numcells st → C.nodePost (fuel + 1) first level numcells st (nodeStep ctx tcLevel next first level numcells st)
The local node operations preserve the contract when the sweep does.
- sweep_none (fuel cfuel : Nat) (first : Bool) (level numcells tc tv1 : Nat) (cell : VSet n) (index : Nat) (st : σ) : C.sweepPre fuel cfuel first level numcells tc tv1 none cell index st → C.sweepPost fuel cfuel first level numcells tc tv1 none cell index st (Exit.done, index, st)
No remaining vertex means a complete sweep, even with zero fuel.
- sweep_zero (fuel : Nat) (first : Bool) (level numcells tc tv1 tv : Nat) (cell : VSet n) (index : Nat) (st : σ) : C.sweepPre fuel 0 first level numcells tc tv1 (some tv) cell index st → C.sweepPost fuel 0 first level numcells tc tv1 (some tv) cell index st (Exit.fuel, index, st)
A remaining vertex with zero fuel reports exhaustion.
- sweep_step (fuel cfuel : Nat) (descend : NodeFn σ) (next : SweepFn σ n) : C.nodeValid fuel descend → C.sweepValid fuel cfuel next → ∀ (first : Bool) (level numcells tc tv1 tv : Nat) (cell : VSet n) (index : Nat) (st : σ), C.sweepPre fuel (cfuel + 1) first level numcells tc tv1 (some tv) cell index st → C.sweepPost fuel (cfuel + 1) first level numcells tc tv1 (some tv) cell index st (sweepStep inf descend next first level numcells tc tv1 tv cell index st)
One vertex preserves the contract when its node and remaining sweep do.
Instances For
Local policy rules imply the postcondition of every node call.
Local policy rules imply the postcondition of every sweep call.