-
Notifications
You must be signed in to change notification settings - Fork 0
/
lec15.tex
37 lines (31 loc) · 831 Bytes
/
lec15.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
\begin{align*}
S &\mapsto aSc \mid T \\
T &\mapsto bT \mid \varepsilon
\end{align*}
Clearly, the grammar above describes a language
\[
L(G) = \set{ a^m b^n c^m },
\]
e.g. abc, which is generated through
\[
S \mapsto aSc \mapsto aTc \mapsto abTc \mapsto ab\varepsilon c \mapsto abc.
\]
Claim:
\begin{align*}
\forall \text{\upshape CFG} G = \lst{V,\Sigma,S,R}, \\
\exists \text{\upshape PDA} P = \lst{Q,\Sigma,\Gamma,\delta,s,F} \text{ s.t.\ } \\
L(G) = L(P)
\end{align*}
\begin{proof}
\[
\abs Q = 4 + \sum_{(x \to \alpha) \in R} \max( \abs \alpha -1, 0 )
\]
\end{proof}
Claim: $P \mapsto G$
\begin{align*}
V &= \set{ A_{pq} \mid p, q \in Q } \\
S &= A_{sf} \\
A_{pp} \mapsto \varepsilon
A_{pq} \mapsto A_{pr} A_{rq}
A_{pq} \mapsto A_{pr} A_{rq}
\end{align*}