Langlib

Langlib.Grammars.Indexed.NormalForm.Aho.RowSystem.Evaluation

Evaluation lemmas for Aho's packed row checker #

Physical input cells contain blocks of twenty-one logical work slots. This module bridges the certified row system's cell-by-cell evaluator to the flattened input and work-track evaluators used by the completeness and soundness proofs.

theorem IndexedGrammar.Aho.evalStep_rowTriples {T : Type} (g : IndexedGrammar T) [Fintype g.nt] (state : RowState g) (rows : List (RowCell g × RowCell g × RowCert g)) :
(ahoRowSystem g).evalStep state (List.map (fun (r : RowCell g × RowCell g × RowCert g) => r.1) rows) (List.map (fun (r : RowCell g × RowCell g × RowCert g) => r.2.1) rows) (List.map (fun (r : RowCell g × RowCell g × RowCert g) => r.2.2) rows) = some (evalRowTriples g state rows)

Flattening the consecutive physical work blocks recovers the fixed-width padded slot row.

theorem IndexedGrammar.Aho.evalWorkBlocks_eq_evalWorkSlots {T : Type} (g : IndexedGrammar T) [Fintype g.nt] (cert : CompositeCert g) (state : WorkScanState g) (old new : List (WorkBlock g)) (choices : List (Fin workWidthWorkPhase)) (hnew : new.length = old.length) (hchoices : choices.length = old.length) :
evalWorkBlocks g cert state old new choices = evalWorkSlots g cert state (List.flatMap List.ofFn old) (List.flatMap List.ofFn new) (List.flatMap List.ofFn choices)

Folding physical blocks is the same computation as folding their flattened slot streams.