[PDF] CFL Pumping Lemma
[PDF] CFL Pumping Lemma
[PDF] CFL Pumping Lemma
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2 CS 516<br />
2. Proving some languages are not context-free<br />
The sole purpose of the <strong>Pumping</strong> <strong>Lemma</strong> is to prove that certain languages<br />
are not context-free. The proofs generally follow this pattern:<br />
(1) Assume L is context-free (with the hopes of yielding a contradiction)<br />
and thus has a “pumping number” N.<br />
(2) Pick a cleverly crafted string z such that z ∈ L and |z| ≥ N. We<br />
don’t know N in general so z is always defined in terms of N.<br />
(3) Since z ∈ L and |z| ≥ N, all four conditions of the lemma must<br />
apply.<br />
(4) We deduce “something useful” about v and x from the first three<br />
conditions. Often we must consider several possible cases.<br />
(5) Using our knowledge of what v and x must look like, we pick a value<br />
i such that uv i wx i y ∉ L contradicting the last condition.<br />
For example, we can show L = {a n b n c n | n ≥ 0} is not context-free as<br />
follows.<br />
(1) Assume L is context-free and thus has a “pumping number” N.<br />
(2) Let z = a N b N c N .<br />
(3) Since z ∈ L and |z| = 3N ≥ N, the four conditions of the <strong>Pumping</strong><br />
<strong>Lemma</strong> must apply.<br />
(4) Therefore, there exists strings u, v, w, x, y such that<br />
z = uvwxy = a } .{{ . . a}<br />
b } .{{ . . b}<br />
c } .{{ . . c}<br />
.<br />
N N N<br />
(5) Since |vwx| ≤ N we have<br />
v, x ∈ a ∗ ∪ b ∗ ∪ c ∗ ∪ a ∗ b ∗ ∪ b ∗ c ∗<br />
(6) If either v or x is in the set a + b + ∪b + c + then uv 2 wx 2 y ∉ a ∗ b ∗ c ∗ ⊃ L.<br />
(7) So v, x ∈ a ∗ ∪ b ∗ ∪ c ∗ but v and x are not both empty. Therefore<br />
uv 2 wx 2 y does not contain an equal number of a’s, b’s, and c’s and<br />
thus can not be in L. □<br />
Note that L is context-sensitive:<br />
S → aSBC | aBC<br />
CB → BC<br />
aB → ab<br />
bB → bb<br />
bC → bc<br />
cC → cc<br />
Notes:<br />
• Regular languages are “1-pumpable.”<br />
• Context-free languages are “2-pumpable.”<br />
• As before, you only get to pick z and i. The nature of the strings<br />
u, v, w, x, y are deduced from the first three conditions.