A per-character packet routine realizes every text deadline
ProvedExactPatternStream.MachineProof.packet_public_text_on_inputLet have lengths . Fix a word width , tape, hierarchy seed, modulus and residual evaluation point. Assume the clock, residue arithmetic, alphabet and learned reporter fields fit in a word. Start at the trained, silent public read with its initialized rows and reporter. Suppose the lower-lane instruction block realizes the packet transition on each successive text character and preserves the stated row interpretation outside the reporter registers. For every , the run completes the prefix ending after text characters and reports
bits. Each bit equals the packet matcher at its deadline, and the final output list equals the seeded matcher's answers. The coin position stays fixed. The write history at every feed is contained in the initial write history, the specified working arena and registers numbered through .
import Definitions.Def_ExactPatternStream_StreamingImplementation open ExactPatternStream open ExactPatternStream.MachineProof open DynBrooks ImplementationProof OnlineReport Dispatch
theorem ExactPatternStream.MachineProof.packet_public_text_on_input {w σ p : ℕ} [NeZero p] (pre body post : Program)
(P T : List (Fin σ)) (seed : Seeds σ P.length) (a : ZMod p) (ω : ℕ→BitVec w)
(hm : 1≤ P.length) (hmn : P.length≤ T.length) (hn : T.length≤2*P.length) (clockFit : 4*P.length<2^w) (square : p*p≤2^w) (residue : σ< p)
(arena : Finset ℕ) (terminal : BitVec w)
(rowsAt : ℕ → List (FlatStage LeafItem LaneMemory) → (ℕ→BitVec w) → Prop)
(frame : ∀ i fs mem mem', rowsAt i fs mem → (∀ j, 36 ≤ j → mem' j=mem j) → rowsAt i fs mem') :
let left:=pre++textLeafInputCode++body
let Q:=left++packetFinishCode left.length++(reporterEmitCode (packetEnd left.length) pre.length++post)
let pat:=learnPattern seed a T.length (rawEvents P)
let initial:=bareInit pat.residual pat.symbol (triggerStart pat.count (decide (pat.layers.length=0)))
let rows:=compileLayers seed T.length pat.layers
pat.count+1<2^w → 2*pat.residual.1<2^w →
(∀ i : ℕ, ∀ hi : i< T.length,
let st:=(T.take i).foldl (packetTextTick a pat.residual pat.symbol) (rows,initial)
let raw:=bareStep a pat.residual pat.symbol st.2 (.leaf (.one (.sym T[i].val)))
PacketLaneStep Q ω (pre.length+textLeafInputCode.length) left.length
a pat.residual pat.symbol terminal arena (rowsAt i) (rowsAt (i+1)) T[i] st.1 raw) →
∀ z : Config w, streamState Q P T ω P.length=some z → z.pc=pre.length →
z.output=[] → (z.mem 32).toNat=2*P.length-1-P.length →
z.mem 1=terminal → z.mem 2=z.mem 1 → rowsAt 0 rows z.mem →
ReporterMemory a pat.residual pat.symbol initial z.mem →
∀ i≤ T.length, ∃ d, streamState Q P T ω (P.length+i)=some d ∧
d.output.length=i+1-P.length ∧
(∀ j < i+1-P.length,d.output[j]?=some
(packetTextBit seed a T.length pat (T.take (P.length+j))).toNat) ∧
(i=T.length → d.output=answersOf P T (seededMatch P T (seed,a))) ∧
d.coinPos=z.coinPos ∧ d.written⊆z.written∪(arena∪Finset.range 36) ∧
(i< T.length → ∀ t, (run Q ω (feed d [(streamWords P T).getD (P.length+i) 0]) t).written
⊆z.written∪(arena∪Finset.range 36)) := by sorry