Documentation

CslibFrontier.DataStructure.Dictionary.WordRAM.SuccinctWhpSwarProg

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 #

Main results #

Section 1: Succinct.ValidProg Primitive Lemmas and Runtime Envelopes #

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.validProg_readPacked {w F base offset N k idx : ℕ} {s : Memory.State} (hw : 0 < w) (hidx : idx < N) (ha : base + offset + BitPackedArray.packedWords N k w ≤ F) :
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.validProg_writePacked {w F base offset N k idx val : ℕ} {s : Memory.State} (hw : 0 < w) (hkw : k ≤ w) (hidx : idx < N) (ha : base + offset + BitPackedArray.packedWords N k w ≤ F) :
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.clientState_writePackedGen {w' : ℕ} (base offset k w idx val : ℕ) (s : Memory.State) :
(Memory.spec w').clientState s (BitPackedArray.writePackedGenProg ((((base, offset), k, w), idx), val)) = { mem := BitPackedArray.writePacked (base + offset) k w s.mem idx val, frontier := s.frontier }
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.mul_add_lt_mul_bound {A B a b : ℕ} (ha : a < A) (hb : b < B) :
a * B + b < A * B
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.to_true_exists {w : ℕ} {P : ℕ → Prop} (h : ∃ (N : ℕ), w = w ∧ P N) :
∃ (N : ℕ), True ∧ P N

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.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.fits_largeSpace {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) :
WordRAM.Fits w (base + SuccinctWhp.largeSpaceWhp c U V w₀ n_max)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.log_lt_w {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) :
Nat.log 2 n_max < w
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.two_le_w {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) :
2 ≤ w
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.three_le_w {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) :
3 ≤ w
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.fits_of_le_n_max {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {x : ℕ} (hx : x ≤ n_max) :
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.fits_const {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {K : ℕ} (hK : K ≤ 1024) :
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.fits_hdr_addr {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {off : ℕ} (hoff : off < 32) :
WordRAM.Fits w (base + off)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.packed_safe_of_le {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {off N k idx : ℕ} (hk : k ≤ w₀) (hidx : idx < N) (hend : off + BitPackedArray.packedWords N k w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max) :
∃ (N' : ℕ), w = w₀ ∧ 0 < w ∧ k ≤ w ∧ idx < N' ∧ WordRAM.Fits w (base + off + BitPackedArray.packedWords N' k w)

Helper producing the Realizes precondition of readPackedGenProg / writePackedGenProg for any array segment inside largeSpaceWhp.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.seg_end_le (c U V w₀ n_max : ℕ) :
offQuotWhp c w₀ n_max + BitPackedArray.packedWords n_max (SuccinctWhp.quotBitsWhp U n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offValWhp c U w₀ n_max + BitPackedArray.packedWords n_max (FeistelQuotient.valBits V) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offPermAct c U V w₀ n_max + BitPackedArray.packedWords n_max (12 * Dynamic.logLogFactor n_max + 4) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offLocState c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.numBucketsWhp n_max * SuccinctWhp.totalLocalCoordsWhp n_max) 2 w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offBktMeta c U V w₀ n_max + BitPackedArray.packedWords (16 * SuccinctWhp.numBucketsWhp n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offFbStart c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.numBucketsWhp n_max + 1) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offBackPtr c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.numBucketsWhp n_max * SuccinctWhp.capBackWhp n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offPoolFreeStack c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.poolSizeWhp n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offPoolOwner c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.poolSizeWhp n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offBtMeta c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.totalBTreeNodesWhp n_max) (SuccinctWhp.nodeMetaBitsWhp n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offBtKeys c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.totalBTreeNodesWhp n_max) (SuccinctWhp.keysWordBitsWhp n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offBtVals c U V w₀ n_max + BitPackedArray.packedWords (SuccinctWhp.totalBTreeNodesWhp n_max) (SuccinctWhp.valsWordBitsWhp n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieChild0 c U V w₀ n_max + BitPackedArray.packedWords (trieChildEntriesWhp c n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieChild1 c U V w₀ n_max + BitPackedArray.packedWords (trieChildEntriesWhp c n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieMeta0 c U V w₀ n_max + BitPackedArray.packedWords (6 * SuccinctWhp.maxTrieNodesWhp c n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieMeta1 c U V w₀ n_max + BitPackedArray.packedWords (6 * SuccinctWhp.maxTrieNodesWhp c n_max) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieItems0 c U V w₀ n_max + BitPackedArray.packedWords (6 * SuccinctWhp.qEpochWhp n_max + 6) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max ∧ offTrieItems1 c U V w₀ n_max + BitPackedArray.packedWords (6 * SuccinctWhp.qEpochWhp n_max + 6) (SuccinctBucket.globalPtrBits n_max) w₀ ≤ SuccinctWhp.largeSpaceWhp c U V w₀ n_max

Full offset bound ladder for largeSpaceWhp segments.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.quot_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctWhp.quotBitsWhp U n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offQuotWhp c w₀ n_max + BitPackedArray.packedWords N (SuccinctWhp.quotBitsWhp U n_max) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.val_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ FeistelQuotient.valBits V ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offValWhp c U w₀ n_max + BitPackedArray.packedWords N (FeistelQuotient.valBits V) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.fbStart_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < SuccinctWhp.numBucketsWhp n_max + 1) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctBucket.globalPtrBits n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offFbStart c U V w₀ n_max + BitPackedArray.packedWords N (SuccinctBucket.globalPtrBits n_max) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.bktMeta_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < 16 * SuccinctWhp.numBucketsWhp n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctBucket.globalPtrBits n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offBktMeta c U V w₀ n_max + BitPackedArray.packedWords N (SuccinctBucket.globalPtrBits n_max) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.btMeta_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < SuccinctWhp.totalBTreeNodesWhp n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctWhp.nodeMetaBitsWhp n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offBtMeta c U V w₀ n_max + BitPackedArray.packedWords N (SuccinctWhp.nodeMetaBitsWhp n_max) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.btKeys_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < SuccinctWhp.totalBTreeNodesWhp n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctWhp.keysWordBitsWhp n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offBtKeys c U V w₀ n_max + BitPackedArray.packedWords N (SuccinctWhp.keysWordBitsWhp n_max) w)
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.WhpLargeEnv.btVals_safe {c U V w₀ n_max w base : ℕ} (h : WhpLargeEnv c U V w₀ n_max w base) {idx : ℕ} (hidx : idx < SuccinctWhp.totalBTreeNodesWhp n_max) :
∃ (N : ℕ), w = w₀ ∧ 0 < w ∧ SuccinctWhp.valsWordBitsWhp n_max ≤ w ∧ idx < N ∧ WordRAM.Fits w (base + offBtVals c U V w₀ n_max + BitPackedArray.packedWords N (SuccinctWhp.valsWordBitsWhp n_max) w)

Section 2: Certified SWAR Word-Lane Memory.Prog Subroutines #

Parameter-free wordInsertAt (d = (((W, j), v), word)).

Parameter-free wordUpdateAt (d = (((W, j), v), word)).

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 #

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readSliceHeaderGenProg_spec {c U V w n_max base sIdx : ℕ} {sl : SuccinctWhp.BTreeSlice} {s : Memory.State} (hth : SuccinctWhp.whpThreshold c ≤ n_max) (hw : 0 < w) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) (hrep : BTreeSliceMemRep base c U V w n_max sIdx sl s.mem) :
have prog := readSliceHeaderGenProg ((mkWhpCoreParams c U V w n_max, base), sIdx); (Memory.spec 0).clientState s prog = s ∧ (Memory.spec 0).clientResult s prog = (sl.alloc, sl.root) ∧ WordRAM.Realization.memoryCost prog s = 4 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.writeSliceAllocGenProg_spec {c U V w n_max base sIdx newAlloc : ℕ} {s : Memory.State} (hth : SuccinctWhp.whpThreshold c ≤ n_max) (hw : 0 < w) (hnU : n_max ≤ U) (hU : WordRAM.Fits w U) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) :
have prog := writeSliceAllocGenProg (((mkWhpCoreParams c U V w n_max, base), sIdx), newAlloc); have idxA := 16 * (sIdx / 3) + 10 + 2 * (sIdx % 3); (Memory.spec 0).clientState s prog = { mem := BitPackedArray.writePacked (base + offBktMeta c U V w n_max) (SuccinctBucket.globalPtrBits n_max) w s.mem idxA newAlloc, frontier := s.frontier } ∧ WordRAM.Realization.memoryCost prog s = 4 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog

Reset slice sIdx = d.2 to zeroBTreeSlice (alloc := 0, root := 0).

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.resetBTreeSliceGenProg_spec {c U V w n_max base sIdx : ℕ} {s : Memory.State} (hth : SuccinctWhp.whpThreshold c ≤ n_max) (hw : 0 < w) (hnU : n_max ≤ U) (hU : WordRAM.Fits w U) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) :
have prog := resetBTreeSliceGenProg ((mkWhpCoreParams c U V w n_max, base), sIdx); have s' := (Memory.spec 0).clientState s prog; s'.frontier = s.frontier ∧ WordRAM.Realization.memoryCost prog s = 8 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ BTreeSliceMemRep base c U V w n_max sIdx SuccinctWhp.zeroBTreeSlice s'.mem ∧ (∀ sIdx' < 3 * SuccinctWhp.numBucketsWhp n_max, sIdx' ≠ sIdx → ∀ (sl' : SuccinctWhp.BTreeSlice), BTreeSliceMemRep base c U V w n_max sIdx' sl' s.mem → BTreeSliceMemRep base c U V w n_max sIdx' sl' s'.mem) ∧ (∀ idx < 16 * SuccinctWhp.numBucketsWhp n_max, idx ≠ 16 * (sIdx / 3) + 10 + 2 * (sIdx % 3) → idx ≠ 16 * (sIdx / 3) + 11 + 2 * (sIdx % 3) → BitPackedArray.readPacked (base + offBktMeta c U V w n_max) (SuccinctBucket.globalPtrBits n_max) w s'.mem idx = BitPackedArray.readPacked (base + offBktMeta c U V w n_max) (SuccinctBucket.globalPtrBits n_max) w s.mem idx) ∧ ∀ (a : ℕ), a < base + offBktMeta c U V w n_max ∨ base + offFbStart c U V w n_max ≤ a → s'.mem a = s.mem a

Read (metaWord, (keysWord, valsWord)) of node u = d.2 in slice sIdx = d.1.2.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.readBTreeNodeGenProg_spec {c U V w n_max base sIdx u : ℕ} {sl : SuccinctWhp.BTreeSlice} {s : Memory.State} (hth : SuccinctWhp.whpThreshold c ≤ n_max) (hw : 0 < w) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) (hu : u < sl.alloc) (hrep : BTreeSliceMemRep base c U V w n_max sIdx sl s.mem) :

Write (metaWord, (keysWord, valsWord)) = d.2 to node u = d.1.2 in slice sIdx = d.1.1.2.

theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.writeBTreeNodeGenProg_spec {c U V w n_max base sIdx u : ℕ} {nd : SuccinctWhp.BTreeNode} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) (hu : u < SuccinctWhp.nSliceWhp n_max) (hm_lt : nd.metaWord < 2 ^ SuccinctWhp.nodeMetaBitsWhp n_max) (hk_lt : nd.keysWord < 2 ^ SuccinctWhp.keysWordBitsWhp n_max) (hv_lt : nd.valsWord < 2 ^ SuccinctWhp.valsWordBitsWhp n_max) :
have prog := writeBTreeNodeGenProg ((((mkWhpCoreParams c U V w n_max, base), sIdx), u), nd.metaWord, nd.keysWord, nd.valsWord); have s' := (Memory.spec 0).clientState s prog; s'.frontier = s.frontier ∧ WordRAM.Realization.memoryCost prog s = 12 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ (∀ (sl : SuccinctWhp.BTreeSlice), sl.alloc ≤ SuccinctWhp.nSliceWhp n_max → (∀ v < sl.alloc, v ≠ u → have idx_v := sIdx * SuccinctWhp.nSliceWhp n_max + v; BitPackedArray.readPacked (base + offBtMeta c U V w n_max) (SuccinctWhp.nodeMetaBitsWhp n_max) w s.mem idx_v = (sl.nodes v).metaWord ∧ BitPackedArray.readPacked (base + offBtKeys c U V w n_max) (SuccinctWhp.keysWordBitsWhp n_max) w s.mem idx_v = (sl.nodes v).keysWord ∧ BitPackedArray.readPacked (base + offBtVals c U V w n_max) (SuccinctWhp.valsWordBitsWhp n_max) w s.mem idx_v = (sl.nodes v).valsWord) → ∀ v < sl.alloc, have idx_v := sIdx * SuccinctWhp.nSliceWhp n_max + v; have nd_v := Function.update sl.nodes u nd v; BitPackedArray.readPacked (base + offBtMeta c U V w n_max) (SuccinctWhp.nodeMetaBitsWhp n_max) w s'.mem idx_v = nd_v.metaWord ∧ BitPackedArray.readPacked (base + offBtKeys c U V w n_max) (SuccinctWhp.keysWordBitsWhp n_max) w s'.mem idx_v = nd_v.keysWord ∧ BitPackedArray.readPacked (base + offBtVals c U V w n_max) (SuccinctWhp.valsWordBitsWhp n_max) w s'.mem idx_v = nd_v.valsWord) ∧ (∀ sIdx' < 3 * SuccinctWhp.numBucketsWhp n_max, sIdx' ≠ sIdx → ∀ (sl' : SuccinctWhp.BTreeSlice), BTreeSliceMemRep base c U V w n_max sIdx' sl' s.mem → BTreeSliceMemRep base c U V w n_max sIdx' sl' s'.mem) ∧ ∀ (a : ℕ), a < base + offBtMeta c U V w n_max ∨ base + offTrieChild0 c U V w n_max ≤ a → s'.mem a = s.mem a
theorem Cslib.DataStructure.Dictionary.WordRAM.SuccinctWhp.writeBTreeNodeGenProg_inPlace_sliceRep {c U V w n_max base sIdx u : ℕ} {sl : SuccinctWhp.BTreeSlice} {nd' : SuccinctWhp.BTreeNode} {s : Memory.State} (henv : WhpLargeEnv c U V w n_max w base) (hsIdx : sIdx < 3 * SuccinctWhp.numBucketsWhp n_max) (hrep : BTreeSliceMemRep base c U V w n_max sIdx sl s.mem) (hu : u < sl.alloc) (hm_lt : nd'.metaWord < 2 ^ SuccinctWhp.nodeMetaBitsWhp n_max) (hk_lt : nd'.keysWord < 2 ^ SuccinctWhp.keysWordBitsWhp n_max) (hv_lt : nd'.valsWord < 2 ^ SuccinctWhp.valsWordBitsWhp n_max) :
have prog := writeBTreeNodeGenProg ((((mkWhpCoreParams c U V w n_max, base), sIdx), u), nd'.metaWord, nd'.keysWord, nd'.valsWord); have s' := (Memory.spec 0).clientState s prog; s'.frontier = s.frontier ∧ WordRAM.Realization.memoryCost prog s = 12 ∧ Succinct.ValidProg w (base + SuccinctWhp.largeSpaceWhp c U V w n_max) s prog ∧ BTreeSliceMemRep base c U V w n_max sIdx { alloc := sl.alloc, root := sl.root, nodes := Function.update sl.nodes u nd' } s'.mem ∧ (∀ sIdx' < 3 * SuccinctWhp.numBucketsWhp n_max, sIdx' ≠ sIdx → ∀ (sl₂ : SuccinctWhp.BTreeSlice), BTreeSliceMemRep base c U V w n_max sIdx' sl₂ s.mem → BTreeSliceMemRep base c U V w n_max sIdx' sl₂ s'.mem) ∧ ∀ (a : ℕ), a < base + offBtMeta c U V w n_max ∨ base + offTrieChild0 c U V w n_max ≤ a → s'.mem a = s.mem a

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.