Lecture 9,10 Theory of AUTOMATA

Slides:



Advertisements
Similar presentations
Properties of Regular Languages
Advertisements

Properties of Regular Sets
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.
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
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
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.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
1 Non-regular languages. 2 Regular languages Non-regular languages.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Lecture # 5 Pumping Lemma & Grammar
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on 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}?
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
Lecture 4 Theory of AUTOMATA
CS355 - Theory of Computation Regular Expressions.
CS 203: Introduction to Formal Languages and Automata
CSC312 Automata Theory Nonregular Languages Chapter # 10 by Cohen
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
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.
Lecture # 17 Theory Of Automata By Dr. MM Alam 1.
1 Recap lecture 28 Examples of Myhill Nerode theorem, Quotient of a language, examples, Pseudo theorem: Quotient of a language is regular, prefixes of.
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
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.
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Pumping Lemma.
Non-regular languages
PROPERTIES OF REGULAR LANGUAGES
FORMAL LANGUAGES AND AUTOMATA THEORY
Recap Lecture 34 Example of Ambiguous Grammar, Example of Unambiguous Grammer (PALINDROME), Total Language tree with examples (Finite and infinite trees),
CSE 3813 Introduction to Formal Languages and Automata
Lecture 9 Theory of AUTOMATA
Non-deterministic Finite Automata (NFA)
Infiniteness Test The Pumping Lemma Nonregular Languages
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.
Kleene’s Theorem Muhammad Arif 12/6/2018.
Non-regular languages
Pumping Lemma.
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Lecture 5 Theory of AUTOMATA
Recap lecture 10 Definition of GTG, examples of GTG accepting the languages of strings:containing aa or bb, beginning with and ending in same letters,
Recap lecture 11 Proof of Kleene’s theorem part II (method with different steps), particular examples of TGs to determine corresponding REs.
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
RECAP Lecture 7 FA of EVEN EVEN, FA corresponding to finite languages(using both methods), Transition graphs.
Recap lecture 23 Mealy machines in terms of sequential circuit.
Recap Lecture 15 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
Kleene’s Theorem (Part-3)
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.
LECTURE # 07.
CHAPTER 1 Regular Languages
Presentation transcript:

Lecture 9,10 Theory of AUTOMATA

DFA state minimization

Regular languages Any language that can be expressed by a RE is said to be regular language, so if L1 and L2 are regular languages then L1 + L2 , L1L2 and L1* are also regular languages. This fact can be proved by the following two methods By Regular Expressions By TGs

Regular languages By Regular Expressions As discussed earlier that if r1, r2 are regular expressions, corresponding to the languages L1 and L2 then the languages L1 + L2 , L1L2 and L1* generated by r1+ r2, r1r2 and r1*, are also regular languages.

Regular languages By TGs If L1 and L2 are regular languages then L1 and L2 can also be expressed by some REs as well and hence using Kleene’s theorem, L1 and L2 can also be expressed by some TGs. Following are the methods showing that there exist TGs corresponding to L1 + L2, L1L2 and L1*

Regular languages By TGs If L1 and L2 are expressed by TG1 and TG2 then following may be a TG accepting L1 + L2

Regular languages By TGs If L1 and L2 are expressed by the following TG1 and TG2 then following may be a TG accepting L1L2

Regular languages By TGs also a TG accepting L1* may be as under

Regular languages By TGs Example Consider the following TGs

Regular languages By TGs Example Following may be a TG accepting L1+L2

Regular languages By TGs Example Also a TG accepting L1L2 may be

Regular languages By TGs Example And a TG accepting L2*

Regular languages Complement of a language Let L be a language defined over an alphabet Σ, then the language of strings, defined over Σ, not belonging to L, is called Complement of the language L, denoted by or L’. Note For a certain language L, the complement of is the given language L i.e. = L

Regular languages Theorem Proof If L is a regular language then, is also a regular language. Proof Since L is a regular language, so by Kleene’s theorem, there exists an FA, say F, accepting the language L. Converting each of the final states of F to non-final states and old non-final states of F to final states, FA thus obtained will reject every string belonging to L and will accept every string, defined over Σ, not belonging to L. Which shows that the new FA accepts the language . Hence using Kleene’s theorem can be expressed by some RE. Thus is regular.

