Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpFastOpProg.FastInsert

Fast-Mode Guarded Insertion / Overwrite (fastInsertGenProg) #

Worst-case O_c(1) guarded insertion and overwrite program refining fastInsert and leaving memory untouched whenever any fast-mode guard rejects.

Main definitions #

Main results #

@[irreducible]

Fast-mode guarded insertion / overwrite fastInsertGenProg (d = (((wp, base), u_val), v_val)), returning 1 when fastInsert succeeds (FastStateStep) and 0 without mutating memory when any fast-mode guard fires.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.fastInsertGenProg_spec {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) (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) (u : Fin U) {v_val : ℕ} (hv_v : v_val < V) :
have prog := fastInsertGenProg (((mkWhpParams c U V w n_max, base), ↑u), v_val); have s' := (Memory.spec 0).clientState s prog; WordRAM.Realization.memoryCost prog s ≤ 30 * SuccinctWhp.cTabWhp c + 35 * hashEvalCostWhp c + 42386 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ match SuccinctWhp.fastInsert c U n_max θ fs u v_val with | some fs' => (Memory.spec 0).clientResult s prog = 1 ∧ FastStateStep base c U V w n_max θ fs' s s' | none => (Memory.spec 0).clientResult s prog = 0 ∧ s' = s