Fast Insertion Fresh Commit & Overmars Step (insCommitFreshGenProg) #
Combines slot allocation, (q, v) write, direct/collision insertion, and overmarsStepGenProg
once all fast-mode guards succeed.
Main definitions #
Main results #
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_insCommitFreshGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact insCommitFreshGenProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : (((WhpParams × ℕ) × ℕ × ℕ) × ℕ × ℕ) × ℕ × ℕ × ℕ × ℕ) (s : Memory.State) =>
match x with
| ((((wp, base), b, X), q_val, v_val), hasCol, fst, fp, lIdx) =>
∃ (c : ℕ) (U : ℕ) (V : ℕ) (w₀ : ℕ) (n_max : ℕ) (θ : SuccinctWhp.SeedWhp c U n_max) (fs : SuccinctWhp.FastState)
(dict : State U) (hasFpCollision : Bool),
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.ValidFastState c U V n_max θ fs dict ∧ b < SuccinctWhp.numBucketsWhp n_max ∧ X = fs.bktCount b ∧ X < SuccinctWhp.totalLocalCoordsWhp n_max ∧ (SuccinctWhp.capFrontWhp n_max ≤ X → 0 < fs.poolFreeTop) ∧ q_val < 2 ^ SuccinctWhp.quotBitsWhp U n_max ∧ v_val < V ∧ (hasCol = if hasFpCollision = true then 1 else 0) ∧ lIdx = fs.liveSliceIdx b ∧ fp < 2 ^ SuccinctWhp.fpBitsWhp n_max)
fun (x : (((WhpParams × ℕ) × ℕ × ℕ) × ℕ × ℕ) × ℕ × ℕ × ℕ × ℕ) (x_1 : Memory.State) => 0
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.insCommitFreshGenProg_spec {c U V w n_max base b q_val v_val rKey fp : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {dict : State U} {s : Memory.State} (hasFpCollision : Bool) (henv : WhpLargeEnv c U V w n_max w base) (hseed : SeedWhpMemRep base c U w n_max θ s.mem) (hrep : FastMemRep base c U V w n_max fs s.mem) (hv : SuccinctWhp.ValidFastState c U V n_max θ fs dict) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hX_tl : fs.bktCount b < SuccinctWhp.totalLocalCoordsWhp n_max) (hpos_fn : SuccinctWhp.capFrontWhp n_max ≤ fs.bktCount b → 0 < fs.poolFreeTop) (hq_lt : q_val < 2 ^ SuccinctWhp.quotBitsWhp U n_max) (hv_v : v_val < V) (hfp_lt : fp < 2 ^ SuccinctWhp.fpBitsWhp n_max) :
have X := fs.bktCount b;
have lIdx := fs.liveSliceIdx b;
have hasCol := if hasFpCollision = true then 1 else 0;
have prog := insCommitFreshGenProg ((((mkWhpParams c U V w n_max, base), b, X), q_val, v_val), hasCol, rKey, fp, lIdx);
have s' := (Memory.spec 0).clientState s prog;
have fsIns :=
SuccinctWhp.fastInsertFresh c n_max b X q_val v_val rKey fp lIdx hasFpCollision
(SuccinctWhp.fastInsertAlloc n_max b X fs);
(Memory.spec 0).clientResult s prog = 1 ∧ WordRAM.Realization.memoryCost prog s ≤ 20 * SuccinctWhp.cTabWhp c + 32 * hashEvalCostWhp c + 41788 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ FastStateStep base c U V w n_max θ (SuccinctWhp.overmarsStep c U n_max θ b fsIns) s s'