Non-Context-Free Languages Sections: 2.3 page 123 October 17, 2008

Slides:



Advertisements
Similar presentations
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
Advertisements

CSCI 3130: Formal languages and automata theory Tutorial 5
Erik Jonsson School of Engineering and Computer Science FEARLESS Engineering CS 4384 – 001 Automata Theory Thursday: Context-Free.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
CS 3240: Languages and Computation Properties of Context-Free Languages.
1 Introduction to Computability Theory Lecture5: Context Free Languages Prof. Amos Israeli.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 11, 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.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 9, 2006.
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
Fall 2004COMP 3351 NPDA’s Accept Context-Free Languages.
1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.
Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSE 3813 Introduction to Formal Languages and Automata Chapter 8 Properties of Context-free Languages These class notes are based on material from our.
The Pumping Lemma for Context Free Grammars. Chomsky Normal Form Chomsky Normal Form (CNF) is a simple and useful form of a CFG Every rule of a CNF grammar.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
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.
Review for final pm. 2 Review for Midterm Induction – On integer: HW1, Ex 2.2.9b p54 – On length of string: Ex p53, HW2, HW3.
Pumping Lemma for CFLs. Theorem 7.17: Let G be a CFG in CNF and w a string in L(G). Suppose we have a parse tree for w. If the length of the longest path.
Chapter 8 Properties of Context-free Languages These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata,
Transparency No. P2C5-1 Formal Language and Automata Theory Part II Chapter 5 The Pumping Lemma and Closure properties for Context-free Languages.
Lecture # 31 Theory Of Automata By Dr. MM Alam 1.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
 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.
7. Properties of Context-Free Languages
NPDAs Accept Context-Free Languages
Lecture 17 Oct 25, 2011 Section 2.1 (push-down automata)
Context Free Languages
NPDAs Accept Context-Free Languages
Context Free Pumping Lemma Some languages are not context free!
An Interactive Approach to Formal Languages and Automata with JFLAP
Context-free Languages
Definition: Let G = (V, T, P, S) be a CFL
7. Properties of Context-Free Languages
Context-Free Grammars
Context-Free Languages
فصل دوم Context-Free Languages
COSC 3340: Introduction to Theory of Computation
Deterministic PDAs - DPDAs
The Pumping Lemma for CFL’s
Pumping Lemma for Context-free Languages
Properties of Context-Free Languages
Department of Computer Science & Engineering
Midterm #2 — Review problems
Chapter 2 Context-Free Language - 01
COSC 3340: Introduction to Theory of Computation
CS21 Decidability and Tractability
Theory of Computation Lecture #
Chapter 2 Context-Free Language - 02
DPDA Deterministic PDA
Computer Language Theory
CS21 Decidability and Tractability
Recap lecture 42 Row language, nonterminals defined from summary table, productions defined by rows, rules for defining productions, all possible productions.
The Pumping Lemma for CFL’s
Applications of Regular Closure
Automata, Grammars and Languages
The Pumping Lemma for CFL’s
Intro to Theory of Computation
Context-Free Languages
Presentation transcript:

Non-Context-Free Languages Sections: 2.3 page 123 October 17, 2008 CS310 Non-Context-Free Languages Sections: 2.3 page 123 October 17, 2008

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 |dxy|  p For the NFA, P was the number of states in the machine. Here P is the number of Non-Terminals in the language. Key, we can pump a string and keep it in the language. By pumping the string we add a level to the parse tree which could produce pumped terminals around the middle. Note: Your book ugses uvxyz But, capital V is the set of variables for the grammar so that can get confusing

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

Proof Suppose A is a CFG in CNF and s  A, |s|  p = 2 |V|+1 2 ? The height of the parse tree for s is ?

Example L = {aibici | i  0} a PDA cannot represent this. Why? Pumping Lemma: s = u= d= x= y= z=

Example L = {aibjck | k  j  i  0} a PDA cannot represent this. Why? Pumping Lemma: s = u= d= x= y= z=

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

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