Metadata Frame Laws, Circular-Window Effects, and Compacted Slot Resolution #
This module connects the low-level Memory.Prog primitives in WindowOps.lean to the pure
metadata and circular-window invariants in Compaction.lean and SuccinctHash.lean:
- cross-region non-interference and
Function.updatelaws forcompLmAt,compGmAt,compTDAt,compDTAt,compQuotAt, andcompValAt; - state-transition specifications for
winGrowRightGenProg,winGrowLeftGenProg,winShrinkRightGenProg, andwinShrinkLeftGenProg; - register-width bounds
fits_mkCompParamsandfits_const_of_offCompItems; - compacted slot-resolution and owner-bucket recovery operations (
readCompBucketCountGenProg,recoverOwnerBucketGenProg) and mathematical key reconstructionreconstructKeyAt(whose bijectionreconstructKeyAt_specis proved inInEpoch.lean).
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.readCompBucketCountGenProg,recoverOwnerBucketGenProg: compacted metadata accessors.Cslib.DataStructure.Dictionary.WordRAM.ResizableSuccinct.reconstructKeyAt: mathematical key reconstruction at dense indexd < n.
Main results #
winGrowRightGenProg_effect,winGrowLeftGenProg_effect,winShrinkRightGenProg_effect,winShrinkLeftGenProg_effect: circular-window effect laws onMemory.State.fits_mkCompParams: all 36 words ofmkCompParams U V w Nfit inwbits.
References #
Section 1: Cross-Region Congruence and Pure Function.update Frame Laws #
Updating LocalMeta[c, idx] := val updates compLmAt via Function.update and preserves
all other metadata views, dense item views (metaBase + offCompItems ≤ itemBase), and outside
memory.
Updating GlobalMeta[idx] := val updates compGmAt via Function.update and preserves all
other views and outside memory.
Updating TailToDense[t] := val updates compTDAt via Function.update and preserves all
other views and outside memory.
Updating DenseToTail[r] := val updates compDTAt via Function.update and preserves all
other views and outside memory.
Writing a dense quotient at itemBase (metaBase + offCompItems ≤ itemBase) preserves all
metadata views at metaBase.
Writing a dense value at itemBase (metaBase + offCompItems ≤ itemBase) preserves all
metadata views at metaBase.
Section 2: Circular-Window State-Transition Specifications #
Section 3: Register-Width Bounds (fits_mkCompParams) #
Every entry of mkCompParams U V w N fits in a w-bit word whenever 0 < w, 0 < N,
N ≤ U < 2 ^ w, V ≤ 2 ^ w, and Fits w (metaBase + offCompItems U w N).
Section 4: Compacted Slot Resolution, Owner-Bucket Recovery, and Key Reconstruction #
Read bCount N gm b at metaBase in Memory.Prog (¬ReadsWidth).
Precondition for reading the count of items in bucket b from compacted metadata.
Recover ownerBucketOfDense N gm dt d in $O(1)$ steps (Memory.Prog, ¬ReadsWidth).
Precondition for recovering the owner bucket of dense item d.
Reconstruct the key u stored at dense index d < n in (metaBase, itemBase).