1 / 7

CS310

CS310. Non-Context-Free Languages Sections: 2.3 page 123 October 20, 2006. Pumping Lemma (take two). Theorem: For any CFG there is an equivalent grammar in CNF. Pumping lemma (CFG): Suppose A is a CFG. There exists a number p such that if s  A and |s|  p then s = udxyz where

ryu
Download Presentation

CS310

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS310 Non-Context-Free Languages Sections: 2.3 page 123 October 20, 2006

  2. Pumping Lemma (take two) • Theorem: For any CFG there is an equivalent grammar in CNF. • Pumping lemma (CFG): Suppose A is a CFG. There exists a number p such that • if s  A and |s|  p then s = udxyz where udixyiz  A, i  0 |dy| > 0 |dzy|  p Note: Your book uses uvxyz But, capital V is the set of variables for the grammar so that can get confusing

  3. Pumping a Parse Tree T | R | R T | R | R | R u d x y z u d y z d x y ud1xy1z ud2xy2z

  4. Proof • Suppose A is a CFG in CNF and s  A, |s|  p = 2 |V|+1 2 because the language is in CNF and that produces a binary parse tree The height of the parse tree for s is V+1, so we have used the same variable twice! Therefore, the string can be pumped.

  5. Example • L = {aibici | i  0} • a PDA cannot represent this. Why? • Pumping Lemma: s = apbpcp |dxy|  p What may dxy contain? What happens when we pump d and y?

  6. Example • L = { ww | w  {0, 1}* } s =

  7. Example • L = { w # x | w is substring of x; w,x  {0, 1}* }

More Related