Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Migration.Exec.DeleteLast

Deterministic Singleton Deletion and Empty-Epoch Collapse (deleteLastOneCode) #

Compiles singleton deletion (n = 1 → 1 or 1 → 0) on delete u into the parameter-free (¬ReadsWidth) native RCode .exact rResize subroutine deleteLastOneCode, proving its O(1) deterministic RDemonicExec specification deleteLastOneCode_demonicExec.

Main definitions #

Main results #

Parameter-free $O(1)$ deterministic instruction charge for n = 1 deletion and empty-epoch collapse (deleteLastOneCode).

Singleton deletion (n = 1 → 1 or 1 → 0) on delete u: reconstructs the sole live key u₀ at dense slot 0, and on u₀ = u zeros (N, n, n_init) at base + 5..7 and shrinks back to the 8-word empty header (¬ReadsWidth).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.deleteLastOneCode_demonicExec {U V w N n_init base : ℕ} {θ : Succinct.QuotHashSeed U N} {s_abs : State U} (u : Fin U) {x : WordRAM.Resizable.RData rResize} (hx : WordRAM.Resizable.RData.Bounded w x) (hev : EpochValid U 1 N) (hfr : x.frontier = base + compactedEpochWords U V w N 1) (hsplit : CompactedSplitRep base (base + offCompItems U w N) U V w N 1 n_init θ s_abs { mem := x.mem, frontier := x.frontier }) (hbase : x.regs mBase = base) (hu_reg : x.regs mArgU = ↑u) :
∃ (z : WordRAM.Resizable.RData rResize) (steps : ℕ), (WordRAM.Resizable.RDemonicExec w x.frontier deleteLastOneCode x steps fun (x : WordRAM.Resizable.RData rResize) => x = z) ∧ WordRAM.Resizable.RData.Bounded w z ∧ z.regs mBase = base ∧ (∀ addr < base, z.mem addr = x.mem addr) ∧ if (s_abs u).isSome = true then Function.update s_abs u none = empty U ∧ CompactedRep U V w 0 0 0 base (empty U) z ∧ steps ≤ deleteLastOneCharge else Function.update s_abs u none = s_abs ∧ z.frontier = base + compactedEpochWords U V w N 1 ∧ CompactedSplitRep base (base + offCompItems U w N) U V w N 1 n_init θ s_abs { mem := z.mem, frontier := z.frontier } ∧ inEpochPotential U w N base z = inEpochPotential U w N base x ∧ steps ≤ deleteLastOneCharge

Deterministic Singleton Delete (deleteLastOneCode_demonicExec): From an active singleton epoch (n = 1, EpochValid U 1 N) at base with seed θ: