Parameter-Free bufLookupGenProg Subroutine #
Certified O_c(1) bufLookup returning (1, (b, loc)) on active match and (0, (0, 0))
otherwise without mutating memory.
Main definitions #
Main results #
@[irreducible]
Parameter-free bufLookup (d = (((cp, base), ep), rKey)), returning (0, (0, 0)) on none
and (1, (b, loc)) on some (b, loc).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufLookupGenProg_spec {c U V w n_max base ep rKey : ℕ} {tr : SuccinctWhp.BufTrie} {mapFn : ℕ → Option (ℕ × ℕ)} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hep : ep = 0 ∨ ep = 1) (hrep : BufTrieMemRep base c U V w n_max ep tr s.mem) (hv : SuccinctWhp.ValidBufTrie (SuccinctWhp.cTabWhp c) (SuccinctWhp.bCharWhp n_max) tr mapFn) :
have prog := bufLookupGenProg (((mkWhpCoreParams c U V w n_max, base), ep), rKey);
(Memory.spec 0).clientState s prog = s ∧ ((Memory.spec 0).clientResult s prog = match SuccinctWhp.bufLookup (SuccinctWhp.cTabWhp c) (SuccinctWhp.bCharWhp n_max) tr rKey with
| none => (0, 0, 0)
| some (b, loc) => (1, b, loc)) ∧ WordRAM.Realization.memoryCost prog s ≤ 2 * SuccinctWhp.cTabWhp c + 8 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog