Parameter-Free bufInsertGenProg Subroutine #
Certified O_c(1) bufInsert combining bufEnsureLoopGenProg and bufInsertLeafRtProg while
preserving BufEpFrame and BufTrieMemRep.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.BufInsertGenPreCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufInsertGenProg
Main results #
Precondition for bufInsertGenProg (d = ((((cp, base), ep), rKey), (b, loc))).
@[irreducible]
Parameter-free bufInsert (d = ((((cp, base), ep), rKey), (b, loc))).
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufInsertGenProg_spec {c U V w n_max base ep rKey b loc : ℕ} {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) (hna_cap : tr.nodeAlloc + SuccinctWhp.cTabWhp c ≤ SuccinctWhp.maxTrieNodesWhp c n_max) (hia_cap : tr.itemAlloc < SuccinctWhp.qEpochWhp n_max) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hloc : loc < SuccinctWhp.totalLocalCoordsWhp n_max) :
have prog := bufInsertGenProg ((((mkWhpCoreParams c U V w n_max, base), ep), rKey), b, loc);
have s' := (Memory.spec 0).clientState s prog;
have tr' := SuccinctWhp.bufInsert (SuccinctWhp.cTabWhp c) (SuccinctWhp.bCharWhp n_max) tr rKey b loc;
s'.frontier = s.frontier ∧ WordRAM.Realization.memoryCost prog s ≤ 20 * SuccinctWhp.cTabWhp c + 24 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ BufTrieMemRep base c U V w n_max ep tr' s'.mem ∧ BufEpFrame base c U V w n_max ep s.mem s'.mem