{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes24 Non-Context-Freeness and Pumping Lemma

notes24 Non-Context-Freeness and Pumping Lemma - CS 373...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1 Introduction 1.1 Non-context-free languages Non-Context Free Languages Question Are there languages that are not context-free? What about L = { a n b n c n | n 0 } ? Answer L is not context-free, because Recognizing if w L requires remembering the number of a s seen, b s seen and c s seen We can remember one of them on the stack (say a s) , and compare them to another (say b s) by popping, but not to both b s and c s The precise way to capture this intuition is through the pumping lemma 1.2 Pumping Lemma Pumping Lemma for CFLs Informal Statement For all sufficiently long strings z in a context free language L , it is possible to find two substrings, not too far apart, that can be simultaneously pumped to obtain more words in L . Pumping Lemma for CFLs Formal Statement Lemma 1. If L is a CFL, then p (pumping length) such that z L , if | z | ≥ p then u, v, w, x, y such that z = uvwxy 1. | vwx | ≤ p 2. | vx | > 0 3. i 0 . uv i wx i y L Two Pumping Lemmas side-by-side Context-Free Languages If L is a CFL, then p (pumping length) such that z L , if | z | ≥ p then u, v, w, x, y such that z = uvwxy 1. | vwx | ≤ p 2
Background image of page 2
2. | vx | > 0 3. i 0 . uv i wx i y L Regular Languages If L is a regular language, then p (pumping length) such that z L , if | z | ≥ p then u, v, w such that z = uvw 1. | uv | ≤ p 2. | v | > 0 3. i 0 . uv i w L Pumping Lemma for CFLs Game View Game between Defender , who claims L satisfies the pumping condition, and Chal- lenger, who claims L does not. Defender Challenger Pick pumping length p p -→ z ←- Pick z L s.t. | z | ≥ p Divide z into u, v, w, x, y s.t. | vwx | ≤ p , and | vx | > 0 u,v,w,x,y -→ i ←- Pick i , s.t. uv i wx i y 6∈ L Pumping Lemma: If L is CFL, then there is always a winning strategy for the defender (i.e.,
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}