Scalar-field frames from program syntax #
A program which neither allocates nor stores a particular scalar field preserves that field at every heap address. This applies even while pointer fields are rewired, so tree-balancing programs can preserve dictionary payloads without repeating heap-update proofs.
def Cslib.PointerMachine.Instr.WritesData {M : Model} {L : Layout} (i : Instr M L) (f : Fin L.dataFields) :
Whether an instruction may write field f at some heap address.
Allocation counts as a write because it initializes a new record.
theorem Cslib.PointerMachine.Instr.effect_data_frame {M : Model} {L : Layout} (i : Instr M L) (f : Fin L.dataFields) (safe : ¬i.WritesData f) (s : State M L) (a : ℕ) :
An instruction that neither allocates nor stores f preserves that field at every
address.
theorem Cslib.PointerMachine.Runs.data_frame {M : Model} {L : Layout} {code : List (Instr M L)} {x y : State M L} {n : ℕ} (run : Runs code x y n) (field : Fin L.dataFields) (safe : ∀ i ∈ code, ¬i.WritesData field) (a : ℕ) :
When the program has no allocation or store to field, every run preserves the
scalar field at every address, including absence of a record. Pointer writes are unrestricted.