Micro-Chain Update Helpers and Bucket Metadata Readers in Memory.Prog #
This module defines and verifies the Memory.Prog building blocks used by the bucket-level
dictionary operations (insertBodyProg, deletePrepProg, deleteFinishProg):
AllChainsValid: global doubly-linked chain invariant across all(b, m)pairs;prependIfIndexedProgandunlinkIfIndexedProg: conditional micro-chain updates when a logical slot indexjis in the indexed prefixj < effBucketCap n_max;readTotalSlotsProg:O(1)reader fortotalSlots(readBucketCountProgforbCountlives inSuccinctProg.lean);copyLastPayloadProg:O(1)payload copy from the last logical slot of bucketbtophys_del.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.AllChainsValid: global doubly-linked chain invariant across all(b, m)pairs.Cslib.DataStructure.Dictionary.WordRAM.Succinct.prependIfIndexedProg: conditionalMemory.Progprependingj_newto micro-chain(b, m)whenj_new < effBucketCap n_max.Cslib.DataStructure.Dictionary.WordRAM.Succinct.unlinkIfIndexedProg: conditionalMemory.Progunlinkingj_delfrom micro-chain(b, m)whenj_del < effBucketCap n_max.Cslib.DataStructure.Dictionary.WordRAM.Succinct.readTotalSlotsProg:Memory.Progoperation readingtotalSlots.Cslib.DataStructure.Dictionary.WordRAM.Succinct.copyLastPayloadProg:Memory.Progoperation copying(Quotients, Values)from the last slot of bucketbtophys_del.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.lmPrependProg_allChainsValid,Cslib.DataStructure.Dictionary.WordRAM.Succinct.lmUnlinkProg_allChainsValid: preservation ofAllChainsValidunder prepend and unlink.Cslib.DataStructure.Dictionary.WordRAM.Succinct.prependIfIndexedProg_allChainsValid,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_prependIfIndexedGen: effect andRealizescertificate forprependIfIndexedProg.Cslib.DataStructure.Dictionary.WordRAM.Succinct.unlinkIfIndexedProg_allChainsValid,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_unlinkIfIndexedGen: effect andRealizescertificate forunlinkIfIndexedProg.Cslib.DataStructure.Dictionary.WordRAM.Succinct.clientResult_readTotalSlotsProg,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_readTotalSlotsGen: specification andRealizescertificate forreadTotalSlotsProg.Cslib.DataStructure.Dictionary.WordRAM.Succinct.copyLastPayloadProg_effect,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_copyLastPayloadGen: effect andRealizescertificate forcopyLastPayloadProg.
Section 1: AllChainsValid and micro-chain update preservation #
Global doubly-linked micro-bucket chain invariant across all buckets b < numBuckets n_max
and local micro-buckets m < numMicroPerBucket n_max, together with pairwise disjointness of
chains within each bucket b.
AllChainsValid depends only on lm.
Prepending j_new < effBucketCap n_max (with j_new ∉ L b m' for all m') preserves
AllChainsValid.
Unlinking j_del ∈ L b m preserves AllChainsValid and removes (b, j_del) from the
chain family.
Section 2: prependIfIndexedProg, unlinkIfIndexedProg, and bucket readers #
Parameter-free Memory.Prog operation prepending j_new = d.2 to micro-bucket chain
(b, m) = (d.1.2.1.2, d.1.2.2) at base = d.1.2.1.1 when
j_new < min n_max (effBucketCap n_max).
Precondition for prependIfIndexedProg in Realizes.
Parameter-free precondition for prependIfIndexedGenProg.
Pure state effect and AllChainsValid preservation of prependIfIndexedProg.
Parameter-free Memory.Prog operation unlinking j_del = d.2 from micro-bucket chain
(b, m) = (d.1.2.1.2, d.1.2.2) at base = d.1.2.1.1 when
j_del < min n_max (effBucketCap n_max).
Precondition for unlinkIfIndexedProg in Realizes.
Parameter-free precondition for unlinkIfIndexedGenProg.
Pure state effect and AllChainsValid preservation of unlinkIfIndexedProg.
Parameter-free Memory.Prog reader returning totalSlots n_max gm at base = d.2.
Memory.Prog reader returning totalSlots n_max gm at base.
Parameter-free Memory.Prog helper copying (quotAt, valAt) from the last logical slot
lastSlotOfGenProg (dp, (base, b)) of bucket b = d.2.1.2 (base = d.2.1.1) into
phys_del = d.2.2.
Precondition for copyLastPayloadProg in Realizes.
Parameter-free precondition for copyLastPayloadGenProg.
Pure state effect of copyLastPayloadProg.