A right-regular grammar (RRG) is a CFG whose rules are all of the form: \[ A \to a B \or \emptystring \]
Theorem: Every DFA-decidable language is RRG-decidable (and thus CFG-decidable).
Given any DFA \(D\), we can convert it into RRG \(G\) such that \(L(G) = L(D).\) In other words \(G\) generates string \(w\) iff \(D\) accepts \(w\).
Construction Example:
Equivalent grammar \(G\): \[\begin{align*} P &\to \fragment{0T\;|\;} \fragment{1R} \\ T &\to \fragment{0R\;|\;} \fragment{1P} \\ R &\to \fragment{0P\;|\;} \fragment{1R} \\ P &\to \emptystring \\ T &\to \emptystring \end{align*}\]
Parse tree for \(0110\):
Derivation of \(0110\): \[ \fragment{P} \fragment{\yields 0T} \fragment{\yields 01P} \fragment{\yields 011R} \fragment{\yields 0110P} \fragment{\yields 0110} \]
Computational sequence accepting \(0011\): \[ p, t, p, r, p \]
A right-regular grammar (RRG) is a CFG whose rules are all of the form: \[ A \to a B \or \emptystring \]
Theorem: Every DFA-decidable language is RRG-decidable (and thus CFG-decidable).
Given any DFA \(D\), we can convert it into RRG \(G\) such that \(L(G) = L(D).\) In other words \(G\) generates string \(w\) iff \(D\) accepts \(w\).
Proof
We now prove \(L(G) = L(D)\).
A right-regular grammar (RRG) is a CFG whose rules are all of the form: \[ A \to a B \or \emptystring \]
Theorem: Every DFA-decidable language is RRG-decidable (and thus CFG-decidable).
Given any DFA \(D\), we can convert it into RRG \(G\) such that \(L(G) = L(D).\) In other words \(G\) generates string \(w\) iff \(D\) accepts \(w\).
Proof
A right-regular grammar (RRG) is a CFG whose rules are all of the form: \[ A \to a B \or \emptystring \]
Theorem: Every DFA-decidable language is RRG-decidable (and thus CFG-decidable).
Given any DFA \(D\), we can convert it into RRG \(G\) such that \(L(G) = L(D).\) In other words \(G\) generates string \(w\) iff \(D\) accepts \(w\).
Proof
Thus \(w \in L(G)\), showing \(L(D) = L(G)\).
Theorem: Any RRG-decidable language is NFA-decidable (and thus DFA-decidable).
Proof
\(Q = \Gamma\)
\(s = S\)
\(F = \setbuild{X \in Q}{\fragment{(X, \emptystring) \in \rho}}\)
For all \(X \in Q\) and \(a \in \Sigma\): \(\Delta(X, a) = \setbuild{B \in Q}{\fragment{(X, a Y) \in \rho}}\)
(For each production rule of the form \(X \to a Y\), add the transition \(X \stackrel{a}{\to} Y\))
Corollary: a language is DFA-decidable if and only if it is DFA-decidable.
Corollary: RRGs, DFAs, and NFAs have equivalent computational power.
A left-regular grammar (LRG) is a CFG whose rules are all of the form: \[ A \to B a \or \emptystring \]
\[\begin{align*} A &\to 0B \\ B &\to A1 \\ A &\to \emptystring \end{align*}\]
\(\setbuild{0^n1^n}{n \in \N}\qquad\) not regular!