Rollover Pre-Check checkEpochTickOkGenProg #
Implements and verifies the O(1) read-only rollover pre-check checkEpochTickOkGenProg
matching epochTickWillSucceed n_max fs, together with invariance of epochTickWillSucceed
across fastInsert and fastDelete.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.epochTickWillSucceed_fastInsert {c U V n_max : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs fs1 : SuccinctWhp.FastState} {dict : State U} (hv : SuccinctWhp.ValidFastState c U V n_max θ fs dict) {u : Fin U} {v : ℕ} (hins : SuccinctWhp.fastInsert c U n_max θ fs u v = some fs1) :
Successful fastInsert preserves epochTickWillSucceed.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.epochTickWillSucceed_fastDelete {c U V n_max : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {dict : State U} (hv : SuccinctWhp.ValidFastState c U V n_max θ fs dict) (u : Fin U) :
epochTickWillSucceed n_max (SuccinctWhp.fastDelete c U n_max θ fs u) = epochTickWillSucceed n_max fs
fastDelete preserves epochTickWillSucceed.
@[irreducible]
Read-only O(1) check returning 1 iff epochTickWillSucceed n_max fs = true
(d = (cp, base)).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.realizes_checkEpochTickOkGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact checkEpochTickOkGenProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : WhpCoreParams × ℕ) (s : Memory.State) =>
match x with
| (cp, base) =>
∃ (c : ℕ) (U : ℕ) (V : ℕ) (w₀ : ℕ) (n_max : ℕ) (fs : SuccinctWhp.FastState),
WhpLargeEnv c U V w₀ n_max w base ∧ cp = mkWhpCoreParams c U V w₀ n_max ∧ FastMemRep base c U V w₀ n_max fs s.mem ∧ (fs.curEp = 0 ∨ fs.curEp = 1) ∧ fs.epochClock < SuccinctWhp.qEpochWhp n_max)
fun (x : WhpCoreParams × ℕ) (x_1 : Memory.State) => 0
Realizes .exact certificate for checkEpochTickOkGenProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.checkEpochTickOkGenProg_spec {c U V w n_max base : ℕ} {fs : SuccinctWhp.FastState} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hce_or : fs.curEp = 0 ∨ fs.curEp = 1) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := checkEpochTickOkGenProg (mkWhpCoreParams c U V w n_max, base);
(Memory.spec 0).clientState s prog = s ∧ ((Memory.spec 0).clientResult s prog = if epochTickWillSucceed n_max fs = true then 1 else 0) ∧ WordRAM.Realization.memoryCost prog s ≤ 5 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog
Cost and result specification for checkEpochTickOkGenProg.