Definition (Generalized Nondeterministic Finite Automaton).
A GNFA over states Q and alphabet σ is like an NFA, but its transitions
are labeled with regular expressions rather than single symbols. For
convenience we assume:
- one
startstate and oneacceptstate (distinct,start_ne_accept); - one arrow
δ q q'(a regex) between every pair of states, with the restrictions that no arrow enters thestartstate (no_enter_start) and no arrow exits theacceptstate (no_exit_accept).
- start : Q
- accept : Q
- δ : Q → Q → RegularExpression σ
Instances For
AcceptPath G q q' w says that the word w labels a path in the GNFA G
from state q to state q': either w = [] and the path is the trivial
self-loop at q (nil), or w = w₁ ++ w₂ where some prefix w₁ reaches
an intermediate state qmid and w₂ is matched by the regex G.δ qmid q'
labelling the edge from qmid to q' (cons).
- nil {Q : Type u_1} {σ : Type u_2} [Fintype Q] {G : GNFA Q σ} (q : Q) : G.AcceptPath q q []
- cons {Q : Type u_1} {σ : Type u_2} [Fintype Q] {G : GNFA Q σ} {q qmid q' : Q} {w₁ w₂ : List σ} (path : G.AcceptPath q qmid w₁) (hmatch : w₂ ∈ (G.δ qmid q').matches') : G.AcceptPath q q' (w₁ ++ w₂)
Instances For
theorem
Sipser.GNFA.AcceptPath.trans
{Q : Type u_1}
{σ : Type u_2}
[Fintype Q]
{q₁ q₂ : Q}
{w₁ : List σ}
{q₃ : Q}
{w₂ : List σ}
{G : GNFA Q σ}
(h₁ : G.AcceptPath q₁ q₂ w₁)
(h₂ : G.AcceptPath q₂ q₃ w₂)
:
G.AcceptPath q₁ q₃ (w₁ ++ w₂)
Concatenation of accept paths: if w₁ labels a path from q₁ to q₂
and w₂ labels a path from q₂ to q₃, then w₁ ++ w₂ labels a path
from q₁ to q₃.