Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.ResizableSuccinct.Accessors

Memory.Prog Bit-Slice and Dense Pair-Stream Primitives via realize #

This module implements overflow-free Memory.Prog leaf accessors for the compacted epoch layout and certifies every primitive with RealizesBounded .exact (¬ReadsWidth) via by realize:

Main definitions #

Main results #

References #

Section 1: Memory.Prog Simp Lemmas #

Section 2: Overflow-Free Bit-Slice and Packed-Array Primitives #

Read a k-bit slice starting at (base + wOff, bOff) in Memory.Prog.

Write val into the k-bit slice starting at (base + wOff, bOff) in Memory.Prog.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.runClient_state_writeBitSliceGenProg (base wOff bOff k w val : ℕ) (s : Memory.State) :
((Memory.spec 0).runClient s (writeBitSliceGenProg (((base, wOff, bOff), k, w), val))).2.1 = { mem := BitPackedArray.writeBitSlice base wOff bOff k w s.mem val, frontier := s.frontier }

Read readPacked (base + offset) k w s.mem idx in Memory.Prog with RealizesBounded.

Write writePacked (base + offset) k w s.mem idx val in Memory.Prog with RealizesBounded.

@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.runClient_state_writePackedCompGenProg (base offset k w idx val : ℕ) (s : Memory.State) :
((Memory.spec 0).runClient s (writePackedCompGenProg ((((base, offset), k, w), idx), val))).2.1 = { mem := BitPackedArray.writePacked (base + offset) k w s.mem idx val, frontier := s.frontier }

Section 3: Dense (quotient, value) Pair-Stream Memory.Prog Primitives #

Compute (wOffQ q_bits v_bits wVal d, bOffQ q_bits v_bits wVal d) overflow-free.

@[simp]

Entry precondition for dense (quotient, value) stream operations at itemBase.

Entry precondition for compacted metadata and circular-window operations at metaBase.

Read compQuotAt itemBase U V w N m_items s.mem d in Memory.Prog.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.clientResult_readCompQuotGenProg {U V w N m_items itemBase d : ℕ} (hd : d < m_items) (s : Memory.State) :
(Memory.spec 0).clientResult s (readCompQuotGenProg ((mkCompParams U V w N, itemBase), d)) = compQuotAt itemBase U V w N m_items s.mem d
@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.runClient_state_writeCompQuotGenProg (U V w N itemBase d q : ℕ) (s : Memory.State) :
((Memory.spec 0).runClient s (writeCompQuotGenProg (((mkCompParams U V w N, itemBase), d), q))).2.1 = { mem := writeCompQuot itemBase U V w N s.mem d q, frontier := s.frontier }

Read compValAt itemBase U V w N m_items s.mem d in Memory.Prog.

theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.clientResult_readCompValGenProg {U V w N m_items itemBase d : ℕ} (hd : d < m_items) (s : Memory.State) :
(Memory.spec 0).clientResult s (readCompValGenProg ((mkCompParams U V w N, itemBase), d)) = compValAt itemBase U V w N m_items s.mem d
@[simp]
theorem Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.runClient_state_writeCompValGenProg (U V w N itemBase d v : ℕ) (s : Memory.State) :
((Memory.spec 0).runClient s (writeCompValGenProg (((mkCompParams U V w N, itemBase), d), v))).2.1 = { mem := writeCompVal itemBase U V w N s.mem d v, frontier := s.frontier }

Section 4: Memory.ValidHistory Admissibility for Leaf Accessors #