Costas 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.
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
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 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.
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.
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.
Chapter 12: Context-Free Languages and Pushdown Automata
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.
Nonregular Languages How do you prove a language to be regular? How do you prove a language to be nonregular? A Pumping Lemma.
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
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
Undecidable problems:
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:

Costas Busch1 More Applications of The Pumping Lemma

Costas 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:

Costas Busch3 Context-free languages Non-context free languages

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

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

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

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

Costas Busch8 We examine all the possible locations of string in

Costas Busch9 Case 1: is within the first

Costas Busch10 Case 1: is within the first

Costas Busch11 Case 1: is within the first

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

Costas Busch13 is in the first Case 2:

Costas Busch14 is in the first Case 2:

Costas Busch15 is in the first Case 2:

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

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

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

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

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

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

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

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

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

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

Costas Busch26 Context-free languages Non-context free languages

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

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

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

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

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

Costas Busch32

Costas Busch33

Costas Busch34

Costas Busch35

Costas Busch36 Since, for we have:

Costas Busch37

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

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

Costas Busch40 Context-free languages Non-context free languages

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

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

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

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

Costas Busch45 We examine all the possible locations of string in

Costas Busch46 Most complicated case: is in

Costas Busch47

Costas Busch48 Most complicated sub-case:and

Costas Busch49 Most complicated sub-case:and

Costas Busch50 Most complicated sub-case:and

Costas Busch51 and

Costas Busch52

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

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

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