1 / 5

Non-Context-Free Languages

CSC 4170 Theory of Computation. Non-Context-Free Languages. Section 2.3. 2.3.a. Giorgi Japaridze Theory of Computability. The pumping lemma for context-free languages. Theorem 2.34 (Pumping lemma for context-free languages)

kylee-vang
Download Presentation

Non-Context-Free Languages

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. CSC 4170 Theory of Computation Non-Context-Free Languages Section 2.3

  2. 2.3.a Giorgi JaparidzeTheory of Computability The pumping lemma for context-free languages Theorem 2.34(Pumping lemma for context-free languages) If L is a context-free language, then there is a number p (the pumping length) where, if s is any string in L of length at least p, then s may be divided into five pieces s = uvxyz satisfying the conditions: 1. For each i0, uvixyizL; 2. |vy| > 0; 3. |vxy| p. uxz uvxyz uvvxyyz uvvvxyvvz uvvvvxyyyyz uvvvvvxyyyyyz

  3. 2.3.b Giorgi JaparidzeTheory of Computability The pumping lemma in work: example S  “R” is a regular expression R  0 | ( R )* “0” is a regular expression “(0)*” is a regular expression “((0)*)*” is a regular expression “(((0)*)*)*” is a regular expression … u = “( v = ( x = 0 y = )* z = )*” is a regular expression “((0)*)*” is a regular expression uv0xy0z: “(0)*” is a regular expression uv1xy1z: “((0)*)*” is a regular expression uv2xy2z: “(((0)*)*)*” is a regular expression uv3xy3z: “((((0)*)*)*)*” is a regular expression

  4. 2.3.c Giorgi JaparidzeTheory of Computability Using the pumping lemma for proving that certain languages are not CF Example 2.36: Show that the following language is not CF: B = {anbncn | n0} Proof by contradiction: Assume B is CF. Let then p be its pumping length. Select wB with |w| p. By the pumping lemma, w=uvxyz and v andy can be pumped. If either v or y contain more than one type of symbols, then pumping would intermix these symbols in a wrong way. aaaabbbbccccBaaaababbbbcccccB Thus, one of the three symbols should be neither in neither v, nor in y. aaaabbbbccccB But then, after pumping, the number of that symbol will not change, while the number of the other symbols will increase. aaaaaabbbbbbbbcccc B

  5. 2.3.d Giorgi JaparidzeTheory of Computability Regular vs context-free vs computer-recognizable languages Computer-recognizable languages Context-free languages Regular languages {anbn | n0} {anbncn | n0}

More Related