Shared Helpers for Global Epoch Ticks #
This module provides shared header representations, Memory.Prog transition helpers, sequential
proof combinators, Stage-2 scan preservation facts, and the rollover success predicate
epochTickWillSucceed used across the split submodules of SuccinctWhpEpochTickProg.
Projection of the header-word and bucket-count invariants from FastMemRep.
Dirty bucket queue size does not exceed
qEpochWhp n_max.Header slot
hdrModeequals1(fast mode).Header slot
hdrPoolFreeTopmatchesfs.poolFreeTop.Header slot
hdrCurEpmatchesfs.curEp.Header slot
hdrEpochClockmatchesfs.epochClock.Header slot
hdrRebStagematchesfs.rebStage.Header slot
hdrStageCursormatchesfs.stageCursor.Header slot
hdrDirtyCountmatchesfs.dirtyCount.Header slot
hdrDirtyIdxmatchesfs.dirtyIdx.Header slot
hdrRebCandSaltmatchesfs.rebCandSalt.Header slot
hdrRebScanCursormatchesfs.rebScanCursor.Header slot
hdrRebInsCountmatchesfs.rebInsCount.Header slot
hdrRebCollisionmatchesfs.rebCollision.- bktCount_read (b : ℕ) : b < SuccinctWhp.numBucketsWhp n_max → BitPackedArray.readPacked (base + offBktMeta c U V w n_max) (SuccinctBucket.globalPtrBits n_max) w mem (16 * b) = fs.bktCount b
Extract FastMemHdrs from a full FastMemRep witness.
Read (tr.nodeAlloc, tr.itemAlloc) for buffer ep ∈ {0, 1} (d = (base, ep)).
Realizes .exact certificate for readBufAllocsProg.
Cost and result specification for readBufAllocsProg.
FastStateStep wrapper around bufClearStepsGenProg_spec.
Under CoreFastInv, every bucket's rebuild slice index is < 3 * numBucketsWhp n_max.
Compose two sequential Memory.Prog Unit FastStateStep transitions p₁ >>= fun _ => p₂.
Write mem[base + hdrOff] := val as a single FastStateStep with cost ≤ 1.
Write 0 into any header slot hdrOff ∈ [1, 11] as a single FastStateStep (cost ≤ 1).
Append a writeHdrProg ((base, hdrOff), val) write onto an existing Memory.Prog Unit step.
Bundled specification for the shared 3-read prefix (oldEp, allocs, sc) of Stages 0, 1, 3.
State preservation for
readOldEpProg base.Result
fs.oldEpfromreadOldEpProg base.Memory cost of
readOldEpProg base.- ro_vp : Succinct.ValidProg w F s (readOldEpProg base)
Validity of
readOldEpProg base. State preservation for
readBufAllocsProg (base, oldEp).Result
(na, ia)fromreadBufAllocsProg (base, oldEp).Memory cost of
readBufAllocsProg (base, oldEp).Validity of
readBufAllocsProg (base, oldEp).State preservation for
readHdrProg (base, hdrStageCursor).Result
fs.stageCursorfromreadHdrProg (base, hdrStageCursor).Memory cost of
readHdrProg (base, hdrStageCursor).Validity of
readHdrProg (base, hdrStageCursor).
Read (oldEp, (na, ia), stageCursor) under FastMemRep and fs.curEp ∈ {0, 1}.
Lift a verified itemAlloc ≤ stageCursor branch across the Stage 0/1/3 3-read prefix.
Lift a bufCheckSlotGenProg continuation across stageCursorPrefix_lt_fastStep and
seqUnitProg_fastStep.
Transition to Stage 3 (rebStage := 3, stageCursor := 0).
Realizes .exact certificate for tickToStage3Prog.
FastStateStep specification for tickToStage3Prog.
Set (rebCandSalt, rebScanCursor, rebInsCount, rebCollision) := (cand, 0, 0, 0)
(d = (base, cand)).
Realizes .exact certificate for resetRebScanHdrsProg.
FastStateStep specification for resetRebScanHdrsProg.
Frame invariant preserved across rebScanSteps c U n_max θ b k fs.
Current epoch index is unchanged.
Epoch clock is unchanged.
Rebuild stage is unchanged.
Stage cursor is unchanged.
Dirty bucket count is unchanged.
Dirty bucket index is unchanged.
Dirty bucket array is unchanged.
Candidate rebuild salt is unchanged.
Bucket item counts are unchanged.
Live slice roles are unchanged.
Overmars slice roles are unchanged.
Rebuild insertion count increases by at most
k.
rebScanSteps c U n_max θ b k fs satisfies RebScanPreserved fs _ k.
Exact read-only rollover pre-condition guaranteeing (epochTick c U n_max θ fs).isSome.