Footprints and replay for flat word-RAM runs #
These results concern the actual deterministic step over any basis, including width-reading
operations and faults. Each continuing instruction reads at most one cell and writes at most one
cell. Replay changes initial memory outside the cells read by a particular run; it preserves
the control path, registers and instruction count. No restriction on arithmetic is needed.
Main results #
Runs.exists_footprints: finite read/write footprints bounded by the continuing step count.Executes.exists_readFootprint: changing unread initial memory preserves the returned word and the charged halting time.
theorem Cslib.WordRAM.Op.eval_replay {B : Basis} {r w : ℕ} {o : Op B r} {x x' y : Data r} {D : Finset ℕ} (h : eval w o x = some x') (ha : Data.AgreeOutside D x y) (hd : Disjoint (Probe.reads (o.probes x)) D) :
Replaying one successful data instruction needs equality only at its read address.
theorem Cslib.WordRAM.Next.replay {B : Basis} {r w : ℕ} {p : Program B r} {s t s' : State r} {D : Finset ℕ} (h : Next w p s t) (hpc : s.pc = s'.pc) (ha : Data.AgreeOutside D s.data s'.data) (hd : Disjoint (Probe.reads (probes p s)) D) :
Replaying a continuing flat step preserves its control and register file.
theorem Cslib.WordRAM.Runs.exists_footprints {B : Basis} {r w n : ℕ} {p : Program B r} {s t : State r} (h : Runs w p s t n) :
Actual runs have at most one read and one write per continuing instruction. Any initial memory perturbation outside the read footprint replays with identical control and registers.