Documentation

CslibFrontier.Computability.PointerMachine.Frame

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.

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 : ℕ) :
Option.map (fun (r : Record M L) => r.data f) (effect s i).heap[a]? = Option.map (fun (r : Record M L) => r.data f) s.heap[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 : ℕ) :
Option.map (fun (r : Record M L) => r.data field) y.heap[a]? = Option.map (fun (r : Record M L) => r.data field) x.heap[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.