Combined Stage Dispatcher, Epoch Rollover, and epochTickGenProg #
Dispatches Stages 0 .. 5 via epochTickStageAllGenProg, executes epoch-clock rollover via
epochTickRolloverGenProg, and proves realizes_epochTickGen, epochTickGenProg_fastStep, and
epochTick_isSome_iff.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.epochTick_isSome_iff {c U n_max : ℕ} (θ : SuccinctWhp.SeedWhp c U n_max) {fs : SuccinctWhp.FastState} (hst_le : fs.rebStage ≤ 5) :
For every fs with fs.rebStage ≤ 5, (epochTick c U n_max θ fs).isSome equals
epochTickWillSucceed n_max fs.
@[irreducible]
Execute epochTick when epochTickWillSucceed n_max fs holds (d = (wp, base)).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.realizes_epochTickGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact epochTickGenProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : WhpParams × ℕ) (s : Memory.State) =>
match x with
| (wp, base) =>
∃ (c : ℕ) (U : ℕ) (V : ℕ) (w₀ : ℕ) (n_max : ℕ) (θ : SuccinctWhp.SeedWhp c U n_max) (fs : SuccinctWhp.FastState)
(dict : State U),
WhpLargeEnv c U V w₀ n_max w base ∧ wp = mkWhpParams c U V w₀ n_max ∧ SeedWhpMemRep base c U w₀ n_max θ s.mem ∧ FastMemRep base c U V w₀ n_max fs s.mem ∧ SuccinctWhp.CoreFastInv c U V n_max θ fs dict ∧ SuccinctWhp.ValidEpochStagePreTick c U n_max θ fs)
fun (x : WhpParams × ℕ) (x_1 : Memory.State) => 0
Realizes .exact certificate for epochTickGenProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.EpochTickInternal.epochTickGenProg_fastStep {c U V w n_max base : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {dict : State U} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hcore : SuccinctWhp.CoreFastInv c U V n_max θ fs dict) (hpre : SuccinctWhp.ValidEpochStagePreTick c U n_max θ fs) (hok : epochTickWillSucceed n_max fs = true) (hseed : SeedWhpMemRep base c U w n_max θ s.mem) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := epochTickGenProg (mkWhpParams c U V w n_max, base);
have s' := (Memory.spec 0).clientState s prog;
∃ (fs' : SuccinctWhp.FastState),
SuccinctWhp.epochTick c U n_max θ fs = some fs' ∧ WordRAM.Realization.memoryCost prog s ≤ 2 * SuccinctWhp.cTabWhp c + 32 * hashEvalCostWhp c + 43960 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ FastStateStep base c U V w n_max θ fs' s s'
FastStateStep specification for epochTickGenProg.