Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpFastOpProg.InsOverwrite

Fast Insertion Overwrite Branch (fastInsertOverwriteGenProg) #

Handles key hits during fastInsert: overwrites valArr[physSlot b loc] and runs overmarsStepGenProg while returning 1.

Main definitions #

Main results #

@[irreducible]

Hit branch of fastInsert: overwrite valArr[physSlot b loc] := v_val and run overmarsStep, returning 1 (d = (((wp, base), (b, loc)), v_val)).

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_fastInsertOverwriteGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact fastInsertOverwriteGenProg WordRAM.Realization.WordEncoding.encode WordRAM.Realization.WordEncoding.encode (fun (w : ℕ) (x : ((WhpParams × ℕ) × ℕ × ℕ) × ℕ) (s : Memory.State) => match x with | (((wp, base), b, loc), v_val) => ∃ (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.ValidFastState c U V n_max θ fs dict ∧ b < SuccinctWhp.numBucketsWhp n_max ∧ loc < fs.bktCount b ∧ v_val < V) fun (x : ((WhpParams × ℕ) × ℕ × ℕ) × ℕ) (x_1 : Memory.State) => 0
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.fastInsertOverwriteGenProg_spec {c U V w n_max base b loc v_val : ℕ} {θ : 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) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hloc_b : loc < fs.bktCount b) (hv_v : v_val < V) :
have prog := fastInsertOverwriteGenProg (((mkWhpParams c U V w n_max, base), b, loc), v_val); have s' := (Memory.spec 0).clientState s prog; have fs_ov := { quotArr := fs.quotArr, valArr := Function.update fs.valArr (SuccinctWhp.FastState.physSlot n_max fs b loc) v_val, locState := fs.locState, bktCount := fs.bktCount, bktSalt := fs.bktSalt, liveRole := fs.liveRole, liveInsCount := fs.liveInsCount, overmarsRole := fs.overmarsRole, overmarsActive := fs.overmarsActive, overmarsCursor := fs.overmarsCursor, overmarsInsCount := fs.overmarsInsCount, rebDoneFlag := fs.rebDoneFlag, rebQueued := fs.rebQueued, backPtr := fs.backPtr, poolFreeTop := fs.poolFreeTop, poolFreeStack := fs.poolFreeStack, poolOwner := fs.poolOwner, slices := fs.slices, buf := fs.buf, curEp := fs.curEp, epochClock := fs.epochClock, rebStage := fs.rebStage, stageCursor := fs.stageCursor, dirtyCount := fs.dirtyCount, dirtyBuckets := fs.dirtyBuckets, dirtyIdx := fs.dirtyIdx, rebCandSalt := fs.rebCandSalt, rebScanCursor := fs.rebScanCursor, rebInsCount := fs.rebInsCount, rebCollision := fs.rebCollision }; (Memory.spec 0).clientResult s prog = 1 ∧ WordRAM.Realization.memoryCost prog s ≤ 32 * hashEvalCostWhp c + 39332 ∧ 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 fs_ov) s s'