A sweep is strictly past its first child, or is entirely off the first path.
Equations
Instances For
structure
Hex.GraphIso.Nauty.Generic.StablePolicy
{n : Nat}
{σ γ : Type}
[Policy σ n]
(ctx : γ)
(inf tcLevel : Nat)
(P : σ → Prop)
(validCode : Nat → Prop := fun (x : Nat) => True)
(validLeaf : Leaf → σ → Prop := fun (x : Leaf) (x_1 : σ) => True)
:
Local operations outside the first descent preserve a state invariant.
- classify (level numcells : Nat) (st : σ) : P st → P (Policy.classify ctx level numcells st).snd ∧ validLeaf (Policy.classify ctx level numcells st).fst (Policy.classify ctx level numcells st).snd
- leaf (leaf : Leaf) (level : Nat) (st : σ) : validLeaf leaf st → P st → P (Policy.leafExit leaf level st).snd
- afterSweep (level size index : Nat) (st : σ) : P st → P (Policy.afterSweep false level size index st)
Instances For
theorem
Hex.GraphIso.Nauty.Generic.StablePolicy.node_step
{n : Nat}
{σ γ : Type}
[Policy σ n]
{ctx : γ}
{inf tcLevel : Nat}
{P : σ → Prop}
{validCode : Nat → Prop}
{validLeaf : Leaf → σ → Prop}
(h : StablePolicy ctx inf tcLevel P validCode validLeaf)
{fuel : Nat}
{next : SweepFn σ n}
(hnext : (stableContract n P).sweepValid fuel (n + 1) next)
(level numcells : Nat)
(st : σ)
(hin : P st)
:
An off-path node preserves the state invariant.
theorem
Hex.GraphIso.Nauty.Generic.StablePolicy.sweep_step
{n : Nat}
{σ γ : Type}
[Policy σ n]
{ctx : γ}
{inf tcLevel : Nat}
{P : σ → Prop}
{validCode : Nat → Prop}
{validLeaf : Leaf → σ → Prop}
(h : StablePolicy ctx inf tcLevel P validCode validLeaf)
{fuel cfuel : Nat}
{descend : NodeFn σ}
{next : SweepFn σ n}
(hdescend : (stableContract n P).nodeValid fuel descend)
(hnext : (stableContract n P).sweepValid fuel cfuel next)
(first : Bool)
(level numcells tc tv1 tv index : Nat)
(cell : VSet n)
(st : σ)
(hpast : Past first tv1 (some tv))
(hin : P st)
:
Once past the first child, all later recursive calls are off-path.
theorem
Hex.GraphIso.Nauty.Generic.StablePolicy.sound
{n : Nat}
{σ γ : Type}
[Policy σ n]
{ctx : γ}
{inf tcLevel : Nat}
{P : σ → Prop}
{validCode : Nat → Prop}
{validLeaf : Leaf → σ → Prop}
(h : StablePolicy ctx inf tcLevel P validCode validLeaf)
:
SoundPolicy ctx inf tcLevel (stableContract n P)
Local preservation gives the generic invariant contract.
theorem
Hex.GraphIso.Nauty.Generic.node_stable
{n : Nat}
{σ γ : Type}
[Policy σ n]
{ctx : γ}
{inf tcLevel : Nat}
{P : σ → Prop}
{validCode : Nat → Prop}
{validLeaf : Leaf → σ → Prop}
(h : StablePolicy ctx inf tcLevel P validCode validLeaf)
(fuel level numcells : Nat)
(st : σ)
(hin : P st)
:
An off-path node preserves an invariant stable under its local operations.
theorem
Hex.GraphIso.Nauty.Generic.sweep_stable
{n : Nat}
{σ γ : Type}
[Policy σ n]
{ctx : γ}
{inf tcLevel : Nat}
{P : σ → Prop}
{validCode : Nat → Prop}
{validLeaf : Leaf → σ → Prop}
(h : StablePolicy ctx inf tcLevel P validCode validLeaf)
(first : Bool)
(fuel cfuel level numcells tc tv1 index : Nat)
(cursor : Option Nat)
(cell : VSet n)
(st : σ)
(hpast : Past first tv1 cursor)
(hin : P st)
:
A later sibling sweep preserves the same invariant.