1 Non-regular languages. 2 Regular languages Non-regular languages.

Slides:



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

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.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Mount Holyoke College 2 Nonregular languages? We now know: –Regular languages may be specified either.
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Fall Nonregular languages? We now know: –Regular languages may be specified either by regular.
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.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Courtesy Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
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.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Limitations.
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.
Homework 4 Solutions.
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.
Lecture 8 Sept 29, 2011 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
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.
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 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
TK PrasadPumping Lemma1 Nonregularity Proofs. TK PrasadPumping Lemma2 Grand Unification Regular Languages: Grand Unification (Parallel Simulation) (Rabin.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
CSCI 2670 Introduction to Theory of Computing September 13.
CS 203: Introduction to Formal Languages and Automata
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
Costas Busch - LSU1 Pumping Lemma for Context-free Languages.
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.
Cs466(Prasad)L11PLEG1 Examples Applying Pumping Lemma.
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.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Formal Language & Automata Theory
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
More Applications of the Pumping Lemma
PROPERTIES OF REGULAR LANGUAGES
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
COSC 3340: Introduction to Theory of Computation
Infiniteness Test The Pumping Lemma Nonregular Languages
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
More Applications of the Pumping Lemma
Applications of Regular Closure
COSC 3340: Introduction to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

1 Non-regular languages

2 Regular languages Non-regular languages

3 How can we prove that a language is not regular? Prove that there is no DFA that accepts Problem: this is not easy to prove Solution: the Pumping Lemma !!!

4 The Pigeonhole Principle

5 pigeons pigeonholes

6 A pigeonhole must contain at least two pigeons

pigeons pigeonholes

8 The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons

9 The Pigeonhole Principle and DFAs

10 DFA with states

11 In walks of strings:no state is repeated

12 In walks of strings:a state is repeated

13 If string has length : Thus, a state must be repeated Then the transitions of string are more than the states of the DFA

14 In general, for any DFA: String has length number of states A state must be repeated in the walk of walk of Repeated state

15 In other words for a string : transitions are pigeons states are pigeonholes walk of Repeated state

16 The Pumping Lemma

17 Take an infinite regular language There exists a DFA that accepts states

18 Take string with There is a walk with label : walk

19 If string has length (number of states of DFA) then, from the pigeonhole principle: a state is repeated in the walk walk

walk Let be the first state repeated in the walk of

21 Write......

Observations:lengthnumber of states of DFA length

23 The string is accepted Observation:......

24 The string is accepted Observation:......

25 The string is accepted Observation:......

26 The string is accepted In General:......

27 In General: Language accepted by the DFA

28 In other words, we described: The Pumping Lemma !!!

29 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we can write with and such that:

30 Applications of the Pumping Lemma

31 Theorem: The language is not regular Proof: Use the Pumping Lemma

32 Assume for contradiction that is a regular language Since is infinite we can apply the Pumping Lemma

33 Let be the integer in the Pumping Lemma Pick a string such that: length We pick

34 it must be that length From the Pumping Lemma Write: Thus:

35 From the Pumping Lemma: Thus:

36 From the Pumping Lemma: Thus:

37 BUT: CONTRADICTION!!!

38 Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

39 Regular languages Non-regular languages