Documentation

CslibFrontier.Algorithms.Reachability.DoubleCounting.ControllerReplay

Successful typed replays of the double-counting controller #

The list semantics records one entry for each successful typed membership replay. The scan's transcript equivalence makes this list a singleton whenever the current round has unique shortest walks. The controller can therefore use this callback without losing multiplicity information about successful replays.

The enumeration is proof-level. It does not provide a native execution or a space bound.

noncomputable def Cslib.DoubleCounting.replayMembership {n : ℕ} (edge : Fin n → Fin n → Bool) (s : Fin n) :

List a successful answer once per bounded typed branch at the exact round tally. Off-contract tallies have no entries.

theorem Cslib.DoubleCounting.replayMembership_eq_singleton {n : ℕ} (edge : Fin n → Fin n → Bool) (s v : Fin n) (k : ℕ) (h : ∃! w : Transcript (Fin n), Passes (fun (u w : Fin n) => edge u w = true) s k w) :
replayMembership edge s k (expected (fun (u w : Fin n) => edge u w = true) s k) v = [decide (v ∈ round (fun (u w : Fin n) => edge u w = true) s k)]

Each exact round with unique shortest walks gives one typed replay and the correct bit.

theorem Cslib.DoubleCounting.runController_replay_correct {n : ℕ} (edge : Fin n → Fin n → Bool) (s v : Fin n) :
∃ (verdict : ControllerVerdict), runController (fun (u w : Fin n) => pure (edge u w)) (replayMembership edge s) v = [some verdict] ∧ ControllerVerdict.Correct (fun (u w : Fin n) => edge u w = true) s v verdict

The bounded scan instantiates the controller's singleton callback contract in the list semantics, retaining one successful outcome with multiplicity.