Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpFastOpProg.DelRemReb

Fast Deletion Removal in Rebuild Slice & Info Reader #

Stage-2 rebuild-slice deletion helper and read-only pre-fetch (st_del, (rKey_u, fp_live_u)) for fastDeleteRemoveGenProg.

Main definitions #

Main results #

@[irreducible]

Sub-helper 6.1d: delete fpOfSalt rebCandSalt u from rebSlice[b] when Stage 2 is actively scanning bucket b past loc_del.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.delRemRebGenProg_fastStep {c U V w n_max base b loc_del st_del : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {s : Memory.State} (u : Fin U) (henv : WhpLargeEnv c U V w n_max w base) (hce : fs.curEp = 0 ∨ fs.curEp = 1) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hrIdx : fs.rebSliceIdx b < 3 * SuccinctWhp.numBucketsWhp n_max) (hreb_fn : decide (fs.rebStage = 2 ∧ fs.dirtyIdx < fs.dirtyCount ∧ fs.dirtyBuckets fs.dirtyIdx = b ∧ fs.rebCandSalt < SuccinctWhp.sMaxWhp c n_max ∧ fs.rebCollision = 0) = true → fs.rebInsCount ≤ 8 * FeistelQuotient.slabScale n_max ^ 12 ∧ ∃ (rm : ℕ → Option ℕ), SuccinctWhp.ValidWhpSlice n_max fs.rebInsCount (fs.slices (fs.rebSliceIdx b)) rm) (hseed : SeedWhpMemRep base c U w n_max θ s.mem) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := delRemRebGenProg ((((mkWhpParams c U V w n_max, base), b), loc_del), st_del, ↑u); have s' := (Memory.spec 0).clientState s prog; have rebActiveB := decide (fs.rebStage = 2 ∧ fs.dirtyIdx < fs.dirtyCount ∧ fs.dirtyBuckets fs.dirtyIdx = b ∧ fs.rebCandSalt < SuccinctWhp.sMaxWhp c n_max ∧ fs.rebCollision = 0); have rIdx := fs.rebSliceIdx b; have slices3 := if (rebActiveB && decide (loc_del < fs.rebScanCursor ∧ (st_del = 1 ∨ st_del = 2 + fs.oldEp))) = true then Function.update fs.slices rIdx (SuccinctWhp.btreeDelete (SuccinctWhp.fpBitsWhp n_max) (SuccinctWhp.valLaneBitsWhp n_max) (SuccinctWhp.tMinWhp n_max) (fs.slices rIdx) (SuccinctWhp.fpOfSalt c U n_max θ.2 fs.rebCandSalt u)) else fs.slices; WordRAM.Realization.memoryCost prog s ≤ hashEvalCostWhp c + 290 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ FastStateStep base c U V w n_max θ { quotArr := fs.quotArr, valArr := fs.valArr, 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 := slices3, 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 } s s'
@[irreducible]

Read (st_del, (rKey_u, fp_live_u)) for fastDeleteRemoveGenProg without mutating memory.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_delRemReadInfoGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact delRemReadInfoGenProg WordRAM.Realization.WordEncoding.encode WordRAM.Realization.WordEncoding.encode (fun (w : ℕ) (x : (((WhpParams × ℕ) × ℕ) × ℕ) × ℕ) (s : Memory.State) => match x with | ((((wp, base), b), loc_del), snd) => ∃ (c : ℕ) (U : ℕ) (V : ℕ) (w₀ : ℕ) (n_max : ℕ) (θ : SuccinctWhp.SeedWhp c U n_max) (fs : SuccinctWhp.FastState), 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 ∧ b < SuccinctWhp.numBucketsWhp n_max ∧ loc_del < SuccinctWhp.totalLocalCoordsWhp n_max) fun (x : (((WhpParams × ℕ) × ℕ) × ℕ) × ℕ) (x_1 : Memory.State) => 0
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.delRemReadInfoGenProg_spec {c U V w n_max base b loc_del : ℕ} {θ : SuccinctWhp.SeedWhp c U n_max} {fs : SuccinctWhp.FastState} {s : Memory.State} (u : Fin U) (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) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hld_tl : loc_del < SuccinctWhp.totalLocalCoordsWhp n_max) :
have prog := delRemReadInfoGenProg ((((mkWhpParams c U V w n_max, base), b), loc_del), ↑u); (Memory.spec 0).clientState s prog = s ∧ (Memory.spec 0).clientResult s prog = (fs.locState b loc_del, SuccinctWhp.fpReducedKey c U n_max θ.2 u, SuccinctWhp.fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) ∧ WordRAM.Realization.memoryCost prog s ≤ hashEvalCostWhp c + 5 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog