Collision-Free Live-Slice Branch of fastInsert #
Internal correctness proof for the hasFpCollision = false branch of fastInsertFresh, inserting
the newly allocated coordinate directly into the bucket's live B-tree slice fs.slices lIdx with
state 1 [BFCKK24].
Main results #
Cslib.DataStructure.Dictionary.SuccinctWhp.fastInsertFresh_live_spec: provesCoreFastInv, off-bucketOvermarsBucketInv, target-bucketPreOvermarsBucketInv, andValidEpochStagein the collision-free live-slice branch.
References #
theorem Cslib.DataStructure.Dictionary.SuccinctWhp.fastInsertFresh_live_spec {c U V n_max : ℕ} {θ : SeedWhp c U n_max} {fs : FastState} {dict : State U} (hv : ValidFastState c U V n_max θ fs dict) {u : Fin U} {v : ℕ} (hX_lt :
fs.bktCount (FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u) < totalLocalCoordsWhp n_max) {hasFpCollision : Bool} (hbase : FastInsertFreshBase c U V n_max θ fs dict u v hasFpCollision) (hfp_def :
have b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u;
hasFpCollision = (btreeLookup (fpBitsWhp n_max) (valLaneBitsWhp n_max) (tMinWhp n_max) (fs.slices (fs.liveSliceIdx b))
(fpOfSalt c U n_max θ.2 (fs.bktSalt b) u)).isSome) (hfp_coll : ¬hasFpCollision = true) :
have b := FeistelQuotient.feistelBucket (bWhp n_max) (bktHash c U n_max θ.1) ↑u;
have X := fs.bktCount b;
have fsIns :=
fastInsertFresh c n_max b X (FeistelQuotient.keyQuotient (bWhp n_max) ↑u) v (fpReducedKey c U n_max θ.2 u)
(fpOfSalt c U n_max θ.2 (fs.bktSalt b) u) (fs.liveSliceIdx b) hasFpCollision (fastInsertAlloc n_max b X fs);
CoreFastInv c U V n_max θ fsIns (Function.update dict u (some v)) ∧ (∀ b' < numBucketsWhp n_max, b' ≠ b → OvermarsBucketInv c U n_max θ fsIns b') ∧ PreOvermarsBucketInv c U n_max θ fsIns b ∧ ValidEpochStage c U n_max θ fsIns ∧ fsIns.epochClock = fs.epochClock
Invariant preservation for fastInsertFresh in the hasFpCollision = false branch.