Seventeenth Lecture

Friday, November 3.

The pumping lemma for Context-Free Languages


Also known as the uvwxy theorem: if cfl L has a "long enough string, it can be written as
uvwxy
and all strings of the form
u v^i w x^i y
are in the language.

Intuitive thing to remember: can have 2 things match (in reverse).

Proof is almost identical to pumping lemma for regular languages: in a derivation tree, a long enough path from root to leaf
must have a repeated nonterminal.
(So "long enough" = at least as long as the number of nonterminals, and if grammar is in CNF, if length of string generated is n, there must be a path of length log n)

For ambitious students: read supplementary Lecture C on Automata on Terms. These are essentially finite automata that work on trees. They have a pumping lemma (by pigeonhole principle). This is equivalent to the proof of uvwxy theorem. Confused? see me.