Chapter 2: Context-Free Languages
For Your Enjoyment
Chapter 2.3, Non-Context-Free Languages
CFL Pumping Lemma
If A is a context-free language, then there is a number p
(the pumping length) where, if s is any string in A of length
at least p, then s may be divided into five pieces s = uvxyz satisfying
the conditions
- for each i ≥ 0, uvixyiz ∈ A,
- |vy| > 0, and
- |vxy| ≤ p.
Lecture Problem
- Use the pumping lemma to show that A =
{anbncn | n ≥ 0} is not context-free.
Active Learning Problem
- Use the pumping lemma to show that B = {wwRw | w ∈ {0,1}*}
is not context-free.
- Show that the string 0p0p0p
can be pumped.
- Show that the string 0p110p0p1
can be pumped.