Documentation

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

Ghost DictEnvGen, CompEpochEnv, FixedCoupled Bridges, and CompGmFrame #

Provides ghost fixed-capacity envelope certificates at (base = 0, ghostW w), the concrete epoch envelope CompEpochEnv, FixedCoupled dense-to-physical lookup and in-place value-update bridges, and the GlobalMeta-only frame relation CompGmFrame with generic ValidProg bind helpers.

Main definitions #

Main results #

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ghostDictParamsWf {U V w N : ℕ} (_hw : 0 < w) (hnU : N ≤ U) (hU : U < 2 ^ w) (hV : V ≤ 2 ^ w) :

At ghost word width ghostW w = w + 16, DictParamsWf U V (ghostW w) N holds for all N ≤ U < 2 ^ w and V ≤ 2 ^ w.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.ghostDictEnvGen {U V w N : ℕ} (hw : 0 < w) (hnU : N ≤ U) (hU : U < 2 ^ w) (hV : V ≤ 2 ^ w) :

At base = 0 and ghostW w = w + 16, DictEnvGen holds unconditionally for any 0 < w, N ≤ U < 2 ^ w, and V ≤ 2 ^ w (totalSpace < 2 ^ (w + 16)).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.FixedCoupled.tailDenseInv {metaBase itemBase U V w N : ℕ} {s_fix s : Memory.State} (hcpl : FixedCoupled metaBase itemBase U V w N s_fix s) (hb_pos : 0 < FeistelQuotient.bucketBits N) :
TailDenseInv N (compGmAt metaBase U w N s.mem 0) (compGmAt metaBase U w N s.mem 1) (compTDAt metaBase U w N s.mem) (compDTAt metaBase U w N s.mem)

Extract TailDenseInv from FixedCoupled.

Concrete epoch parameter and frontier envelope at (metaBase, itemBase) covering m_items dense (quotient, value) slots.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompEpochEnv.meta_le_frontier {U V w N metaBase itemBase m_items : ℕ} {s : Memory.State} (henv : CompEpochEnv U V w N metaBase itemBase m_items s) :
metaBase + offCompItems U w N ≤ s.frontier
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompEpochEnv.compMetaEnv {U V w N metaBase itemBase m_items : ℕ} {s : Memory.State} (henv : CompEpochEnv U V w N metaBase itemBase m_items s) :
CompMetaEnv w (mkCompParams U V w N) metaBase s
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompEpochEnv.compItemEnv {U V w N metaBase itemBase m_items : ℕ} {s : Memory.State} (henv : CompEpochEnv U V w N metaBase itemBase m_items s) :
CompItemEnv w (mkCompParams U V w N) itemBase m_items s
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompEpochEnv.of_mem_eq {U V w N metaBase itemBase m_items : ℕ} {s s' : Memory.State} (henv : CompEpochEnv U V w N metaBase itemBase m_items s) (hfr : s.frontier ≤ s'.frontier) :
CompEpochEnv U V w N metaBase itemBase m_items s'
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.FixedCoupled.denseOfPhysPre_slotOf {metaBase itemBase U V w N m_items b j : ℕ} {s_fix s : Memory.State} (hcpl : FixedCoupled metaBase itemBase U V w N s_fix s) (henv : CompEpochEnv U V w N metaBase itemBase m_items s) (hslot : Succinct.SlotStoreInv N (compGmAt metaBase U w N s.mem)) (hb : b < FeistelQuotient.numBuckets N) (hj : j < Succinct.bCount N (compGmAt metaBase U w N s.mem) b) :
DenseOfPhysPre w ((mkCompParams U V w N, metaBase), Succinct.slotOf N (compGmAt metaBase U w N s.mem) b j) s

