Appending one label to a parked projection preserves the calling convention
ProvedExactPatternStream.HashProof.protected_parked_childstreaming-algorithmsstring-algorithmsword-ram
Let be the labels already accumulated in a packed projection record and let be the arriving valid label. The record supplies the seed list of the prescribed depth, the child parameters and projection bounds hold, and a 48-word save area lies between the low registers and the heap. The callback at address reaches a state with
The history equality means that the same physical record represents the extended list with the same seeds. All 48 entry registers are restored and copied in the save area. Stream cursors and packed bits outside the projection workspace agree with their entry values, and every write is accounted for by that workspace or the save area.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.HashProof open DynBrooks MachineProof PackedRAM ImplementationProof SoundProof
Formal statement
theorem ExactPatternStream.HashProof.protected_parked_child {w σ m i c base start bank : ℕ} (pre post : Program)
(ω : ℕ→BitVec w) (a : Config w) (pc : a.pc=pre.length) (low : 60≤ bank) (safe : bank+48≤ base)
(xs : List Label) (x : Label) (legal : Coded σ m i x) (args : LongChildArgs a σ m i c base start x)
(fit : ChildProjectionFits w σ m i c base start) (seeds : List (ℕ×ℕ)) (depth : seeds.length=childProjectionDepth σ m i c)
(stored : ParkedChild a σ m i c base start seeds xs) :
let Q:=pre++protectedChildCode bank pre.length++post
∃ t,let z:=run Q ω a t
z.pc=pre.length+576 ∧ ParkedChild z σ m i c base start seeds (xs++[x]) ∧
z.input=a.input ∧ z.output=a.output ∧ z.coinPos=a.coinPos ∧
(∀ j,j< childProjectionFrames σ m i c start ∨ childProjectionEnd σ m i c start≤ j →
readBit z.mem base j=readBit a.mem base j) ∧
(∀ k<48,z.mem k=a.mem k) ∧ (∀ k<48,z.mem (bank+k)=a.mem k) ∧ (∀ k,60≤ k → k< base → (k< bank ∨ bank+48≤ k) → z.mem k=a.mem k) ∧
∀ u≤ t,(run Q ω a u).written⊆a.written∪(Finset.Ico bank (bank+48)∪childProjectionCells w σ m i c base start) := by sorrySource
Derived word-RAM implementation lemma for P. Gawrychowski, W. Janczewski, C. Jin and J. Nelson, An Improved Streaming Algorithm for Exact Pattern Matching, STOC 2027 submission 1330, §9, Lemma 9.2, p. 29 (PDF p. 30). The instruction addresses and register conventions are specific to the accompanying Lean formalization, InProgress/Stage/LongChildCall.lean, lines 14–90, protected_parked_child.