Data invariants for pointer machines #
A predicate on data that holds of the undefined value and is closed under the operations of the model is preserved by execution. This separates a general data basis from restricted ones such as equality-only symbols.
Main definitions #
Model.Closed,State.DataValid: closed data predicates and their state invariant.
Main results #
Runs.dataValid,Executes.dataValid: preservation through runs and halting executions.
theorem Cslib.PointerMachine.Instr.effect_dataValid_of {M : Model} {L : Layout} {P Q : M.Value → Prop} (promote : ∀ (a : M.Value), P a → Q a) (undefined : Q M.undefined) (operation : ∀ (o : M.Op) (a b : M.Value), P a → P b → Q (M.evalOp o a b)) {i : Instr M L} {x : State M L} (hx : x.DataValid P) :
An instruction transports a data predicate when old values, newly allocated values, and operation results all satisfy the target predicate.