Fall 2003Costas Busch1 More Applications of The Pumping Lemma.

Slides:



Advertisements
Similar presentations
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Advertisements

Pumping Lemma Problem: Solution:
4.5 Inherently Ambiguous Context-free Language For some context-free languages, such as arithmetic expressions, may have many different CFG’s to generate.
Fall 2006Costas Busch - RPI1 Non-regular languages (Pumping Lemma)
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
CS 3240: Languages and Computation Properties of Context-Free Languages.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Courtesy Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
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.
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 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
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.
Courtesy Costas Busch - RPI1 Non-regular languages.
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.
1 More Applications of The Pumping Lemma. 2 The Pumping Lemma: there exists an integer such that for any string we can write For infinite context-free.
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
Prof. Busch - LSU1 Pumping Lemma for Context-free Languages.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
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.
Costas Busch - RPI1 More Applications of the Pumping Lemma.
1 Applications of Regular Closure. 2 The intersection of a context-free language and a regular language is a context-free language context free regular.
1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.
Costas Busch1 More Applications of The Pumping Lemma.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
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.
1 L= { w c w R : w  {a, b}* } is accepted by the PDA below. Use a construction like the one for intersection for regular languages to design a PDA that.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
Context Free Pumping Lemma. CFL Pumping Lemma A CFL pump consists of two non-overlapping substrings that can be pumped simultaneously while staying in.
Non-Context-Free Languages Section 2.3 CSC 4170 Theory of Computation.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
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.
Costas Busch - LSU1 Pumping Lemma for Context-free Languages.
Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language.
 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:
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
More Applications of the Pumping Lemma
Undecidable Problems Costas Busch - LSU.
NPDAs Accept Context-Free Languages
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
DPDA Deterministic PDA
Non-Context-Free Languages
Deterministic PDAs - DPDAs
The Post Correspondence Problem
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
Undecidable problems:
Properties of Context-Free languages
More Applications of the Pumping Lemma
Chapter 2 Context-Free Language - 02
DPDA Deterministic PDA
More Applications of The Pumping Lemma
Applications of Regular Closure
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Fall 2003Costas Busch1 More Applications of The Pumping Lemma

Fall 2003Costas Busch2 The Pumping Lemma: there exists an integer such that for any string we can write For infinite context-free language with lengths and it must be:

Fall 2003Costas Busch3 Context-free languages Non-context free languages

Fall 2003Costas Busch4 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

Fall 2003Costas Busch5 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

Fall 2003Costas Busch6 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

Fall 2003Costas Busch7 We can write: with lengths and Pumping Lemma says: for all

Fall 2003Costas Busch8 We examine all the possible locations of string in

Fall 2003Costas Busch9 Case 1: is within the first

Fall 2003Costas Busch10 Case 1: is within the first

Fall 2003Costas Busch11 Case 1: is within the first

Fall 2003Costas Busch12 Case 1: is within the first Contradiction!!! However, from Pumping Lemma:

Fall 2003Costas Busch13 is in the first Case 2:

Fall 2003Costas Busch14 is in the first Case 2:

Fall 2003Costas Busch15 is in the first Case 2:

Fall 2003Costas Busch16 is in the first Case 2: Contradiction!!! However, from Pumping Lemma:

Fall 2003Costas Busch17 is in the first overlaps the first Case 3:

Fall 2003Costas Busch18 is in the first overlaps the first Case 3:

Fall 2003Costas Busch19 is in the first overlaps the first Case 3:

Fall 2003Costas Busch20 is in the first overlaps the first Case 3: Contradiction!!! However, from Pumping Lemma:

Fall 2003Costas Busch21 Overlaps the first in the first Case 4: Analysis is similar to case 3

Fall 2003Costas Busch22 Other cases: is within or Analysis is similar to case 1:

Fall 2003Costas Busch23 More cases: overlaps or Analysis is similar to cases 2,3,4:

Fall 2003Costas Busch24 Since, it is impossible to overlap: There are no other cases to consider nor

Fall 2003Costas Busch25 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free

Fall 2003Costas Busch26 Context-free languages Non-context free languages

Fall 2003Costas Busch27 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

Fall 2003Costas Busch28 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

Fall 2003Costas Busch29 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

Fall 2003Costas Busch30 We can write: with lengths and Pumping Lemma says: for all

Fall 2003Costas Busch31 We examine all the possible locations of string in There is only one case to consider

Fall 2003Costas Busch32

Fall 2003Costas Busch33

Fall 2003Costas Busch34

Fall 2003Costas Busch35

Fall 2003Costas Busch36 Since, for we have:

Fall 2003Costas Busch37

Fall 2003Costas Busch38 Contradiction!!! However, from Pumping Lemma:

Fall 2003Costas Busch39 We obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free

Fall 2003Costas Busch40 Context-free languages Non-context free languages

Fall 2003Costas Busch41 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

Fall 2003Costas Busch42 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

Fall 2003Costas Busch43 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

Fall 2003Costas Busch44 We can write: with lengths and Pumping Lemma says: for all

Fall 2003Costas Busch45 We examine all the possible locations of string in

Fall 2003Costas Busch46 Most complicated case: is in

Fall 2003Costas Busch47

Fall 2003Costas Busch48 Most complicated sub-case:and

Fall 2003Costas Busch49 Most complicated sub-case:and

Fall 2003Costas Busch50 Most complicated sub-case:and

Fall 2003Costas Busch51 and

Fall 2003Costas Busch52

Fall 2003Costas Busch53 However, from Pumping Lemma: Contradiction!!!

Fall 2003Costas Busch54 When we examine the rest of the cases we also obtain a contradiction

Fall 2003Costas Busch55 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free