Internal Leaf Commit Helpers (bufInsertLeafRtProg) #
Internal leaf-item allocation and active-item update subroutine consumed privately by Insert.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufInsertLeafRtProgCslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.BufInsertLeafPre
Main results #
Precondition for bufInsertLeafRtProg.
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufInsertLeafRtProg_spec {c U V w n_max base ep leaf b loc : ℕ} {tr1 : SuccinctWhp.BufTrie} {s1 : 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 tr1 s1.mem) (hlf_lt : leaf < tr1.nodeAlloc) (hia_lt : tr1.itemAlloc < SuccinctWhp.qEpochWhp n_max) (hli_le : tr1.nodeLeafItem leaf ≤ tr1.itemAlloc) (hb : b < SuccinctWhp.numBucketsWhp n_max) (hloc : loc < SuccinctWhp.totalLocalCoordsWhp n_max) :
have rt := mkBufRt c U V w n_max base ep;
have prog := bufInsertLeafRtProg ((rt, leaf), b, loc);
have id1 := tr1.nodeLeafItem leaf;
have tr' :=
if id1 = 0 then
have id := tr1.itemAlloc;
{ nodeAlloc := tr1.nodeAlloc, itemAlloc := id + 1, trieChild := tr1.trieChild, nodeParent := tr1.nodeParent,
nodeChar := tr1.nodeChar, nodeLeafItem := Function.update tr1.nodeLeafItem leaf (id + 1),
nodeActive := Function.update tr1.nodeActive leaf 1, itemLeaf := Function.update tr1.itemLeaf id leaf,
itemBucket := Function.update tr1.itemBucket id b, itemLoc := Function.update tr1.itemLoc id loc }
else have id := id1 - 1;
{ nodeAlloc := tr1.nodeAlloc, itemAlloc := tr1.itemAlloc, trieChild := tr1.trieChild, nodeParent := tr1.nodeParent,
nodeChar := tr1.nodeChar, nodeLeafItem := tr1.nodeLeafItem, nodeActive := Function.update tr1.nodeActive leaf 1,
itemLeaf := tr1.itemLeaf, itemBucket := Function.update tr1.itemBucket id b,
itemLoc := Function.update tr1.itemLoc id loc };
have s' := (Memory.spec 0).clientState s1 prog;
s'.frontier = s1.frontier ∧ WordRAM.Realization.memoryCost prog s1 ≤ 24 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s1 prog ∧ BufTrieMemRep base c U V w n_max ep tr' s'.mem ∧ BufEpFrame base c U V w n_max ep s1.mem s'.mem