Title: Non-Context-Free Languages
1Non-Context-Free Languages
CSC 4170 Theory of Computation
Section 2.3
2The pumping lemma for context-free languages
2.3.a
Giorgi Japaridze Theory of Computability
Theorem 2.34 (Pumping lemma for context-free
languages) If L is a context-free language, then
there is a number p (the pumping length) where,
if s is any string in L of length at least p,
then s may be divided into five pieces s
uvxyz satisfying the conditions 1. For
each i?0, uvixyiz ?L 2. vy gt 0
3. vxy? p.
uxz
uvxyz
uvvxyyz
uvvvxyvvz
uvvvvxyyyyz
uvvvvvxyyyyyz
3The pumping lemma in work example
2.3.b
Giorgi Japaridze Theory of Computability
S ? R is a regular expression R ? 0 ( R )
0 is a regular expression (0) is a regular
expression ((0)) is a regular
expression (((0))) is a regular expression
u ( v ( x 0 y ) z ) is a regular
expression
((0)) is a regular expression
uv0xy0z (0) is a regular expression
uv1xy1z ((0)) is a regular
expression uv2xy2z (((0))) is a
regular expression uv3xy3z ((((0))))
is a regular expression
4Using the pumping lemma for proving that certain
languages are not CF
2.3.c
Giorgi Japaridze Theory of Computability
Example 2.36 Show that the following language is
not CF
B anbncn n?0
Proof by contradiction Assume B is CF. Let
then p be its pumping length. Select w?B with
w ? p. By the pumping lemma, wuvxyz and v
and y can be pumped.
If either v or y contain more than one type of
symbols, then pumping would intermix these
symbols in a wrong way. aaaabbbbcccc
?B aaaababbbbccccc ?B
Thus, one of the three symbols should be
neither in neither v, nor in y.
aaaabbbbcccc ?B
But then, after pumping, the number of that
symbol will not change, while the number of the
other symbols will increase.
aaaaaabbbbbbbbcccc
?B
5Regular vs context-free vs computer-recognizable
languages
2.3.d
Giorgi Japaridze Theory of Computability
Computer-recognizable languages
Context-free languages
Regular languages
anbn n?0
anbncn n?0