Documentation

CslibFrontier.Computability.WordRAM.MemoryView

Keeping semantic memory views through frames #

The existing finite-footprint assertions and block/list representations transport along ordinary Set.EqOn frames. The frame may cover more than the live view: unused cells need not have a specified value. Compose frames with Set.EqOn.trans; Modifies.eqOn connects finite write footprints to the same interface. None of these rules requires initialization or disjointness between read-only views.

Main results #

theorem Cslib.WordRAM.Modifies.eqOn {writes : Finset ℕ} {before after : ℕ → ℕ} {reads : Set ℕ} (h : Modifies writes before after) (hd : Disjoint reads ↑writes) :
Set.EqOn after before reads

A write frame agrees on every set disjoint from its permitted writes.

theorem Cslib.WordRAM.HeapAssertion.keep {P : HeapAssertion} {before after : ℕ → ℕ} {reads : Set ℕ} (h : P.holds before) (hf : Set.EqOn after before reads) (hspan : ↑P.footprint ⊆ reads) :
P.holds after

An equality frame retains every assertion whose finite support it covers. Read-only views may overlap; only the required equality on their live cells matters.

theorem Cslib.WordRAM.Block.Realizes.keep {b : Block} {before after : ℕ → ℕ} {values : Fin b.length → ℕ} {reads : Set ℕ} (h : b.Realizes before values) (hf : Set.EqOn after before reads) (hspan : Set.Ico b.base (b.base + b.length) ⊆ reads) :
b.Realizes after values

Exact block readback survives an equality frame containing the block.

theorem Cslib.WordRAM.Block.HoldsList.keep {base : ℕ} {xs : List ℕ} {before after : ℕ → ℕ} {reads : Set ℕ} (h : HoldsList base xs before) (hf : Set.EqOn after before reads) (hspan : Set.Ico base (base + xs.length) ⊆ reads) :
HoldsList base xs after

List readback survives an equality frame containing its occupied cells.

Retain an existing semantic memory view using an equality frame. The tactic only discharges containment of its support; the caller supplies the view and the actual memory frame.

Retain a block or list through one actual store outside its occupied interval. This uses Block.Realizes.update_of_not_owns; the dirty cell's stored value is unrestricted.