Fast-Mode Bucket Role & Rebuild Slice Index Readers #
Parameter-free Memory.Prog readers recovering (fs.rebRole b, fs.overmarsRole b) and
fs.rebSliceIdx b from bucket metadata without mutating memory.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebAndOmRoleGenProgCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebSliceIdxGenProg
Main results #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_readRebAndOmRoleGenCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebAndOmRoleGenProg_specCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_readRebSliceIdxGenCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebSliceIdxGenProg_spec
@[irreducible]
Read (fs.rebRole b, fs.overmarsRole b) from bucket b metadata fields 2 and 4
(d = ((cp, base), b)).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_readRebAndOmRoleGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact readRebAndOmRoleGenProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : (WhpCoreParams × ℕ) × ℕ) (x_1 : Memory.State) =>
match x with
| ((cp, base), b) => WhpLargeEnvGen w cp base ∧ b < wpM cp)
fun (x : (WhpCoreParams × ℕ) × ℕ) (x_1 : Memory.State) => 0
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebAndOmRoleGenProg_spec {c U V w n_max base b : ℕ} {fs : SuccinctWhp.FastState} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := readRebAndOmRoleGenProg ((mkWhpCoreParams c U V w n_max, base), b);
(Memory.spec 0).clientState s prog = s ∧ (Memory.spec 0).clientResult s prog = (if fs.liveRole b ≤ 3 ∧ fs.overmarsRole b ≤ 3 - fs.liveRole b then fs.rebRole b else 0, fs.overmarsRole b) ∧ WordRAM.Realization.memoryCost prog s = 4 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog
@[irreducible]
Read fs.rebSliceIdx b = 3 * b + (3 - fs.liveRole b - fs.overmarsRole b)
(d = ((cp, base), b)).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_readRebSliceIdxGen :
WordRAM.Realization.Realizes WordRAM.Basis.exact readRebSliceIdxGenProg WordRAM.Realization.WordEncoding.encode
WordRAM.Realization.WordEncoding.encode
(fun (w : ℕ) (x : (WhpCoreParams × ℕ) × ℕ) (x_1 : Memory.State) =>
match x with
| ((cp, base), b) => WhpLargeEnvGen w cp base ∧ b < wpM cp)
fun (x : (WhpCoreParams × ℕ) × ℕ) (x_1 : Memory.State) => 0
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readRebSliceIdxGenProg_spec {c U V w n_max base b : ℕ} {fs : SuccinctWhp.FastState} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hrep : FastMemRep base c U V w n_max fs s.mem) :
have prog := readRebSliceIdxGenProg ((mkWhpCoreParams c U V w n_max, base), b);
(Memory.spec 0).clientState s prog = s ∧ (Memory.spec 0).clientResult s prog = fs.rebSliceIdx b ∧ WordRAM.Realization.memoryCost prog s = 4 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog