Memory.Prog Slab-Stack Metadata Operations (gmPushSlabProg, gmPopSlabProg) #
This module defines the Memory.Prog operations that push and pop full-slab descriptors in
GlobalMeta (gmPushSlabProg, gmUnlinkTopSlabProg, gmCompactSlabProg, gmPopSlabProg),
proves their exact pure effects (gmPushSlab, gmUnlinkTopSlab, gmCompactSlab, gmPopSlab),
and certifies them via the realize tactic.
Main definitions #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmPushSlabProg:Memory.Progoperation allocatingp_new = gm 0as the new top slab of bucketb.Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmUnlinkTopSlabProg:Memory.Progoperation unlinking the top slab of bucketb.Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmCompactSlabProg:Memory.Progoperation compactingp_last = gm 0 - 1intop_del.Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmPopSlabProg:Memory.Progoperation popping the top slab of bucketband compacting the slab pool.
Main results #
Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmPushSlabProg_effect,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_gmPushSlabGen: effect andRealizescertificate forgmPushSlabProg.Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmUnlinkTopSlabProg_effect,Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmCompactSlabProg_effect: effects of the two stages ofgmPopSlabProg.Cslib.DataStructure.Dictionary.WordRAM.Succinct.gmPopSlabProg_effect,Cslib.DataStructure.Dictionary.WordRAM.Succinct.realizes_gmPopSlabGen: effect andRealizescertificate forgmPopSlabProg.
Section 1: Conditional writeGMProg helpers #
Section 2: gmPushSlabProg and realizes_gmPushSlabGen #
Parameter-free Memory.Prog operation allocating a new full slab p_new = gm 0 as the new top
slab s_new = gm (gmQIdx b) of bucket b = d.2.2 at base = d.2.1.
Memory.Prog operation allocating a new full slab p_new = gm 0 as the new top slab
s_new = gm (gmQIdx b) of bucket b = d.2 at base = d.1.
Precondition for gmPushSlabProg.
Parameter-free precondition for gmPushSlabGenProg.
Under SlabBijection and gm 0 < maxFullSlabs n_max (b < numBuckets n_max),
gmPushSlabProg runs in memoryCost ≤ 38 (memoryCost_gmPushSlabProg_le) and preserves
frontier, quotAt, valAt, lmAt, and memory outside
[base + offGM U V w n_max h_space, base + totalSpace U V w n_max h_space). It updates gmAt to
gmPushSlab n_max gm b, allocating p_new = gm 0 as the new top slab of bucket b.
Section 3: gmUnlinkTopSlabProg, gmCompactSlabProg, gmPopSlabProg #
Parameter-free Memory.Prog operation unlinking the top slab of bucket b = d.2.2 at
base = d.2.1.
Memory.Prog operation unlinking the top slab of bucket b = d.2 at base = d.1 and
returning its physical slab index p_del = gm (gmSlabTopIdx b).
Precondition for gmUnlinkTopSlabProg and gmPopSlabProg.
Parameter-free precondition for gmUnlinkTopSlabGenProg and gmPopSlabGenProg.
Parameter-free Memory.Prog helper performing gmRelinkMovedSlab for
d = (dp, ((base, p_del), p_last)).
Memory.Prog helper performing gmRelinkMovedSlab for d = ((base, p_del), p_last).
Pure bounds invariant for gmRelinkMovedSlabProg and gmLinkMovedNeighborsProg.
Precondition for gmRelinkMovedSlabProg and gmLinkMovedNeighborsProg.
Parameter-free precondition for gmRelinkMovedSlabGenProg and gmLinkMovedNeighborsGenProg.
Parameter-free Memory.Prog helper performing gmLinkMovedNeighbors for
d = (dp, ((base, p_del), p_last)).
Memory.Prog helper performing gmLinkMovedNeighbors for d = ((base, p_del), p_last).
Parameter-free Memory.Prog operation compacting the slab pool by relocating the metadata of
p_last = gm 0 - 1 into p_del = d.2.2 (when p_del < p_last) and decrementing gm 0.
Memory.Prog operation compacting the slab pool by relocating the metadata of
p_last = gm 0 - 1 into p_del = d.2 (when p_del < p_last) and decrementing gm 0.
Pure bounds invariant for gmCompactSlabProg.
Precondition for gmCompactSlabProg.
Parameter-free precondition for gmCompactSlabGenProg.
Parameter-free Memory.Prog operation popping the top slab of bucket b = d.2.2 at
base = d.2.1 and compacting the physical slab pool.
Memory.Prog operation popping the top slab of bucket b = d.2 at base = d.1 and compacting
the physical slab pool.
Under SlabBijection and 1 ≤ gm (gmQIdx b) (b < numBuckets n_max), gmPopSlabProg runs in
memoryCost ≤ 68 (memoryCost_gmPopSlabProg_le) and preserves frontier, quotAt, valAt,
lmAt, and memory outside
[base + offGM U V w n_max h_space, base + totalSpace U V w n_max h_space). It updates gmAt to
gmPopSlab n_max gm b, unlinking the top slab p_del of bucket b and compacting
p_last = gm 0 - 1 into p_del.