Non-Context-Free Languages Section 2.3 CSC 4170 Theory of Computation.

Slides:



Advertisements
Similar presentations
Pumping Lemma Problem: Solution:
Advertisements

Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
NL equals coNL Section 8.6 Giorgi Japaridze Theory of Computability.
CS 3240: Languages and Computation Properties of Context-Free Languages.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
CS21 Decidability and Tractability
Turing machines Sipser 2.3 and 3.1 (pages )
Turing machines Sipser 2.3 and 3.1 (pages )
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Lecture 15UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 15.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
Chap 2 Context-Free Languages. Context-free Grammars is not regular Context-free grammar : eg. G 1 : A  0A1substitution rules A  Bproduction rules B.
Courtesy Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
Courtesy Costas Busch - RPI1 Non-regular languages.
Fall 2003Costas Busch1 More Applications of The Pumping Lemma.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Fall 2006Costas Busch - RPI1 More Applications of the Pumping Lemma.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.3: Non-Context-Free Languages) David Martin With.
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
Homework #7 Solutions. #1. Use the pumping lemma for CFL’s to show L = {a i b j a i b j | i, j > 0} is not a CFL. Proof by contradiction using the Pumping.
1 Non-regular languages. 2 Regular languages Non-regular languages.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
Costas Busch1 More Applications of The Pumping Lemma.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
1 Properties of Context-Free Languages Is a certain language context-free? Is the family of CFLs closed under a certain operation?
CSCI 2670 Introduction to Theory of Computing September 22, 2005.
Context-Free and Noncontext-Free Languages Chapter 13 1.
Cs3102: Theory of Computation Class 8: Non-Context-Free Languages Spring 2010 University of Virginia David Evans.
Test # 2 Friday, November 2 nd Covers all of Chapter 2 Test # 2 will be 20% of final score (same as Test #1) Final Exam will be 40% of the final score.
Non-CF Languages The language L = { a n b n c n | n  0 } does not appear to be context-free. Informal: A PDA can compare #a’s with #b’s. But by the time.
CS355 - Theory of Computation Regular Expressions.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
Critique this PDA for L= { u u R v v R : u ∈ {0,1}* and v ∈ {0,1}+ } u0εu0 u1εu1 uεεvε v00vε v11vε vεεfε sεεtε t0εt0 t1εt1 t00tε t11tε tεεuε After you.
CSCI 2670 Introduction to Theory of Computing September 23, 2004.
1 Applications of pumping lemma(Dr. Torng) Applications of Pumping Lemma –General proof template What is the same in every proof What changes in every.
January 20, 2016CS21 Lecture 71 CS21 Decidability and Tractability Lecture 7 January 20, 2016.
1 Find as many examples as you can of w, x, y, z so that w is accepted by this DFA, w = x y z, y ≠ ε, | x y | ≤ 7, and x y n z is in L for all n ≥ 0.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
CS 154 Formal Languages and Computability March 17 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
 2004 SDU Lecture8 NON-Context-free languages.  2004 SDU 2 Are all languages context free? Ans: No. # of PDAs on  < # of languages on  Pumping lemma:
CS 461 – Oct. 5 Pumping lemma #2 –Understanding –Use to show a language is not a CFL Next: Applications of CFLs –Expression grammars and Compiling.
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Context-Free and Noncontext-Free Languages Chapter 13.
Context-Free Languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
CSC 4170 Theory of Computation Turing reducibility Section 6.3.
Non-Context-Free Languages
Context-Free Grammars
Context-Free Languages
COSC 3340: Introduction to Theory of Computation
Elementary Questions about Regular Languages
Pumping Lemma September 29, 2006
More Applications of the Pumping Lemma
COSC 3340: Introduction to Theory of Computation
Chapter 2 Context-Free Language - 02
COSC 3340: Introduction to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Presentation transcript:

Non-Context-Free Languages Section 2.3 CSC 4170 Theory of Computation

The pumping lemma for context-free languages 2.3.a Giorgi Japaridze Theory of Computability 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, uv i xy i z  L; 2. |vy| > 0; 3. |vxy|  p. uvxyzuvxyz uxzuxz uvvxyyz uvvvxyvvz uvvvvxyyyyz uvvvvvxyyyyyz

The pumping lemma in work: example 2.3.b Giorgi Japaridze Theory of Computability 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 … “((0)*)*” is a regular expression u = “( v = ( x = 0 y = )* z = )*” is a regular expression uv 0 xy 0 z: “(0)*” is a regular expression uv 1 xy 1 z: “((0)*)*” is a regular expression uv 2 xy 2 z: “(((0)*)*)*” is a regular expression uv 3 xy 3 z: “((((0)*)*)*)*” is a regular expression

Using the pumping lemma for proving that certain languages are not CF 2.3.c Giorgi Japaridze Theory of Computability Example 2.36: Show that the following language is not CF: B = {a n b n c n | 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 and y 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  B aaaababbbbccccc  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B

Regular vs context-free vs computer-recognizable languages 2.3.d Giorgi Japaridze Theory of Computability Regular languages Context-free languages {a n b n | n  0} {a n b n c n | n  0} Computer-recognizable languages