Subtree Correctness and Node-Splitting Lemmas for the SWAR B+-Tree #
This module proves sorted SWAR rank routing (swarRank_sorted_spec, branch_child_routing),
subtree lookup, deletion, and in-place value update (btreeLookup_eq_of_subtree,
btreeDelete_subtree_spec, btreeUpdate_subtree_spec), unified proactive full-node splitting
(splitFullNode_spec, splitRootIfFull_spec), and leaf insertion (finishLeafInsert_leaf_spec)
for the top-down split-only SWAR B+-tree defined in
CslibFrontier.DataStructure.Dictionary.SuccinctWhpSwarBTree.
Main results #
Cslib.DataStructure.Dictionary.SuccinctWhp.btreeLookup_eq_of_subtree: exact lookup agreementbtreeLookup ... sl q = mapFn q.Cslib.DataStructure.Dictionary.SuccinctWhp.btreeDelete_subtree_spec,Cslib.DataStructure.Dictionary.SuccinctWhp.btreeUpdate_subtree_spec: preservation ofValidSubtreeand non-increasingpotentialunder deletion and update.Cslib.DataStructure.Dictionary.SuccinctWhp.splitFullNode_spec,Cslib.DataStructure.Dictionary.SuccinctWhp.splitRootIfFull_spec: proactive node splitting with excess-key split-potential drop.Cslib.DataStructure.Dictionary.SuccinctWhp.finishLeafInsert_leaf_spec: exact map refinement and count bound for leaf insertion/overwrite.
References #
Section 1: Sorted SWAR rank characterization, descent, lookup, delete, and update #
Partition property of swarRank on a strictly increasing lane array:
r ≤ cnt, lanes < r are < q, and lanes r .. cnt - 1 are ≥ q.
Internal branch routing: swarRank selects the unique child interval [childLo r, childHi r]
containing q, and every other child interval is disjoint from {q}.
Exact lookup specification on any valid subtree T with T.height ≤ hMaxBTree.
Subtree deletion specification: btreeDelete preserves ValidSubtree, keeps alloc and
height unchanged, does not increase potential, and updates mapFn to
Function.update mapFn q none.
Subtree in-place value update specification: when newVal < 2 ^ W_val, btreeUpdate preserves
ValidSubtree, alloc, height, and potential, updating mapFn q to some newVal whenever q
is present (and leaving mapFn unchanged when mapFn q = none).
Section 2: Proactive node splitting (splitFullNode, splitRootIfFull) #
Unified specification of splitFullNode on any full (2 * tMin - 1-key) valid subtree T
(leaf or internal branch), covering both splitRootIfFull (leftIdx = alloc,
rightIdx = alloc + 1) and descendSplitToLeaf (leftIdx = T.rootIdx, rightIdx = alloc).
Specification of splitRootIfFull: ensures the root is strictly non-full (< 2 * tMin - 1
keys), increases height by at most 1, allocates at most 2 nodes, and never increases the
excess-key split potential (tMin - 2) * (alloc - 1) + 2 * T.potential tMin when 3 ≤ tMin.
Exact specification of finishLeafInsert on a non-full (cnt < 2 * tMin - 1) valid leaf.