Table of Contents

12. Pumping Lemma for Context-Free Languages and Recap

Pumping Lemma for CFL: Let $ L $ be a context-free language. Then, there exists an integer $ n \geq 1$ such that

every $ w\in L $ having $ |w|\geq n $ can be written as $ w = uxyzw $ with $$ \begin{align} & |xz| \geq 1 \\ & |xyz| \leq n \\ & ux^kyz^kw \in L \ \ \ \ \ \forall k \geq 0 \end{align}$$

12.1. Finding the class of languages

For each of the following languages, find the most restrictive class of languages that it belongs to (regular, context-free but not regular, not context-free). Prove the language belongs to that class by finding a generator/acceptor and/or using the complement of the pumping lemma.

12.1.1. $ L_1 = \{ a^nb^mc^nd^m \ |\ n, m \geq 0 \} $

12.1.2. $ L_2 = \{ a^nb^mc^md^n \ |\ n, m \geq 0 \} $

12.2. Recap

For each of the conditions below, find non-regular languages $ L_1, L_2 $ satisfying:

12.2.1. $ L_1 \cup L_2 $ is context-free

12.2.2. $ L_1 \cap L_2 $ is context-free

12.2.3. $ \overline{L_1} $ is context-free

12.2.4. $ L_1 \cap L_2 $ is not context-free

12.2.5. $ L_1L_2 $ is context-free

For each of the exercises above, prove the language indeed is/isn't context-free using PDAs/CFGs/the complement of the Pumping Lemma