1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.

Slides:



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

Properties of Regular Languages
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.
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.
Fall 2006Costas Busch - RPI1 Regular Expressions.
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 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.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular 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 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.
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.
1 Problem of the Day: Factor (ab) k as xyz in all ways such that y ≠ ε.
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}?
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Properties of Regular Languages
CS 203: Introduction to Formal Languages and Automata
Regular Expressions Costas Busch - LSU.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
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
Properties of Regular Languages
PROPERTIES OF REGULAR LANGUAGES
Formal Language & Automata Theory
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
Infiniteness Test The Pumping Lemma Nonregular Languages
Deterministic PDAs - DPDAs
Closure Properties of Context-Free languages
Elementary Questions about Regular Languages
Non-regular languages
Chapter 4 Properties of Regular Languages
More Applications of the Pumping Lemma
Applications of Regular Closure
Presentation transcript:

1 More Properties of Regular Languages

2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse

3 Namely, for regular languages and : Union Concatenation Star operation Reverse Regular Languages

4 We will prove Regular languages are closed under: Complement Intersection

5 Namely, for regular languages and : Complement Intersection Regular Languages

6 Complement Theorem: For regular language the complement is regular Proof: Take DFA that accepts and make nonfinal states final final states nonfinal Resulting DFA accepts

7 Example:

8 Intersection Theorem: For regular languages and the intersection is regular Proof:Apply DeMorgan’s Law:

9 regular

10 Standard Representations of Regular Languages

11 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars

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

13 Elementary Questions about Regular Languages

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

15 DFA

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

17 DFA

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

19 DFA is infinite DFA is finite

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

21 and

22 or

23 Non-regular languages

24 Regular languages Non-regular languages

25 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 !!!

26 The Pigeonhole Principle

27 pigeons pigeonholes

28 A pigeonhole must contain at least two pigeons

pigeons pigeonholes

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

31 The Pigeonhole Principle and DFAs

32 DFA with states

33 In walks of strings:no state is repeated

34 In walks of strings:a state is repeated

35 If the walk of string has length then a state is repeated

36 If in a walk of a string transitions states of DFA then a state is repeated Pigeonhole principle for any DFA:

37 In other words for a string : transitions are pigeons states are pigeonholes

38 In general: A string has length number of states A state must be repeated in the walk walk of

39 The Pumping Lemma

40 Take an infinite regular language DFA that accepts states

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

42 If string has lengthnumber of states then, from the pigeonhole principle: a state is repeated in the walk walk

43 Write......

Observations:length number of states length

45 The string is acceptedObservation:......

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

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

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

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

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

51 Applications of the Pumping Lemma

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

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

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

55 Write: it must be that: length From the Pumping Lemma Therefore:

56 From the Pumping Lemma: Thus: We have:

57 Therefore: BUT: CONTRADICTION!!!

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

59 Regular languages Non-regular languages