CHAPTER 1 Regular Languages

Slides:



Advertisements
Similar presentations
Properties of Regular Sets
Advertisements

Lecture 9,10 Theory of AUTOMATA
Summary Showing regular Showing non-regular construct DFA, NFA
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.
CS21 Decidability and Tractability
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Nonregular languages Sipser 1.4 (pages 77-82). CS 311 Fall Nonregular languages? We now know: –Regular languages may be specified either by regular.
Automata and Formal Languages Tim Sheard 1 Lecture 8 Pumping Lemma & Distinguishability Jim Hook Tim Sheard Portland State University.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 1 Regular Languages Contents Finite Automata (FA or DFA) definitions, examples,
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Courtesy Costas Busch - RPI1 Non-regular languages.
Homework 4 Solutions.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Today Chapter 1: RE = Regular Languages, nonregular languages RL pumping lemma Chapter 2: Context-Free Languages (CFLs)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
The Golden Chain εNFA  NFA  DFA  REGEX. Regular Expressions.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Solution Exercise 1.43 a A r r s q q > b b e b s’ q r q’ b r’ a A’
CHAPTER 1 Regular Languages
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
CS 203: Introduction to Formal Languages and Automata
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
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.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
CSE 105 theory of computation
Non-regular languages - The pumping lemma
Complexity and Computability Theory I
Formal Language & Automata Theory
Non-regular languages
Standard Representations of Regular Languages
Non Deterministic Automata
PROPERTIES OF REGULAR LANGUAGES
NPDAs Accept Context-Free Languages
CSE 3813 Introduction to Formal Languages and Automata
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Intro to Theory of Computation
Infiniteness Test The Pumping Lemma Nonregular Languages
Regular Expression We shall build expressions from the symbols using simple operations include concatenation, union and kleen closure. Several intuitive.
Non-Deterministic Finite Automata
4. Properties of Regular Languages
Non-Deterministic Finite Automata
Non Deterministic Automata
Deterministic PDAs - DPDAs
Elementary Questions about Regular Languages
Non-regular languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CS21 Decidability and Tractability
Chapter 1 Regular Language - 02
DPDA Deterministic PDA
Chapter 1 Regular Language
CHAPTER 1 Regular Languages
Presentation transcript:

CHAPTER 1 Regular Languages Contents Finite Automata (FA or DFA) definitions, examples, designing, regular operations Non-deterministic Finite Automata (NFA) definitions, equivalence of NFAs and DFAs, closure under regular operations Regular expressions definitions, equivalence with finite automata Non-regular Languages the pumping lemma for regular languages

Non-regular Languages To understand the power of finite automata we must also understand their limitation. We will show that certain languages cannot be recognized by any finite automaton. Try to build an automaton that recognizes the language The automaton starts by seeing 0 inputs. It has to remember the exact number of 0 inputs, since it will later check that number against the number of 1 inputs. But the number of 0 inputs can be arbitrary large. Intuitively, no finite number of states can remember the exact number of 0 inputs. We conclude that this language is not regular. The Pumping Lemma for regular languages formalize this argument.

Pumping Lemma Lemma. For any regular language L, there exists a number such that for every word with at least p letters there exist x, y, z with w = xyz and |y|>0 and |xy| such that for every number We call p the pumping number of L, and xyz the pumping decomposition of w. Proof Consider a regular language L. L is accepted by some finite automaton M. Let p be the number of states of M. Now consider a word in L with at least p letters. Then w is accepted by M along some path that contains a loop. We can construct other paths of M by going through the loop 0,1,2, … times. These paths also accept words in L. In other words, any accepting word w of length at least p can be “pumped “ to find infinitely many other accepted words.

How to prove that a language is not regular? Suppose we want to prove that a language L is not regular. We can do this by showing that the pumping lemma does not hold for L; that is, we prove the negation of the pumping lemma: for any number there exists a word with at least p letters such that for all x, y, z with w = xyz and |y|>0 and |xy| there exists a number such that We have to consider all possibilities for the pumping number p, all possibilities for the pumping decomposition x,y,z (often by case analysis). But we are free to choose a single word w, and a single iteration number i. Choosing a suitable w is usually the crux of the proof (one needs a bit of creative thinking) For i, we can typically choose i=0 or i=2. Example: is not regular. Choose any pumping number p (we know only that ). Choose Consider any pumping decomposition w=xyz (|y|>0 and |xy| ). Hence and and for . Choose i=2. Since is not in L.

More Examples Example 2: is not regular. Choose any pumping number p (we know only that ). Choose Consider any pumping decomposition w=xyz (|y|>0 and |xy| ). There are two possibilities; and and for . and and Choose i=2. We need to show that is not in . a) which is not in , since b) which is not in , since it contains three 1’s. Example 3: is not regular. Choose any pumping number p (we know only that ). Choose Consider any pumping decomposition w=xyz (|y|>0 and |xy| ). Hence, and and for and Choose i=2. We need to show that is not in , i.e., is not a square. Indeed,

Proving (non)regularity. To prove that a language L is regular, there are essentially two options: Find a finite automaton (or regular expression) that defines L. Show that L can be built from simpler regular languages using operations that are known to preserve regularity To prove that a language L is not regular, there are again two options: Show that the negation of the pumping lemma holds for L. Show that a language that is known to be non-regular can be built from L and languages that are known to be regular using operations that are known to preserve regularity. Example (of the second proof technique): contains the same number of 1’s and 0’s} is not regular, since (if were regular, then L would also be regular, which contradicts the first example).

Homework Problems: 1.13 (consider c, f, i from 1.4). Do 1.14 and 1.15 for the following two regular expressions: Do 1.17 for 1.17 (c) and language Do 1.16 for the following FA 1 q0 q1 q2 1 0, 1