Finite Stack Summaries for Regular Lookahead #
Regular lookahead on a pushdown stack can be implemented by storing, with each
stack symbol, the DFA transition summary of the suffix below that symbol. If a
DFA state type is finite, the summary type σ → σ is finite, so these
annotations keep the stack alphabet finite.
The transition function induced by reading an entire stack suffix.
Equations
- D.stackSummary γ s = D.evalFrom s γ
Instances For
The summary of a block γ placed above a suffix whose summary is below.
Equations
- D.summaryAbove below γ = below ∘ D.stackSummary γ
Instances For
@[simp]
Annotate a block of stack symbols to be placed above a suffix with known summary. The annotation stored at each symbol is the summary of the suffix below it.
Equations
- D.annotateAbove below [] = []
- D.annotateAbove below (Z :: γ) = (Z, D.summaryAbove below γ) :: D.annotateAbove below γ
Instances For
@[simp]
@[simp]
theorem
DFA.annotateAbove_head?_tail_summary
{S σ : Type}
(D : DFA S σ)
(below : σ → σ)
(Z : S)
(γ : List S)
:
The summary stored at the top of a nonempty annotated block is the summary of the block below that top symbol, together with the external suffix summary.