Bit-Packed Memory Layout for Succinct Dictionaries #
This module defines the word-level memory layout and pure array extraction functions for the fixed-capacity succinct dynamic dictionary.
Memory layout ([base, base + totalSpace)) #
[base, base + h_space): Seeded 3-wise quotient hash table and seed (h_spacewords, instantiated inSuccinctHash.leanwithReducedKWise.TableRepandReducedKWise.SeedRepath_space = hashSpace U w n_max) mapping quotients inFin (2 ^ quotientBits U n_max)to micro-bucket hashes inFin (2 ^ totalMicroBits n_max).Quotients:packedWords n_max (quotientBits U n_max) wwords storingn_maxquotients ofquotientBits U n_maxbits (offQuot).Values:packedWords n_max (valBits V) wwords storingn_maxvalues ofvalBits Vbits (offVal).LocalMeta:9 * lmSubWords n_max wwords (9bit-packed sub-arrays oftotalMicroBuckets n_maxentries ofeffBucketPosBits n_maxbits each) storing per-bucket micro-bucket heads and doubly-linked listnext/prevpointers (offLM).GlobalMeta:packedWords (globalMetaLen n_max) (globalPtrBits n_max) wwords storing global counts, per-bucket slab/tail counts, direct slab directories, tail pointers, tail back-pointers, and the logical/physical slab pool bijection (offGM).
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.offQuot,offVal,offLM,lmSubWords,offLMSub,offGM,totalSpace: word offsets and total footprint of the succinct dictionary block.Cslib.DataStructure.Dictionary.WordRAM.Succinct.quotAt,valAt,lmAt,gmAt: pure extraction functions forQuotients,Values,LocalMeta, andGlobalMeta.
Main results #
totalSpace_le_succinctWords:totalSpace U V w n_max h_spaceis at mostDynamic.succinctWords 79 (35 + h_space) U V w n_max.quotAt_lt,valAt_lt,lmAt_lt,gmAt_lt: bit-width bounds on extracted array entries.quotAt_zero_of_init,valAt_zero_of_init,lmAt_zero_of_init,gmAt_zero_of_init: extracted arrays are identically zero on zero-initialized table memory.arrays_congr_of_eq_on: extracted arrays depend only on words inside[base + h_space, base + totalSpace U V w n_max h_space).
Section 1: Array offsets and extraction functions #
Word offset of Quotients relative to base.
Word offset of Values relative to base.
Word offset of LocalMeta relative to base.
Word size of each of the 9 LocalMeta sub-arrays of length totalMicroBuckets n_max.
Word offset of the c-th LocalMeta sub-array (c < 9) relative to base.
Word offset of GlobalMeta relative to base.
Total word footprint of the succinct dictionary block starting at base.
totalSpace is bounded by Dynamic.succinctWords 79 (35 + h_space) U V w n_max for all w.
On zero-initialized table memory [base + h_space, base + totalSpace), quotAt is identically
zero.
On zero-initialized table memory [base + h_space, base + totalSpace), valAt is identically
zero.
On zero-initialized table memory [base + h_space, base + totalSpace), lmAt is identically
zero.
On zero-initialized table memory [base + h_space, base + totalSpace), gmAt is identically
zero.
If two memories agree on [base + h_space, base + totalSpace), they have identical quotAt,
valAt, lmAt, and gmAt.