Text-row evaluation from the indexed group contract
ProvedExactPatternStream.ImplementationProof.text_group_visitexact-pattern-matchingstreaming-algorithmsword-ram
Fix with and . Suppose the counted row occurs at its designated program address, for the run limit , and . If the group routine processes every valid indexed text child of every active row, then each row visited by the next public text symbol realizes the prescribed transition between its old and new packed meanings, with the designated arena and continuation address.
Preamble
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.ImplementationProof open DynBrooks MachineProof PackedRAM HashProof CounterProof SoundProof CompletenessProof OnlineReport GroupReader Dispatch
Formal statement
theorem ExactPatternStream.ImplementationProof.text_group_visit {σ w p : ℕ} (P T : List (Fin σ)) (s : Seeds σ P.length) (a : ZMod p)
(hm : 1≤ P.length) (mn : P.length≤ T.length) (twice : T.length≤2*P.length) (hn : 3≤ T.length)
(Q : Program) (ω : Tape w) (body : ℕ→Program) (e : ℕ)
(place : ∀ t<(countedGroupRow body e).length,Q[e+t]?=(countedGroupRow body e)[t]?)
(limit : ℕ) (signed : 2*limit<2^w) (large : 4*T.length<2^w) :
let B:=seededBuild P T s
let h:=topIndex B
let base:=promotionHeapBase w σ P.length
let arena:=trainedParentArena w σ P.length T.length B h
let meaning:=countedTextMeaning P T s w
(∀ i,(live : i< h) → let L:=lvl B i
∀ k (valid : k< L.T.length),
GroupChildKernelAt s Q ω T.length base i (trainedPayloadStart σ P.length T.length B i) e
(e+(body e).length) L L.T L.AT (lvl B (i+1)).T k valid arena) →
∀ j (hj : j< T.length) ls f rest x tot,
let mix:=mixedTextMeaning (meaning j) (meaning (j+1))
TextVisit limit (publicTextPacketState P T s a j).1 (.raw T[j].val) ls (f::rest) (some x) tot →
TextRowEvaluatorBetween Q ω σ P.length T.length base h limit e (e+(countedGroupRow body e).length)
(trainedCounts B) (fun i=>(lvl B i).w)
(TextPackedRows σ P.length T.length base h (trainedCounts B) (fun i=>(lvl B i).w) (mix ls.length))
(TextPackedRows σ P.length T.length base h (trainedCounts B) (fun i=>(lvl B i).w) (mix (ls.length+1)))
arena ls f rest x tot := by sorrySource
Gawrychowski, Janczewski, Jin and Nelson, An Improved Streaming Algorithm for Exact Pattern Matching, STOC 2027 submission, §9, Lemma 9.2, p. 29 (PDF p. 30). Derived implementation lemma in Stage.TextPassVisitKernel, declaration text_group_visit.