Memory.Prog Envelopes, SWAR Word-Lane Subroutines, and B+-Tree Slice Primitives #
This module establishes the parameter-free runtime envelopes (WhpLargeEnv, WhpLargeEnvGen,
WhpSmallEnv, WhpSmallEnvGen), Succinct.ValidProg primitive admissibility lemmas, packed-array
safety projections, SWAR word-lane Memory.Prog subroutines (laneGetGenProg,
wordTakeLowGenProg, wordDropLowGenProg, wordInsertAtGenProg, wordDeleteAtGenProg,
wordUpdateAtGenProg, swarRankGenProg, splitFullNodeGenProg), and packed B+-tree slice/node
accessors (readSliceHeaderGenProg, writeSliceAllocGenProg, resetBTreeSliceGenProg,
readBTreeNodeGenProg, writeBTreeNodeGenProg), all certified over Basis.exact with zero local
work via realize.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv,WhpLargeEnvGen,WhpSmallEnv,WhpSmallEnvGen: runtime parameter envelopes.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.swarRankGenProg,splitFullNodeGenProg,wordInsertAtGenProg,wordDeleteAtGenProg,wordUpdateAtGenProg: certifiedO(1)SWARMemory.Proghelpers.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readSliceHeaderGenProg,writeSliceAllocGenProg,resetBTreeSliceGenProg,readBTreeNodeGenProg,writeBTreeNodeGenProg: packed B+-tree slice header and nodeMemory.Progaccessors.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.totalBTreeNodesWhp_le_n_max:totalBTreeNodesWhp n_max ≤ n_maxwheneverwhpThreshold c ≤ n_max.Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.realizes_swarRankGen,realizes_splitFullNodeGen,realizes_readBTreeNodeGen,realizes_writeBTreeNodeGen,realizes_resetBTreeSliceGen: parameter-freeRealizes .exactcertificates.
Section 1: Succinct.ValidProg Primitive Lemmas and Runtime Envelopes #
Entry admissibility envelope in the small regime (n_max < whpThreshold c).
Parameter-free small-regime envelope for cp : WhpCoreParams.
Entry admissibility envelope in the large regime (whpThreshold c ≤ n_max).
Parameter-free large-regime envelope for cp : WhpCoreParams.
When whpThreshold c ≤ n_max, 16 * numBucketsWhp n_max ≤ n_max.
When whpThreshold c ≤ n_max, totalBTreeNodesWhp n_max ≤ n_max.
Helper producing the Realizes precondition of readPackedGenProg / writePackedGenProg
for any array segment inside largeSpaceWhp.
Full offset bound ladder for largeSpaceWhp segments.
Section 2: Certified SWAR Word-Lane Memory.Prog Subroutines #
Parameter-free laneGet (d = ((W, word), j)).
Parameter-free wordTakeLow (d = ((W, j), word)).
Parameter-free wordDropLow (d = ((W, j), word)).
Parameter-free wordDeleteAt (d = ((W, j), word)).
Precondition for swarRankGenProg (d = (cp, ((m, q), keysWord))).
Parameter-free swarRank (d = (cp, ((m, q), keysWord))).
Parameter-free splitFullNode (d = (cp, (metaW, (keysW, valsW)))), returning
((leftMeta, (leftKeys, leftVals)), (sep, (rightMeta, (rightKeys, rightVals)))).
Section 3: Packed B+-Tree Slice Header and Node Memory.Prog Primitives #
Read (alloc, root) of slice sIdx = d.2 at base = d.1.2.
Write alloc := d.2 (≤ wpNSlice) for slice sIdx = d.1.2.
Reset slice sIdx = d.2 to zeroBTreeSlice (alloc := 0, root := 0).
Read (metaWord, (keysWord, valsWord)) of node u = d.2 in slice sIdx = d.1.2.
Writing an updated node nd' at an already-allocated index u < sl.alloc preserves
BTreeSliceMemRep for { sl with nodes := Function.update sl.nodes u nd' } and frames all other
slices and non-B+-tree memory words.