Documentation

CslibFrontier.DataStructure.Memory.Region

The cells a framed method or an allocation writes #

A method run of a framed refinement changes an allocated cell only in its footprint, and it advances the frontier by at most the room it gives up, so the cells it allocates lie in the room reserved above the old frontier. An admissible run changes no cell at or above its final frontier. So a method run writes only the footprint and the reserved room, the region of the structure (Framed.region, Framed.mem_eq_of_not_mem_region). An allocation changes no allocated cell, and allocates only within the room it takes, so it writes only that room (Allocates.mem_eq_of_not_mem). These are the memory side of the native frame theorems of Realization.Backend.

Main definitions #

Main results #

The cells that a method run of M from s may write: the footprint, and the room reserved above the frontier.

Without room, the region is the footprint.

theorem Cslib.DataStructure.Memory.Framed.mem_eq_of_not_mem_region {w : ℕ} {D : StateTransitionSpec} (M : Framed D w) {s : State} (o : D.Op) {a : D.Result o} {s' : State} {tr : (spec w).Transcript} (hs : M.inv s) (hv : D.valid (M.abs s) o) (hrun : (spec w).ClientRun s (M.methods o) a s' tr) {b : ℕ} (hb : b ∉ M.region s) :
s'.mem b = s.mem b

A method run writes only the region: an allocated cell outside the footprint is kept by Framed.modifies, and a cell beyond the reserved room lies at or above the final frontier.

theorem Cslib.DataStructure.Memory.Allocates.mem_eq_of_not_mem {w : ℕ} {D : StateTransitionSpec} {H : Type} {alloc : Prog H} {methods : H → Methods D (spec w)} {init : D.State} {owned : Finset ℕ} {room cost : ℕ} {s : State} {M : Framed D w} (h : Allocates alloc methods init owned room cost s M) {b : ℕ} (hb : b ∉ Finset.Ico s.frontier (s.frontier + room)) :
((spec w).clientState s alloc).mem b = s.mem b

An allocation writes only the room it takes: it keeps every allocated cell, and every cell beyond its room lies at or above its final frontier.