1 / 14

Pumping Lemma for CFL

[Section 8.1]. Pumping Lemma for CFL. Let G = (V,  ,S,P) be a CFG. Suppose we have a string u 2 L(G) with the following derivation: S ) * vAz ) * vwAyz ) * vwxyz = u where v,w,x,y,z 2  * and A 2 V. Which other strings (besides u) can be generated by G ?. [Section 8.1].

Download Presentation

Pumping Lemma for CFL

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. [Section 8.1] Pumping Lemma for CFL Let G = (V,,S,P) be a CFG. Suppose we have a string u 2 L(G) with the following derivation: S )* vAz )* vwAyz )* vwxyz = u where v,w,x,y,z 2* and A 2 V. Which other strings (besides u) can be generated by G ?

  2. [Section 8.1] Pumping Lemma for CFL Let G = (V,,S,P) be a CFG. Suppose we have a string u 2 L(G) with the following derivation: S )* vAz )* vwAyz )* vwxyz = u where v,w,x,y,z 2*. Which other strings (besides u) can be generated by G ? vwmxymz 2 L(G) for every m ¸ 0 Is it true that for every sufficiently long u there exist v,w,x,y,z satisfying the above derivation ?

  3. [Section 8.1] Pumping Lemma for CFL Let G = (V,,S,P) be a CFG. Suppose G is in Chomsky normal form, i.e., every rule is of the form A  or A  A1A2 where A,A1,A22 V and 2 (plus we allow the rule S ). Let’s look at a derivation tree for some u 2 L(G).

  4. [Section 8.1] Pumping Lemma for CFL Thm (Pumping lemma for CFL) : Let L be a CFL. Then there exists an integer n > 0 such that for every u 2 L with |u| ¸ n there exist strings v,w,x,y,z satisfying: (1) u = vwxyz (2) |wxy| · n (3) |wy| > 0 (4) vwmxymz 2 L for every m ¸ 0

  5. [Section 8.1] Pumping Lemma for CFL Example: L = { akbkck | k ¸ 0 }

  6. [Section 8.1] Pumping Lemma for CFL Example: L = { aibjck | 0 · i · j · k }

  7. [Section 8.2] Closure Properties, Part II Lemma: CFL’s are not closed under intersection.

  8. [Section 8.2] Closure Properties, Part II Lemma: CFL’s are not closed under complement.

  9. [Section 8.2] Closure Properties, Part II Lemma: CFL’s are not closed under difference.

  10. [Section 8.2] Closure Properties, Part II Lemma: CFL’s are closed under intersection with a regular language.

  11. [Section 8.2] Closure Properties, Part II Example: L = { w 2 {a,b,c}* | na(w) = nb(w) = nc(w) }

  12. [Section 8.3] Decision Problems for CFL’s • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given a CFL L (by a PDA or a CFG) and a string x, is x in L ?

  13. [Section 8.3] Decision Problems for CFL’s • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given a CFL L (by a PDA or a CFG), is L = ; ?

  14. [Section 8.3] Decision Problems for CFL’s • A decision problem : answer is YES or NO. • Give algorithms for the following decision problems : • Given a CFL L (by a PDA or a CFG), is L finite ?

More Related