The Pumping Lemma for CFL's
We learned the Pumping Lemma for Regular Languages in previous chapter. It shows that we can have a string in a regular language that can be divided into three parts, whose middle part can be repeated any times. This lemma is very useful in proving regularity. Correspondingly, we have the Pumping Lemma for Context-Free Languages.
The Lemma and Proof
The Lemma is more complicated than the one for regular languages. Its statement is as follows:
For every context-free language
- For all
,
An intuitive explanation is that for every string in a CFL, we can expand one non-terminal symbol
Repeat Production: A intuitive visual perception of the Pumping Lemma
An anticipated question is: How to find the symbol
Proof
Proof of the Pumping Lemma
We consider a context-free grammar
Using the Pumping Lemma
Show that the language
Proof Suppose
Consider the string
If