Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpBufferTrieProg.ClearLoop

Internal Deamortized Trie Clear Loop (bufClearLoopGenProg) #

Internal ClearableBufTrie iterative edge-popping and node-clearing loop consumed privately by Clear.

Main definitions #

Main results #

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.bufClearLoop_spec {c U V w n_max base ep : ℕ} (henv : WhpLargeEnv c U V w n_max w base) (hep : ep = 0 ∨ ep = 1) :
have rt := mkBufRt c U V w n_max base ep; ∀ (k : ℕ) (tr : SuccinctWhp.BufTrie) (s : Memory.State), BufTrieMemRep base c U V w n_max ep tr s.mem → SuccinctWhp.ClearableBufTrie tr → have prog := bufClearLoopGenProg ((rt, ()), k); have s' := (Memory.spec 0).clientState s prog; have tr' := SuccinctWhp.bufClearSteps k tr; WordRAM.Realization.iterationSafe bufClearOneRtProg BufClearOnePre w rt k () s ∧ s'.frontier = s.frontier ∧ WordRAM.Realization.memoryCost prog s ≤ 15 * k ∧ 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