Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Dispatch.SlotOps.Internal

Internal Helpers for Compacted Slot Resolution and GlobalMeta Pool Updates #

Shared internal bounds, CompGmFrame combinators, writeCompGMGenProg bind helpers, and moved-slab invariants used privately across Dispatch.SlotOps submodules (never re-exported by CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Dispatch.SlotOps).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compGmAt_lt (metaBase U w N : ℕ) (mem : ℕ → ℕ) (idx : ℕ) :
compGmAt metaBase U w N mem idx < 2 ^ SuccinctBucket.globalPtrBits N

Every entry read via compGmAt fits in globalPtrBits N bits.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.tailPtr_read_bounds {U w N metaBase b j : ℕ} {s : Memory.State} (hN : 0 < N) (hb_pos : 0 < FeistelQuotient.bucketBits N) (hb : b < FeistelQuotient.numBuckets N) (hslot : Succinct.SlotStoreInv N (compGmAt metaBase U w N s.mem)) (hj_bc : j < Succinct.bCount N (compGmAt metaBase U w N s.mem) b) (hj_not_slab : ¬j < compGmAt metaBase U w N s.mem (Succinct.gmQIdx b) * SuccinctBucket.slabSize N) :
have gm := compGmAt metaBase U w N s.mem; have ptr_idx := Succinct.gmTailPtrBase N + (b * SuccinctBucket.tailCapPerBucket N + (j - gm (Succinct.gmQIdx b) * SuccinctBucket.slabSize N)); ptr_idx < SuccinctBucket.globalMetaLen N ∧ gm ptr_idx ≤ N - 1

Shared index and value bounds for reading a bucket's tail pointer at logical offset j ≥ gm (gmQIdx b) * slabSize N.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompGmFrame.refl {metaBase itemBase U V w N m_items : ℕ} (s : Memory.State) :
CompGmFrame metaBase itemBase U V w N m_items s s
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompGmFrame.trans {metaBase itemBase U V w N m_items : ℕ} {s₁ s₂ s₃ : Memory.State} (h₁ : CompGmFrame metaBase itemBase U V w N m_items s₁ s₂) (h₂ : CompGmFrame metaBase itemBase U V w N m_items s₂ s₃) :
CompGmFrame metaBase itemBase U V w N m_items s₁ s₃
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compGmFrame_writeCompGM_ite {metaBase itemBase U V w N m_items idx val : ℕ} (P : Prop) [Decidable P] (hw : 0 < w) (hitem : metaBase + offCompItems U w N ≤ itemBase) (hidx : P → idx < SuccinctBucket.globalMetaLen N) (hval : P → val < 2 ^ SuccinctBucket.globalPtrBits N) (s : Memory.State) :
have prog := if P then writeCompGMGenProg (((mkCompParams U V w N, metaBase), idx), val) else pure (); have s' := (Memory.spec 0).clientState s prog; CompGmFrame metaBase itemBase U V w N m_items s s' ∧ compGmAt metaBase U w N s'.mem = if P then Function.update (compGmAt metaBase U w N s.mem) idx val else compGmAt metaBase U w N s.mem

Pure bounds invariant on global metadata lookup gm for moving p_last into p_del.

Machine-state precondition bundling parameter constraints with PureMovedSlabInv.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.pureMovedSlabInv_congr {N p_del p₁ p₂ : ℕ} {gm₁ gm₂ : ℕ → ℕ} (hgm : gm₁ = gm₂) (hp : p₁ = p₂) (hm : PureMovedSlabInv N gm₁ p_del p₁) :
PureMovedSlabInv N gm₂ p_del p₂