Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.

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.
Fall 2006Costas Busch - RPI1 Regular Expressions.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
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.
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.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
Fall 2003Costas Busch - RPI1 Decidable Problems of Regular Languages.
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.
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 2006Costas Busch - RPI1 More Applications of the Pumping Lemma.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
1 Non-Deterministic Automata Regular Expressions.
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Prof. Busch - LSU1 Pumping Lemma for Context-free Languages.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Prof. Busch - RPI1 Decidable Problems of Regular Languages.
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
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.
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.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
CS 203: Introduction to Formal Languages and Automata
Regular Expressions Costas Busch - LSU.
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.
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.
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
Single Final State for NFA
Infiniteness Test The Pumping Lemma Nonregular Languages
DPDA Deterministic PDA
Deterministic PDAs - DPDAs
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
Decidable Problems of Regular Languages
More Applications of the Pumping Lemma
Applications of Regular Closure
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars

Fall 2004COMP 3352 When we say: We are given a Regular Language We mean:Language is in a standard representation

Fall 2004COMP 3353 Elementary Questions about Regular Languages

Fall 2004COMP 3354 Membership Question Question:Given regular language and string how can we check if ? Answer:Take the DFA that accepts and check if is accepted

Fall 2004COMP 3355 DFA

Fall 2004COMP 3356 Given regular language how can we check if is empty: ? Take the DFA that accepts Check if there is any path from the initial state to a final state Question: Answer:

Fall 2004COMP 3357 DFA

Fall 2004COMP 3358 Given regular language how can we check if is finite? Take the DFA that accepts Check if there is a walk with cycle from the initial state to a final state Question: Answer:

Fall 2004COMP 3359 DFA is infinite DFA is finite

Fall 2004COMP Given regular languages and how can we check if ? Question: Find if Answer:

Fall 2004COMP and

Fall 2004COMP or

Fall 2004COMP Non-regular languages

Fall 2004COMP Regular languages Non-regular languages

Fall 2004COMP 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 !!!

Fall 2004COMP The Pigeonhole Principle

Fall 2004COMP pigeons pigeonholes

Fall 2004COMP A pigeonhole must contain at least two pigeons

Fall 2004COMP pigeons pigeonholes

Fall 2004COMP The Pigeonhole Principle pigeons pigeonholes There is a pigeonhole with at least 2 pigeons

Fall 2004COMP The Pigeonhole Principle and DFAs

Fall 2004COMP DFA with states

Fall 2004COMP In walks of strings:no state is repeated

Fall 2004COMP In walks of strings:a state is repeated

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

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

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

Fall 2004COMP The Pumping Lemma

Fall 2004COMP Take an infinite regular language There exists a DFA that accepts states

Fall 2004COMP Take string with There is a walk with label : walk

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

Fall 2004COMP walk Let be the first state repeated in the walk of

Fall 2004COMP Write......

Fall 2004COMP Observations:lengthnumber of states of DFA length

Fall 2004COMP The string is accepted Observation:......

Fall 2004COMP The string is accepted Observation:......

Fall 2004COMP The string is accepted Observation:......

Fall 2004COMP The string is accepted In General:......

Fall 2004COMP In General: Language accepted by the DFA

Fall 2004COMP In other words, we described: The Pumping Lemma !!!

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

Fall 2004COMP Applications of the Pumping Lemma

Fall 2004COMP Theorem: The language is not regular. Proof: Use the Pumping Lemma

Fall 2004COMP Assume that is a regular language Since is an infinite language, we can apply the Pumping Lemma

Fall 2004COMP Let be the integer in the Pumping Lemma Pick a string such that: (1)and We pick: (2) length

Fall 2004COMP it must be that length From the Pumping Lemma Write: Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP But: CONTRADICTION!!!

Fall 2004COMP Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

Fall 2004COMP Regular languages Non-regular languages

Fall 2004COMP More Applications of the Pumping Lemma

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

Fall 2004COMP Regular languages Non-regular languages

Fall 2004COMP Theorem: The language is not regular Proof: Use the Pumping Lemma

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

Fall 2004COMP We pick Let be the integer in the Pumping Lemma Pick a string such that: length and

Fall 2004COMP Write it must be that length From the Pumping Lemma Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP BUT: CONTRADICTION!!!

Fall 2004COMP Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

Fall 2004COMP Regular languages Non-regular languages

Fall 2004COMP Theorem: The language is not regular Proof: Use the Pumping Lemma

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

Fall 2004COMP We pick Let be the integer in the Pumping Lemma Pick a string such that: length and

Fall 2004COMP Write it must be that length From the Pumping Lemma Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP BUT: CONTRADICTION!!!

Fall 2004COMP Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore:

Fall 2004COMP Regular languages Non-regular languages

Fall 2004COMP Theorem: The language is not regular Proof: Use the Pumping Lemma

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

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

Fall 2004COMP Write it must be that length From the Pumping Lemma Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP From the Pumping Lemma: Thus:

Fall 2004COMP Since: There must exist such that:

Fall 2004COMP However:for for any

Fall 2004COMP BUT: CONTRADICTION!!!

Fall 2004COMP Our assumption that is a regular language is not true Conclusion: is not a regular language Therefore: