Bounded encoded sparse-store update — progress invariant internals #
This file isolates the pure list semantics of the entry-update loop. The invariant relates the processed and remaining portions of the old store to the entries already emitted by the machine, independently of the tape-level simulation proof.
Pure semantic progress of a left-to-right sparse-store update.
The output equation is deliberately phrased as a completion equation. Before the target address is found, completing the emitted prefix requires updating the remaining suffix. Afterwards, the untouched remaining suffix is copied verbatim.
The scan decomposition still covers the original store.
The flag records exactly whether the processed prefix contains the requested address.
- output_eq : (emitted ++ if found = true then remaining else write remaining address newValue) = write store address newValue
Completing the emitted prefix produces the abstract sparse-store write.
Until the optional final append, the runtime result count equals emitted entries plus old entries still remaining.
Instances For
Before scanning any entries, the empty emitted prefix satisfies the progress invariant.
Copying a nonmatching entry advances all three list frontiers without changing either the found flag or the result count.
Replacing the first matching entry emits the new nonzero pair and records that the target address has been found.
Deleting the first matching entry emits nothing for it, records the hit, and decrements the result count.
Once the scan is exhausted after a hit, the emitted store and result count are already the abstract write result.
An absent address written with zero requires no append; exhaustion already produces the abstract empty write contribution.
An absent address written with a nonzero value is completed by one final append and one result-count increment.
In a store with unique addresses, finding the target in the processed prefix excludes it from the unprocessed suffix.