With this pumping lemma, we were able to show that anbn is not a regular language.
Suppose a variable repeats, such as: A∗⇒vAy, with A∗⇒x.
The derived string will then contain the substring vxy. There will also be strings in the language that contain substrings x,vvxyy,vvvxyyy...
A little more complicated because there can be two “pumped” parts (in equal measure of pumped-ness).
There is a CFG G such that L=L(G).
Consider the parse tree of a long string in L.
For any long string, some nonterminal N must appear twice in the path.
<< How does this work for grammar S→aSb|ab? >>
Consider L={anbncn:n≥1}.
Why would we want to recognize the language {anbncn:n≥1}?
Recognize underlined words:
word_ is stored as wordββββ _ _ _ _ where β represents a backspace.
Unfortunately, L is not a CFL.
What if we try to prove that L=anbn is not context free, by using the pumping lemma?
Pick w=ambm.
Adversary picks v=ak and y=bk.
Of course, this does not prove that L is context free. Just that we failed to disprove this with the pumping lemma (that is a good thing).
Prove that L={ww∣w∈{a,b}∗} is not a CFL.
Consider the string w=ambmambm.
Prove that L{an!∣n≥0} is not a CFL.