Top-Level 63-Word Active Epoch Parameter Writer (writeEpochParamsGenProg) #
Assembles writeRootHdrSubProg, computeLogScalesProg, writeHashParamsSubProg, and
writeCompParamsSubProg into the parameter-free (¬ReadsWidth) Memory.Prog subroutine
writeEpochParamsGenProg populating [dstMetaBase, dstMetaBase + 63) in O(N) (≤ 11 * N + 100)
operations via RealizesBounded .exact.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.writeEpochParamsGenProg,WriteEpochParamsPre: parameter-freeMemory.Progwriter for the 63-word active epoch parameter header[dstMetaBase, dstMetaBase + 63)and its entry precondition.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.writeEpochParamsGenProg_spec,realizesBounded_writeEpochParamsGen: functional specification (≤ 11 * N + 100cost bound) andRealizesBounded .exactcompilation certificate.
Populate the 8-word root header, 19-word HashParams, and 36-word CompParams at
[dstMetaBase, dstMetaBase + 63) from [srcHdrBase, srcHdrBase + 5) and (N, n_cur, n_init_new),
returning (offCompItems U w N, epochHashSpace U w N) (¬ReadsWidth).
Entry precondition for writeEpochParamsGenProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.writeEpochParamsGenProg_spec {w U V N_old n_old n_init_old srcHdrBase dstMetaBase N n_cur n_init_new : ℕ} {s : Memory.State} (hw : 0 < w) (hN : 1 ≤ N) (hNU : N ≤ U) (hV : V ≤ 2 ^ w) (hfit_ncur : WordRAM.Fits w n_cur) (hfit_ninit : WordRAM.Fits w n_init_new) (hhdr : RootHeaderValid U V w N_old n_old n_init_old srcHdrBase s.mem) (hsrc_fr : srcHdrBase + 5 ≤ s.frontier) (hdst_fr : dstMetaBase + 63 ≤ s.frontier) (hfit_dst : WordRAM.Fits w (dstMetaBase + offCompItems U w N)) :
have d := ((srcHdrBase, dstMetaBase), N, n_cur, n_init_new);
have prog := writeEpochParamsGenProg d;
have s' := (Memory.spec 0).clientState s prog;
WriteEpochParamsPre w d s ∧ (Memory.spec w).ValidHistory s ((Memory.spec w).clientHistory s prog) ∧ (Memory.spec 0).clientResult s prog = (offCompItems U w N, epochHashSpace U w N) ∧ s'.frontier = s.frontier ∧ RootHeaderValid U V w N n_cur n_init_new dstMetaBase s'.mem ∧ EpochParamsStored U V w N dstMetaBase s'.mem ∧ (∀ (a : ℕ), ¬(dstMetaBase ≤ a ∧ a < dstMetaBase + offScratch) → s'.mem a = s.mem a) ∧ WordRAM.Realization.memoryCost prog s ≤ 11 * N + 100
Functional specification and ≤ 11 * N + 100 cost bound for writeEpochParamsGenProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.realizesBounded_writeEpochParamsGen :
writeEpochParamsGenProg compiles via RealizesBounded .exact.