Memory invariant of a timestamped query list #
Main definitions #
PrunedQuery.ScanMemory: a distinct finite list and its timestamp membership directory.
Main results #
PrunedQuery.ScanMemory.insert_new: the two actual stores preserve the invariant on insertion.
The invariant describes memory contents only. Execution and instruction charges are proved separately for the native scan; no execution certificate is included here.
The occupied output prefix enumerates S once, and the timestamp table identifies exactly
its members. Older timestamps may remain elsewhere in the directory.
Each listed value is a valid directory index.
Every timestamp is at most the current epoch.
The current epoch is exactly the membership marker.
- listed : ∃ (v : Fin S.card → ℕ), Function.Injective v ∧ Set.range v = ↑S ∧ { base := out, length := S.card }.Realizes mem v
The actual occupied prefix is an injective enumeration of the set.
Instances For
A realized distinct list cannot exceed its concrete directory capacity.
Agreement on the occupied list and timestamp directory preserves the scan invariant. Unoccupied list cells have no specified meaning and need not agree.
Reading the occupied native list gives exactly its represented finite set.
Occupied native list positions store different codes.
An unseen valid code leaves a free output cell for its insertion.
A fresh epoch establishes the empty directory without clearing its cells.
Append one previously unseen code, then mark its directory entry. Disjointness of the two concrete blocks ensures that neither store corrupts the other representation.