Standard Representations of 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 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.
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 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.
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.
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 - 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.
CS 203: Introduction to Formal Languages and Automata
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.
1 Recursively Enumerable and Recursive Languages.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Formal Language & Automata Theory
Non-regular languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
More Applications of the Pumping Lemma
PROPERTIES OF REGULAR LANGUAGES
Linear Bounded Automata LBAs
CSE 3813 Introduction to Formal Languages and Automata
PDAs Accept Context-Free Languages
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Single Final State for NFA
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
COSC 3340: Introduction to Theory of Computation
Infiniteness Test The Pumping Lemma Nonregular Languages
DPDA Deterministic PDA
4. Properties of Regular Languages
Decidable Languages Costas Busch - LSU.
Deterministic PDAs - DPDAs
Pumping Lemma for Context-free Languages
Elementary Questions about Regular Languages
Non-regular languages
Decidable Problems of Regular Languages
Chapter 4 Properties of Regular Languages
Formal Languages, Automata and Models of Computation
More Applications of the Pumping Lemma
DPDA Deterministic PDA
Applications of Regular Closure
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Standard Representations of Regular Languages DFAs Regular Grammars NFAs Regular Expressions

When we say: We are given a Regular Language We mean: Language is in a standard representation

Elementary Questions about Regular Languages

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

DFA DFA

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

DFA DFA

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

DFA is infinite DFA is finite

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

and

or

Non-regular languages

Non-regular languages

Problem: this is not easy to prove 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 !!!

The Pigeonhole Principle

pigeons pigeonholes

A pigeonhole must contain at least two pigeons

pigeons ........... pigeonholes ...........

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

The Pigeonhole Principle and DFAs

DFA with states

In walks of strings: no state is repeated

In walks of strings: a state is repeated

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

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

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

The Pumping Lemma

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

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

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

Let be the first state repeated in the walk of ...... ...... walk

Write ...... ......

Observations: length number of states of DFA length ...... ......

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

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

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

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

In General: Language accepted by the DFA ...... ......

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

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

Applications of the Pumping Lemma

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

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

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

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

From the Pumping Lemma: Thus:

From the Pumping Lemma: Thus:

BUT: CONTRADICTION!!!

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

Non-regular languages