Regular languages Theorem(cont.) Example If L is a regular language then, is also a regular language. Example Let L be the language over the alphabet Σ = {a, b}, consisting of only two words aba and abb, then the FA accepting L may be

Example(cont.) Converting final states to non-final states and old non-final states to final states, then FA accepting may be

Regular languages Theorem Statement Proof If L1 and L2 are two regular languages, then L1 ∩ L2 is also regular. Proof Using De-Morgan's law for sets Since L1and L2 are regular languages, so are and . and being regular provide that is also regular language and so being complement of regular language is regular language.

FAs accepting languages L1 and L2 may be as follows Following are example of finding an FA accepting the intersection of two regular languages. Example Consider two regular languages L1 and L2, defined over the alphabet Σ = {a, b}, where L1= language of words with double a’s. L2= language of words containing even number of a’s. FAs accepting languages L1 and L2 may be as follows

FAs accepting languages L1 and L2 may be as follows Their corresponding REs may be r1 = (a+b)*aa(a+b)* r2 = (b+ab*a)*

Now FAs accepting and , by definition, may be Now FA accepting , using the method described earlier, may be as follows

Now FA accepting , using the method described earlier, may be as follows

Here all the possible combinations of states of and are considered

An FA that accepts the language may be

Corresponding RE can be determined as follows The regular expression defining the language L1 ∩ L2 can be obtained, converting and reducing the previous FA into a GTG as after eliminating states z2 and z6

z4 can obviously be eliminated as follows eliminating the loops at z1 and z5 Thus the required RE may be (b+abb*ab)*a(a+bb*aab*a)(b+ab*a)*

FA corresponding to intersection of two regular languages (short method) Let FA3 be an FA accepting L1 ∩ L2, then the initial state of FA3 must correspond to the initial state of FA1 and the initial state of FA2. Since the language corresponding to L1 ∩ L2 is the intersection of corresponding languages L1 and L2, consists of the strings belonging to both L1and L2, therefore a final state of FA3 must correspond to a final state of FA1 and FA2. Following is an example regarding short method of finding an FA corresponding to the intersection of two regular languages.

Example Let r1 = (a+b)*aa(a+b)* and FA1 be also r2 = (b+ab*a)* and FA2 be FA1 FA2

An FA corresponding to L1 ∩ L2 can be determined as follows

The corresponding transition diagram may be as follows

Nonregular languages The language that cannot be expressed by any regular expression is called a Nonregular language. The languages PALINDROME and PRIME are the examples of nonregular languages. Note: It is to be noted that a nonregular language, by Kleene’s theorem, can’t be accepted by any FA or TG.

Nonregular languages Example Consider the language L = {Λ, ab, aabb, aaabbb, …} i.e. {an bn : n=0,1,2,3,…} . Suppose, it is required to prove that this language is nonregular.

Nonregular languages Pumping Lemma Statement Let L be an infinite language accepted by a finite automaton with N states, then for all words w in L that have langth more than N, there are strings x,y and z (y being non-null string) and length(x) + length(y) ≤ N s.t. w = xyz and all strings of the form xynz are in L for n = 1,2,3, …

Nonregular languages Pumping Lemma Proof The lemma can be proved, considering the following examples

Nonregular languages Pumping Lemma Proof (Example) Consider the language PALINDROME which is obviously infinite language. let the PALINDROME be a regular language and be accepted by an FA of 78 states. Consider the word w = Decompose w as xyz, where x,y and z are all strings belonging to Σ* while y is non-null string, s.t. length(x) + length(y) ≤ 78, which shows that the substring xy is consisting of a’s and xyyz will become , which is not in PALINDROME. Hence pumping lemma is not satisfied for the language PALINDROME.

Myhill Nerode theorem Statement For a language L, defined over an alphabetΣ, L partitions Σ* into distinct classes. If L is regular then, L generates finite number of classes. If L generates finite number of classes then L is regular. The proof is obvious from the following examples

Myhill Nerode theorem Example Consider the language L of strings, defined over Σ = {a,b}, ending in a. It can be observed that L partitions Σ* into the following two classes C1 = set of all strings ending in a. C2 = set of all strings not ending in a. Since there are finite many classes generated by L, so L is regular and hence following is an FA, built with the help of C1 and C2, accepting L.