Establish DenseOfPhysPre at g = slotOf N gm b j for any b < numBuckets N and j < bCount N gm b under FixedCoupled and CompEpochEnv.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.FixedCoupled.quot_val_at_slotOf {metaBase itemBase U V w N m_items b j : ℕ} {s_fix s : Memory.State} (hcpl : FixedCoupled metaBase itemBase U V w N s_fix s) (hslot : Succinct.SlotStoreInv N (compGmAt metaBase U w N s.mem)) (hm : epochTotalSlots N (compGmAt metaBase U w N s.mem) ≤ m_items) (hb : b < FeistelQuotient.numBuckets N) (hj : j < Succinct.bCount N (compGmAt metaBase U w N s.mem) b) :
have gm := compGmAt metaBase U w N s.mem; have td := compTDAt metaBase U w N s.mem; have g := Succinct.slotOf N gm b j; have d := denseOfPhys N gm td g; d < epochTotalSlots N gm ∧ compQuotAt itemBase U V w N m_items s.mem d = Succinct.quotAt 0 U (ghostW w) N (epochHashSpace U (ghostW w) N) s_fix.mem g ∧ compValAt itemBase U V w N m_items s.mem d = Succinct.valAt 0 U V (ghostW w) N (epochHashSpace U (ghostW w) N) s_fix.mem g

Lookup agreement at d = denseOfPhys N gm td (slotOf N gm b j) under FixedCoupled.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.FixedCoupled.writeVal_slotOf {metaBase itemBase U V w N b j v : ℕ} {s_fix s : Memory.State} (hw : 0 < w) (hitem : metaBase + offCompItems U w N ≤ itemBase) (hcpl : FixedCoupled metaBase itemBase U V w N s_fix s) (hslot : Succinct.SlotStoreInv N (compGmAt metaBase U w N s.mem)) (hb : b < FeistelQuotient.numBuckets N) (hj : j < Succinct.bCount N (compGmAt metaBase U w N s.mem) b) (hv_lt : v < 2 ^ FeistelQuotient.valBits V) :
have gm := compGmAt metaBase U w N s.mem; have td := compTDAt metaBase U w N s.mem; have g := Succinct.slotOf N gm b j; have d := denseOfPhys N gm td g; have s' := { mem := writeCompVal itemBase U V w N s.mem d v, frontier := s.frontier }; have s_fix' := (Memory.spec 0).clientState s_fix (Succinct.writeValProg U V (ghostW w) N (epochHashSpace U (ghostW w) N) ((0, g), v)); FixedCoupled metaBase itemBase U V w N s_fix' s'

In-place value update at slotOf N gm b j preserves FixedCoupled.

structure Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.CompGmFrame (metaBase itemBase U V w N m_items : ℕ) (s s' : Memory.State) :

Frame relation for operations that write exclusively to the compacted GlobalMeta slice [metaBase + offCompGM U w N, metaBase + offTailToDense U w N).

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.compGmFrame_writeCompGMGenProg {metaBase itemBase U V w N m_items idx val : ℕ} (hw : 0 < w) (hitem : metaBase + offCompItems U w N ≤ itemBase) (hidx : idx < SuccinctBucket.globalMetaLen N) (hval : val < 2 ^ SuccinctBucket.globalPtrBits N) (s : Memory.State) :
have s' := (Memory.spec 0).clientState s (writeCompGMGenProg (((mkCompParams U V w N, metaBase), idx), val)); CompGmFrame metaBase itemBase U V w N m_items s s' ∧ compGmAt metaBase U w N s'.mem = Function.update (compGmAt metaBase U w N s.mem) idx val
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.validProg_bind_of_eq {α β : Type} {w : ℕ} {s : Memory.State} {p : Memory.Prog α} {k : α → Memory.Prog β} {a : α} (hp : Succinct.ValidProg w 0 s p) (hres : (Memory.spec 0).clientResult s p = a) (hk : ∀ (s' : Memory.State), s' = (Memory.spec 0).clientState s p → Succinct.ValidProg w 0 s' (k a)) :