Sixteenth Lecture
Wednesday, November 1st.
Pushdown Automata and Context-Free Languages
There are two easy but important theorems.
Theorem: For any context-free language L given by a grammar G, there is a (nondeterministic) pda M such that
L(G) = L(M)
The proof is an almost immediate consequence of the Greibach Normal Form (see the
proof in Kozen.)
Perhaps it is interesting to see that the normal form is not necessary.
Exercise modify the proof in the book for arbitrary grammars.
Hints:
- For a production of the form
A ----> BC...Z
do not move input head, put BC...Z on stack
- For productions of the form
A ----> alpha a beta
where a is a terminal and alpha is nonempty, get a new nonterminal A' and use
instead the productions
A ----> alpha A' beta
A' ----> a
For any pda M there is a context-free grammar G such that L(M) = L(G)
The previous theorem is almost 1-1: the only difficulty is that the pda whose
simulation is obvious has a single state. So we prove a lemma that any pda
can be simulated by a single-state one!