Word-granular resizable memory specification #
Word-granular resizable memory specification (Cslib.DataStructure.Memory.Resizable) accompanying
the Resizable Word RAM (Cslib.WordRAM.Resizable), modeling the dynamically resizable w-bit
word memory of [LLYZ23a], Section 2.1, [LLYZ24], Section 3.2, and
[KLZ26], Section 5.1 (termed the "virtual memory (VM) model" in those papers, with
1-indexed addresses [1..M] mapped here to 0-indexed [0, s.frontier)).
A data structure operating over word-granular resizable memory owns a 0-indexed active prefix
[0, s.frontier) of w-bit words in s : Memory.State, where s.frontier is the current number
of allocated words. In addition to reading and writing allocated words (a < s.frontier), a client
may grow (grow k, growDirty k) or shrink (shrink k) the active prefix by whole words.
Main definitions #
Cslib.DataStructure.Memory.Resizable.Op:read,write,grow,growDirty, andshrink.Cslib.DataStructure.Memory.Resizable.demonicStep,Cslib.DataStructure.Memory.Resizable.demonicSpec: relational demonic specification at word widthw, zero-initializing[s.frontier, s.frontier + k)ongrowand allowing arbitraryw-bit initial words in[s.frontier, s.frontier + k)ongrowDirty([KLZ26], Section 5.1, Footnote 10).Cslib.DataStructure.Memory.Resizable.step,Cslib.DataStructure.Memory.Resizable.spec: deterministic zero-initialized specification (HasStepFn) at word widthw.Cslib.DataStructure.Memory.Resizable.specRefinesDemonicSpec,Cslib.DataStructure.Memory.Resizable.spec_refines_demonicSpec: refinement certificateRefinement (demonicSpec w) (spec w)and itsPropwitness.Cslib.DataStructure.Memory.Resizable.charge,Cslib.DataStructure.Memory.Resizable.spaceWords,Cslib.DataStructure.Memory.Resizable.spaceBits,Cslib.DataStructure.Memory.Resizable.UnchangedOutside: operation cost, live word/bit space measures, and resize-aware frame condition.
Main results #
Cslib.DataStructure.Memory.Resizable.canonical_step,Cslib.DataStructure.Memory.Resizable.canonical_demonicStep: admissible transitions preserveWellFormed wandZeroAbove.Cslib.DataStructure.Memory.Resizable.demonicStep_growDirty_of_demonicGrow: machine-levelWordRAM.Resizable.DemonicGrowtransitions satisfydemonicStep won.growDirty.Cslib.DataStructure.Memory.Resizable.Block.realizes_of_unchangedOutside:UnchangedOutsidepreservesBlock.Realizesacross resizes.
References #
- [LLYZ23a] Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic
"Succincter", FOCS 2023, pp. 1715–1733 (
arXiv:2309.12950v1, Section 1.3, PDF p. 4 / printed p. 3, and Section 2.1, PDF pp. 6–7 / printed pp. 5–6). - [LLYZ24] Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, Dynamic
Dictionary with Subconstant Wasted Bits per Key, SODA 2024 (
arXiv:2310.20536v1, Section 3.2, PDF pp. 9–10 / printed pp. 8–9). - [KLZ26] William Kuszmaul, Jingxun Liang, and Renfei Zhou, Succinct Dynamic
Rank/Select: Bypassing the Tree-Structure Bottleneck, SODA 2026 (
arXiv:2510.19175v1, Section 5.1, PDF pp. 16–20 / printed pp. 15–19; Theorem 5.2(6) and Footnote 10, PDF p. 18 / printed p. 17).
Empty state and zero-above invariant #
The empty memory state with all cells zeroed and frontier = 0.
Every address at or above s.frontier holds 0.
Operations, deterministic spec w, and relational demonicSpec w #
Operations of a word-granular resizable memory ([LLYZ23a], Section 2.1; [KLZ26], Section 5.1).
- read (a : ℕ) : Op
Read the
w-bit word at addressa < frontier. - write (a v : ℕ) : Op
Write the
w-bit wordvat addressa < frontier. - grow (k : ℕ) : Op
- growDirty (k : ℕ) : Op
Grow
[0, frontier)bykwords without caller zero-fill (arbitraryw-bit words indemonicSpec w, zeroed in canonicalspec w), returning oldfrontier. - shrink (k : ℕ) : Op
Shrink
[0, frontier)byk ≤ frontierwords, clearing[frontier - k, frontier).
Instances For
Result type of each resizable-memory operation.
Deterministic zero-initialized transition function on Memory.State (the canonical instance of
demonicStep w that chooses 0 for newly allocated growDirty words as well as grow words).
Deterministic zero-initialized word-granular resizable memory specification
at word width w.
Admissibility of a concrete history on Resizable.spec w is decidable.
Demonic relational transition at word width w: .grow k zero-initializes
[s.frontier, s.frontier + k), whereas .growDirty k permits any post-state s' preserving
s.mem outside [s.frontier, s.frontier + k) and placing arbitrary w-bit words in
[s.frontier, s.frontier + k) ([KuszmaulLiangZhou2026], Section 5.1, Footnote 10).
Demonic relational word-granular resizable memory specification at word width w.
Effectful program primitives #
A program over the word-granular resizable memory oracle.
Read the word at address a.
Write v to address a.
Grow the active prefix by k words without caller zero-fill (arbitrary w-bit words in
demonicSpec w, zeroed in canonical spec w), returning the old frontier.
Shrink the active prefix by k words.
Allocate a single zeroed word at frontier.
Release a single word from frontier.
Well-formedness and canonical state preservation #
Every valid operation preserves WellFormed w.
Every valid transition of demonicStep w preserves WellFormed w.
Every valid transition of demonicStep w preserves ZeroAbove.
Every valid transition of demonicStep w preserves Canonical w.
Refinement specRefinesDemonicSpec #
Every deterministic step transition satisfies demonicStep w.
Any machine-level WordRAM.Resizable.DemonicGrow transition from a ZeroAbove state satisfies
demonicStep w s (.growDirty k).
The zero-initialized specification spec w refines demonicSpec w over the identity state
map: every client verified against demonicSpec w is valid and has its behavior included in
demonicSpec w when executed on spec w.
Prop-valued witness that spec w refines demonicSpec w.
Cost, live space measures, and resize-aware frame condition #
Current allocated space of s in w-bit words (s.frontier).
Total space in bits of s.frontier allocated words plus a spillover integer in [0, K)
([LiLiangYuZhou2023Succincter], Section 1.3, PDF p. 4 / printed p. 3; [KLZ26],
Section 5.1, PDF p. 17 / printed p. 16). Here Nat.clog 2 K = ⌈log₂ K⌉ rounds the papers'
real-valued lg K up to ℕ (adding < 1 bit of slack when K is not a power of two).
If a block b lies below min s.frontier s'.frontier and is disjoint from W, then
UnchangedOutside s s' W preserves b.Realizes.