1 Lecture 22 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Theory Of Automata By Dr. MM Alam
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Lecture 9,10 Theory of AUTOMATA
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
Automata and Formal Languages Tim Sheard 1 Lecture 8 Pumping Lemma & Distinguishability Jim Hook Tim Sheard Portland State University.
1 Module 19 LNFA subset of LFSA –Theorem 4.1 on page 131 of Martin textbook –Compare with set closure proofs Main idea –A state in FSA represents a set.
Transparency No Formal Language and Automata Theory Chapter 10 The Myhill-Nerode Theorem (lecture 15,16 and B)
1 Lecture 31 EQUAL language –Designing a CFG –Proving the CFG is correct.
1 Module 16 Distinguishability –Definition –Help in designing/debugging FSA’s.
Module 5 Topics Proof of the existence of unsolvable problems
1 Module 30 EQUAL language –Designing a CFG –Proving the CFG is correct.
Regular Expression (EXTRA)
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.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
1 Lecture 15 Distinguishability –Definition –Help in designing/debugging FSA’s NFA’s –nondeterministic transition functions computations are trees, not.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Lecture 20 LNFA subset of LFSA –Theorem 4.1 on page 105 of Martin textbook –Compare with set closure proofs Main idea –A state in FSA represents a set.
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
1 Module 24 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
1 Regular Expressions/Languages Regular languages –Inductive definitions –Regular expressions syntax semantics Not covered in lecture.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Finite-State Machines with No Output
CS 461 – Sept. 12 Simplifying FA’s. –Let’s explore the meaning of “state”. After all if we need to simplify, this means we have too many states. –Myhill-Nerode.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
MYHILL NERODE THEOREM By Anusha Tilkam. Myhill Nerode Theorem: The following three statements are equivalent 1.The set L є ∑* is accepted by a FSA 2.L.
Introduction to CS Theory
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
Week 14 - Wednesday.  What did we talk about last time?  Regular expressions  Introduction to finite state automata.
1 Module 14 Regular languages –Inductive definitions –Regular expressions syntax semantics.
Transition Diagrams Lecture 3 Wed, Jan 21, Building Transition Diagrams from Regular Expressions A regular expression consists of symbols a, b,
Word : Let F be a field then the expression of the form a 1, a 2, …, a n where a i  F  i is called a word of length n over the field F. We denote the.
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
CS 203: Introduction to Formal Languages and Automata
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
The decidability of Presburger Arithmetic By Guillermo Guillen 04/13/05 Dr. Smith COT 6421 FIU Spring 2005.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
1 Module 12 Computation and Configurations –Formal Definition –Examples.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
1 Module 12 Computation and Configurations –Formal Definition –Examples.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
Regular Expression (EXTRA)
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Recap lecture 5 Different notations of transition diagrams, languages of strings of even length, Odd length, starting with b, ending in a (with different.
Pumping Lemma.
Relations Chapter 9.
CSC312 Automata Theory Lecture # 4 Languages-III.
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
CSE322 Minimization of finite Automaton & REGULAR LANGUAGES
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Language Recognition (12.4)
Instructor: Aaron Roth
Instructor: Aaron Roth
Recap lecture 18 NFA corresponding to union of FAs,example, NFA corresponding to concatenation of FAs,examples, NFA corresponding to closure of an FA,examples.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
CSC312 Automata Theory Lecture # 5 Chapter # 4 Cont…
Recap Lecture 4 Regular expression of EVEN-EVEN language, Difference between a* + b* and (a+b)*, Equivalent regular expressions; sum, product and closure.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Presentation transcript:

1 Lecture 22 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular

2 Distinguishability

3 Distinguishable and Indistinguishable String x is distinguishable from string y with respect to language L iff –there exists a string z such that xz is in L and yz is not in L OR xz is not in L and yz is in L String x is indistinguishable from string y with respect to language L iff –for all strings z, xz and yz are both in L OR xz and yz are both not in L

4 Example Let EVEN-ODD be the set of strings over {a,b} with an even number of a’s and an odd number of b’s –Is the string aa distinguishable from the string bb with respect to EVEN-ODD? –Is the string aa distinguishable from the string ab with respect to EVEN-ODD?

5 Equivalence classes of strings (Societies in the handout)

6 Definition of equivalence classes Every language L partitions  * into equivalence classes via indistinguishability –Two strings x and y belong to the same equivalence class defined by L iff x and y are indistinguishable w.r.t L –Two strings x and y belong to different equivalence classes defined by L iff x and y are distinguishable w.r.t. L

7 Example How does EVEN-ODD partition {a,b}* into equivalence classes? Strings with an EVEN number of a’s and an EVEN number of b’s Strings with an EVEN number of a’s and an ODD number of b’s Strings with an ODD number of a’s and an EVEN number of b’s Strings with an ODD number of a’s and an ODD number of b’s

8 Second Example Let 1MOD3 be the set of strings over {a,b} whose length mod 3 = 1. How does 1MOD3 partition {a,b}* into equivalence classes? Length mod 3 = 0 Length mod 3 = 1 Length mod 3 = 2

9 Designing FSA’s

10 Designing an FSA for EVEN-ODD Even Odd Even b ab a a b b a

11 Designing an FSA for 1MOD3 Length mod 3 = 0 Length mod 3 = 1 Length mod 3 = 2 a aa a,b

12 Proving a language is not regular

13 Third Example Let EQUAL be the set of strings x over {a,b} s.t. the number of a’s in x = the number of b’s in x How does EQUAL partition {a,b}* into equivalence classes? –Strings with an equal number of a’s and b’s –Strings with one extra a –Strings with one extra b –Strings with two extra a’s –Strings with two extra b’s –…–… There are an infinite number of equivalence classes. –Can we construct a finite state automaton for EQUAL? –We shall see that the answer is no.

14 Myhill-Nerode Theorem

15 Theorem Statement Two part statement –If L is regular, then L partitions  * into a finite number of equivalence classes –If L partitions  * into a finite number of equivalence classes, then L is regular One part statement –L is regular iff L partitions  * into a finite number of equivalence classes

16 Implication 1 Method for constructing FSA’s to accept a language L –Identify equivalence classes defined by L –Make a state for each equivalence class –Identify initial and accepting states –Add transitions between the states You can use a canonical element of each equivalence class to help with building the transition function 

17 Implication 2 Method for proving a language L is not regular –Identify equivalence classes defined by L –Show there are an infinite number of such equivalence classes Table format may help, but it is only a way to help illustrate that there are an infinite number of equivalence classes defined by L

18 Proving a language is not regular revisited

19 Proving EQUAL is not regular Let EQUAL be the set of strings x over {a,b} s.t. the number of a’s in x = the number of b’s in x We want to show that EQUAL partitions {a,b}* into an infinite number of equivalence classes We will use a table that is somewhat reminiscent of the table used for diagonalization

20 Table a aa aaa aaaa aaaaa... b IN OUT... bb OUT IN OUT... bbb OUT IN OUT... bbbb OUT IN OUT... bbbbb OUT IN... ……………………………… The strings being distinguished are the rows. The tables entries indicate the the concatenation of the row string with the column string is in or not in EQUAL. Each complete column shows one row string is distinguishable from all the other row strings.

21 Concluding EQUAL is nonregular We have shown that EQUAL partitions {a,b}* into an infinite number of equivalence classes –In this case, we only identified some of the equivalence classes defined by EQUAL, but that is sufficient Strings with one extra a Strings with two extra a’s Strings with three extra a’s … Thus, the Myhill-Nerode Theorem implies that EQUAL is nonregular

22 Summary Myhill-Nerode Theorem and what it says –It does not say a language L is regular iff L is finite Many regular languages such as  * are not finite –It says that a language L is regular iff L partitions  * into a finite number of equivalence classes Provides method for designing FSA’s Provides method for proving a language L is not regular –Show that L partitions  * into an infinite number of equivalence classes