Indexed Languages Intersected with Regular Languages #
For an indexed grammar in Aho normal form, annotate each nonterminal with the entry and exit states of a DFA. Binary rules thread an intermediate state, push/pop rules preserve both endpoints, and terminal rules realize one DFA transition. Parse certificates give a compact soundness and completeness proof.
An indexed nonterminal annotated with the DFA states immediately before and after the word generated by that nonterminal.
- start : σ
- core : N
- stop : σ
Instances For
def
IndexedDFA.instDecidableEqNt.decEq
{N✝ σ✝ : Type}
[DecidableEq N✝]
[DecidableEq σ✝]
(x✝ x✝¹ : nt N✝ σ✝)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
instance
IndexedDFA.instDecidableEqNt
{N✝ σ✝ : Type}
[DecidableEq N✝]
[DecidableEq σ✝]
:
DecidableEq (nt N✝ σ✝)
def
IndexedGrammar.dfaBinaryRule
{T σ : Type}
(g : IndexedGrammar T)
(r : IRule T g.nt g.flag)
(p m q : σ)
(B C : g.nt)
:
IRule T (IndexedDFA.nt g.nt σ) g.flag
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
IndexedGrammar.dfaPopRule
{T σ : Type}
(g : IndexedGrammar T)
(r : IRule T g.nt g.flag)
(p q : σ)
(f : g.flag)
(B : g.nt)
:
IRule T (IndexedDFA.nt g.nt σ) g.flag
Equations
Instances For
def
IndexedGrammar.dfaPushRule
{T σ : Type}
(g : IndexedGrammar T)
(r : IRule T g.nt g.flag)
(p q : σ)
(f : g.flag)
(B : g.nt)
:
IRule T (IndexedDFA.nt g.nt σ) g.flag
Equations
Instances For
def
IndexedGrammar.dfaTerminalRule
{T σ : Type}
(g : IndexedGrammar T)
(M : DFA T σ)
(r : IRule T g.nt g.flag)
(p : σ)
(a : T)
:
IRule T (IndexedDFA.nt g.nt σ) g.flag
Equations
Instances For
def
IndexedGrammar.dfaRulesFor
{T σ : Type}
[Fintype σ]
(g : IndexedGrammar T)
(M : DFA T σ)
(r : IRule T g.nt g.flag)
:
List (IRule T (IndexedDFA.nt g.nt σ) g.flag)
All DFA-threaded copies of one indexed-normal-form rule. Malformed rules contribute no product rules.
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
IndexedGrammar.dfaProduct
{T σ : Type}
[Fintype σ]
(g : IndexedGrammar T)
(M : DFA T σ)
(p q : σ)
:
Product of a normal-form indexed grammar and a DFA, with fixed initial and final DFA states.
Equations
- g.dfaProduct M p q = { nt := IndexedDFA.nt g.nt σ, flag := g.flag, initial := { start := p, core := g.initial, stop := q }, rules := List.flatMap (g.dfaRulesFor M) g.rules }
Instances For
theorem
Indexed_of_Indexed_inter_regular
{T : Type}
[Fintype T]
(L R : Language T)
(hL : is_Indexed L)
(hR : R.IsRegular)
:
is_Indexed (L ⊓ R)
An indexed language intersected with a regular language is indexed.
Predicate-form closure theorem used by the closure table.