Certified row checker for Aho's machine #
The packed rows in Aho.Machine.PaddedRows retain the active work-head bit. Consequently every
composite move is a regular relation on two aligned rows. Insertions and deletions only shift the
remaining suffix by at most two slots: the checker below remembers the preceding two old and new
slots.
The per-cell certificate chooses the finite composite rule and the phase reached after each of the twenty-one logical slots in that cell. Phase choices only resolve regular-expression boundaries; all grammar predicates, symbols, active bits, input-consumption bits, and delayed suffix equalities are checked by the finite control.
Logical-slot verifier #
Finite phases shared by the fourteen composite-certificate cases.
- prefix : WorkPhase
- marked : WorkPhase
- stage1 : WorkPhase
- stage2 : WorkPhase
- stage3 : WorkPhase
- popBeta : WorkPhase
- returnBeta : WorkPhase
- minus1First : WorkPhase
- suffixSame : WorkPhase
- suffixPlus1 : WorkPhase
- suffixPlus2 : WorkPhase
- suffixMinus1 : WorkPhase
- suffixMinus2 : WorkPhase
- dead : WorkPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Two slots of lookbehind on each aligned work track. The outer option distinguishes "no slot has been read" from a previously read padding blank.
Instances For
Equations
- IndexedGrammar.Aho.WorkHistory.instFintype = Fintype.ofInjective (fun (h : IndexedGrammar.Aho.WorkHistory g) => (h.old1, h.old2, h.new1, h.new2)) ⋯
Equations
- IndexedGrammar.Aho.WorkScanState.instFintype = Fintype.ofInjective (fun (s : IndexedGrammar.Aho.WorkScanState g) => (s.phase, s.history, s.oldEnded, s.newEnded)) ⋯
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
Instances For
Equations
Instances For
Equations
Instances For
Equations
- IndexedGrammar.Aho.InactiveNonIndex x = ∃ (z : IndexedGrammar.Aho.WorkSym g), x = IndexedGrammar.Aho.inactive z ∧ z.isIndex = false
Instances For
Equations
- IndexedGrammar.Aho.SameInactiveSome x y = ∃ (z : IndexedGrammar.Aho.WorkSym g), x = IndexedGrammar.Aho.inactive z ∧ y = IndexedGrammar.Aho.inactive z
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- IndexedGrammar.Aho.sameSuffix old new = (old = new ∧ IndexedGrammar.Aho.InactiveOpt old)
Instances For
Equations
- IndexedGrammar.Aho.plus1Suffix h old new = (IndexedGrammar.Aho.InactiveOpt old ∧ IndexedGrammar.Aho.InactiveOpt new ∧ h.old1 = some new)
Instances For
Equations
- IndexedGrammar.Aho.plus2Suffix h old new = (IndexedGrammar.Aho.InactiveOpt old ∧ IndexedGrammar.Aho.InactiveOpt new ∧ h.old2 = some new)
Instances For
Equations
- IndexedGrammar.Aho.minus1Suffix h old new = (IndexedGrammar.Aho.InactiveOpt old ∧ IndexedGrammar.Aho.InactiveOpt new ∧ h.new1 = some old)
Instances For
Equations
- IndexedGrammar.Aho.minus2Suffix h old new = (IndexedGrammar.Aho.InactiveOpt old ∧ IndexedGrammar.Aho.InactiveOpt new ∧ h.new2 = some old)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- IndexedGrammar.Aho.prefixEdge productive IndexedGrammar.Aho.WorkPhase.prefix IndexedGrammar.Aho.WorkPhase.prefix h old new = IndexedGrammar.Aho.SameInactiveSome old new
- IndexedGrammar.Aho.prefixEdge productive IndexedGrammar.Aho.WorkPhase.prefix IndexedGrammar.Aho.WorkPhase.marked h old new = (productive = true ∧ IndexedGrammar.Aho.ProductiveMarked old new)
- IndexedGrammar.Aho.prefixEdge productive IndexedGrammar.Aho.WorkPhase.marked IndexedGrammar.Aho.WorkPhase.stage1 h old new = (productive = true ∧ IndexedGrammar.Aho.Boundary old new)
- IndexedGrammar.Aho.prefixEdge productive phase next h old new = False
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The finite aligned-slot edge relation for one Aho composite certificate.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The grammar-side side condition carried by a composite certificate.
Equations
- One or more equations did not get rendered due to their size.
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.plainBinary A B C) = IndexedGrammar.Aho.AugBinary g A B C
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.plainTerminal A a) = IndexedGrammar.Aho.AugTerminal g A a
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.plainPushSkip A B f) = IndexedGrammar.Aho.AugPush g A B f
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.plainPushUse A B f) = IndexedGrammar.Aho.AugPush g A B f
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.liveBinaryBoth A B C) = IndexedGrammar.Aho.AugBinary g A B C
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.liveBinaryLeft A B C) = IndexedGrammar.Aho.AugBinary g A B C
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.liveBinaryRight A B C) = IndexedGrammar.Aho.AugBinary g A B C
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.livePushFresh A B f) = IndexedGrammar.Aho.AugPush g A B f
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.popPlain R d A B) = (R A B = true)
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.popLive R d A B) = (R A B = true ∧ d.later = true)
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.matchTerminal a) = True
- IndexedGrammar.Aho.CertEnabled g (IndexedGrammar.Aho.CompositeCert.eraseIndex R d) = (d.erasable = true)
- IndexedGrammar.Aho.CertEnabled g IndexedGrammar.Aho.CompositeCert.returnFrame = True
Instances For
Composite rules whose alpha prefix is changed by Aho's productive mark operation.
Equations
- (IndexedGrammar.Aho.CompositeCert.plainBinary a a_1 a_2).productive = true
- (IndexedGrammar.Aho.CompositeCert.plainTerminal a a_1).productive = true
- (IndexedGrammar.Aho.CompositeCert.liveBinaryBoth a a_1 a_2).productive = true
- (IndexedGrammar.Aho.CompositeCert.liveBinaryLeft a a_1 a_2).productive = true
- (IndexedGrammar.Aho.CompositeCert.liveBinaryRight a a_1 a_2).productive = true
- x✝.productive = false
Instances For
Instances For
Equations
Instances For
Execute one aligned logical-slot check.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Run a list of aligned logical slots and phase choices.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Run the twenty-one logical slots packed in one physical row cell.
Equations
- IndexedGrammar.Aho.evalWorkBlock g cert state old new choices = IndexedGrammar.Aho.evalWorkSlots g cert state (List.ofFn old) (List.ofFn new) (List.ofFn choices)
Instances For
Fold a list of physical blocks; useful for relating the cell checker to one flat slot scan.
Equations
Instances For
Extract all work blocks when every cell is in running form.
Equations
- IndexedGrammar.Aho.runBlocks [] = some []
- IndexedGrammar.Aho.runBlocks (IndexedGrammar.Aho.RowCell.run cell :: row) = Option.map (fun (x : List (IndexedGrammar.Aho.WorkBlock g)) => cell.block :: x) (IndexedGrammar.Aho.runBlocks row)
- IndexedGrammar.Aho.runBlocks (IndexedGrammar.Aho.RowCell.input a :: tail) = none
Instances For
The consecutive packed blocks beginning at logical cell offset cell.
Equations
- IndexedGrammar.Aho.packedBlockList g work cell n = List.ofFn fun (i : Fin n) => packedCell IndexedGrammar.Aho.workWidth work (cell + ↑i)
Instances For
Reblock a flat phase function into one twenty-one-phase certificate per physical row cell.
Equations
- IndexedGrammar.Aho.phaseBlockList n phases = List.ofFn fun (i : Fin n) (j : Fin IndexedGrammar.Aho.workWidth) => phases ⟨↑i * IndexedGrammar.Aho.workWidth + ↑j, ⋯⟩
Instances For
The full aligned slot stream of a bounded logical work word.
Equations
- IndexedGrammar.Aho.paddedWork n work = List.ofFn fun (k : Fin (n * IndexedGrammar.Aho.workWidth)) => work[↑k]?
Instances For
Instances For
Instances For
Instances For
Instances For
Successful terminal phases, including the padding needed to prevent truncated insertions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Physical-row verifier #
- prefix : InputPhase
- tail : InputPhase
- matched : InputPhase
- dead : InputPhase
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
- IndexedGrammar.Aho.inputStep cert✝ IndexedGrammar.Aho.InputPhase.prefix old new = if old.input ≠ new.input then IndexedGrammar.Aho.InputPhase.dead else IndexedGrammar.Aho.InputPhase.prefix
- IndexedGrammar.Aho.inputStep cert✝ IndexedGrammar.Aho.InputPhase.prefix old new = if old.input ≠ new.input then IndexedGrammar.Aho.InputPhase.dead else IndexedGrammar.Aho.InputPhase.tail
- IndexedGrammar.Aho.inputStep cert✝ IndexedGrammar.Aho.InputPhase.tail old new = if old.input ≠ new.input then IndexedGrammar.Aho.InputPhase.dead else IndexedGrammar.Aho.InputPhase.tail
- IndexedGrammar.Aho.inputStep cert✝ phase✝ old new = if old.input ≠ new.input then IndexedGrammar.Aho.InputPhase.dead else IndexedGrammar.Aho.InputPhase.dead
Instances For
Equations
- IndexedGrammar.Aho.inputDone (IndexedGrammar.Aho.CompositeCert.matchTerminal a) IndexedGrammar.Aho.InputPhase.prefix = decide False
- IndexedGrammar.Aho.inputDone cert IndexedGrammar.Aho.InputPhase.prefix = decide True
- IndexedGrammar.Aho.inputDone (IndexedGrammar.Aho.CompositeCert.matchTerminal a) IndexedGrammar.Aho.InputPhase.tail = decide False
- IndexedGrammar.Aho.inputDone cert IndexedGrammar.Aho.InputPhase.tail = decide True
- IndexedGrammar.Aho.inputDone (IndexedGrammar.Aho.CompositeCert.matchTerminal a) IndexedGrammar.Aho.InputPhase.matched = decide True
- IndexedGrammar.Aho.inputDone cert IndexedGrammar.Aho.InputPhase.matched = decide False
- IndexedGrammar.Aho.inputDone cert IndexedGrammar.Aho.InputPhase.dead = false
Instances For
Fold the independent immutable-input/consumption-bit check over running cells.
Equations
- IndexedGrammar.Aho.evalInputBlocks cert x✝ [] [] = x✝
- IndexedGrammar.Aho.evalInputBlocks cert x✝ (old :: olds) (new :: news) = IndexedGrammar.Aho.evalInputBlocks cert (IndexedGrammar.Aho.inputStep cert x✝ old new) olds news
- IndexedGrammar.Aho.evalInputBlocks cert x✝² x✝¹ x✝ = IndexedGrammar.Aho.InputPhase.dead
Instances For
One physical-row certificate. The same composite certificate must be repeated along the row; the phase block may vary from cell to cell.
- init {T : Type} {g : IndexedGrammar T} : RowCert g
- composite {T : Type} {g : IndexedGrammar T} : CompositeCert g → (Fin workWidth → WorkPhase) → RowCert g
Instances For
- start {T : Type} {g : IndexedGrammar T} : RowState g
- init {T : Type} {g : IndexedGrammar T} : BoundaryScanState → RowState g
- composite {T : Type} {g : IndexedGrammar T} : CompositeCert g → InputPhase → WorkScanState g → RowState g
- dead {T : Type} {g : IndexedGrammar T} : RowState g
Instances For
Equations
- One or more equations did not get rendered due to their size.
- IndexedGrammar.Aho.compositeCell g cert input work old new phases = IndexedGrammar.Aho.RowState.dead
Instances For
One physical-cell transition of the complete row verifier.
Equations
- One or more equations did not get rendered due to their size.
- IndexedGrammar.Aho.rowStepCell g (IndexedGrammar.Aho.RowState.init q) x✝¹ x✝ IndexedGrammar.Aho.RowCert.init = IndexedGrammar.Aho.RowState.init (IndexedGrammar.Aho.initScanCell g q x✝¹ x✝)
- IndexedGrammar.Aho.rowStepCell g x✝³ x✝² x✝¹ x✝ = IndexedGrammar.Aho.RowState.dead
Instances For
Equations
- IndexedGrammar.Aho.rowStepDone (IndexedGrammar.Aho.RowState.init IndexedGrammar.Aho.BoundaryScanState.tail) = true
- IndexedGrammar.Aho.rowStepDone (IndexedGrammar.Aho.RowState.composite cert input work) = (IndexedGrammar.Aho.inputDone cert input && IndexedGrammar.Aho.workScanDone work)
- IndexedGrammar.Aho.rowStepDone x✝ = false
Instances For
The certified row system implementing initialized and composite Aho steps.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Every semantic initialization step has a certified-row witness.
If a successful certified scan finishes in initialization mode, it is exactly an initialization row step.
The target component of the certified system is exactly Aho's final padded row.