Width-independent native program prefixes #
An execution that halts at one width identifies every successful prefix at a larger width when the program does not read physical width. These rules apply to both complete native frontends and programs that compose them.
Main results #
Code.readsWidth_rename: register renaming does not change width observation.Runs.prefix_at_smaller_width: wider prefixes agree with an admitted smaller-width execution.Runs.prefix_bounds: uniform prefix word bounds and the original outside-memory frame.Runs.prefix_bounds_init: initialized prefixes also have zero memory above the envelope.
These determinism and representation lemmas are original.
theorem Cslib.WordRAM.Runs.prefix_at_smaller_width {B : Basis} {w w' r : ℕ} {p : Program B r} (hp : ¬p.ReadsWidth) (hw : w ≤ w') {s t : State r} {k v total : ℕ} (hwide : Runs w' p s t k) (hlow : Executes w p s v total) :
Runs w p s t k
Every wider prefix is the same smaller-width prefix if that smaller execution halts.
theorem Cslib.WordRAM.Runs.prefix_bounds {B : Basis} {r w W P v total k : ℕ} {p : Program B r} {s₀ s : State r} (hr : Runs W p s₀ s k) (hp : ¬p.ReadsWidth) (hw : w ≤ W) (hi : Data.Bounded w s₀.data) (he : Executes w p s₀ v total) (hP : 2 ^ w ≤ P) :
A halt at an admitted width bounds every wider prefix and preserves original outside memory. The envelope bounds the address-word universe; no clearing or initial-zero hypothesis is used.
theorem Cslib.WordRAM.Runs.prefix_bounds_init {B : Basis} {r w W P v total k : ℕ} {p : Program B r} {input : List ℕ} {s : State r} (hr : Runs W p (State.init input) s k) (hp : ¬p.ReadsWidth) (hw : w ≤ W) (hi : InputFits w input) (he : Executes w p (State.init input) v total) (hP : 2 ^ w ≤ P) :
Initialized wider prefixes have bounded words and zero memory above the same envelope.