Ordinary indexed functions as memory models #
IndexedRep mem address values describes selected RAM cells by an ordinary
function values : ι → Word w. The index can be Fin n, a product of finite
indices, or another existing mathematical type; no new vector or map datatype
is introduced. Reindexing is ordinary function composition, and a machine store
is mathlib's Function.update on the model.
The assertion by itself describes values, not ownership or allocation. A store
requires an injective address layout; Source.IndexedAt separately records that
the observed addresses belong to the source heap. Thus no-wrap, aliasing and
heap-access obligations stay explicit without being repeated in model proofs.
The whole model is an ordinary function equality, suitable for rewriting any mathlib property without a second pointwise representation proof.
The same observed cells cannot represent two different functions.
Restricting, permuting or reshaping a model uses existing functions.
A surjective reindexing loses no information. In particular this applies
to any mathlib Equiv, without inventing a representation-specific bijection.
A real one-word store is standard function update when indices do not alias. The proof uses mathlib's update/composition theorem directly.
Updates outside the selected cells preserve the complete model.
The existing store instruction has the same model update; no additional executable primitive or abstract cost annotation is introduced.
An indexed model all of whose cells lie in the source-visible heap.
Equations
- Ram.Source.IndexedAt heapLimit address values s = (Ram.IndexedRep s.mem address values ∧ ∀ (i : ι), BitVec.toNat (address i) < heapLimit)
Instances For
Only heap agreement is needed to move a model between source states.
Any indexed model, including product-indexed matrices and finite maps, is observable on the actual target state through the existing compiler bridge.