Lecture 06: Theory of Automata:08 Finite Automata with Output.

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

Theory of Computing Lecture 23 MAS 714 Hartmut Klauck.
CSE 311 Foundations of Computing I
Theory Of Automata By Dr. MM Alam
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Software Engineering, COMP 201 Slide 1 Automata and Formal Languages Moore and Mealy Automata Ralf Möller Hamburg Univ. of Technology based on slides by.
Finite Automata with Output
Lecture # 14 Theory Of Automata By Dr. MM Alam 1.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Zvi Kohavi and Niraj K. Jha 1 Capabilities, Minimization, and Transformation of Sequential Machines.
Lecture 03: Theory of Automata:08 Finite Automata.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
Lecture 07: Formal Methods in SE Finite Automata Lecture # 07 Qaisar Javaid Assistant Professor.
CSC312 Automata Theory Lecture # 19 Chapter # 8 by Cohen Finite Automata with Output.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
Lecture # 15 Theory Of Automata By Dr. MM Alam 1.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
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.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
1 Recap lecture 21 Example of Moore machine, Mealy machine, Examples, complementing machine, Incrementing machine.
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 8 Theory of AUTOMATA
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.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
Lecture 04: Theory of Automata:08 Transition Graphs.
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Lecture 09: Theory of Automata:2014 Asif NawazUIIT, PMAS-Arid Agriclture University Rawalpindi. Kleene’s Theorem and NFA.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
Finite Automata (FA) with Output FA discussed so far, is just associated with R.Es or language. Is there exist an FA which generates an output string corresponding.
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.
Theory of Computation Automata Theory Dr. Ayman Srour.
Kleene’s Theorem and NFA
Copyright © Cengage Learning. All rights reserved.
Pushdown Automata.
Pushdown Automata.
Chapter 2 FINITE AUTOMATA.
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Non Deterministic Automata
CS21 Decidability and Tractability
Lecture 5 Theory of AUTOMATA
Chapter 1 Regular Language
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
Finite Automata with Output
Recap lecture 20 Recap Theorem, Example, Finite Automaton with output, Moore machine, Examples.
Finite Automaton with output
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
Kleene’s Theorem (Part-3)
Mealy and Moore Machines
CSC312 Automata Theory Lecture # 24 Chapter # 11 by Cohen Decidability.
Presentation transcript:

Lecture 06: Theory of Automata:08 Finite Automata with Output

Lecture 06: Theory of Automata:08 2 Moore = Melay So far, we have define that two machines are equivalent if they accept the same language. In this sense, we cannot compare a Mealy machine and a Moore machine because they are not language definers. Definition: Given the Mealy machine Me and the Moore machine Mo (which prints the automatic start state character x), we say that these two machines are equivalent if for every input string, the output string from Mo is exactly x concatenated with the output string from Me.

Lecture 06: Theory of Automata:08 3 Theorem 8 If Mo is a Moore machine, then there is a Mealy machine Me that is equivalent to Mo. Proof by constructive algorithm: Consider a particular state in Mo, say state q 4, which prints a certain character, say t. Consider all the incoming edges to q 4. Suppose these edges are labeled with a, b, c,... Let us re-label these edges as a/t, b/t, c/t,... and let us erase the t from inside the state q 4. This means that we shall be printing a t on the incoming edges before we enter q 4.

Lecture 06: Theory of Automata:08 4 Proof by constructive algorithm contd. We leave the outgoing edges from q 4 alone. They will be relabeled to print the character associated with the state to which they lead. If we repeat this procedure for every state q 0, q 1,..., we turn Mo into its equivalent Me. becomes

Lecture 06: Theory of Automata:08 5 Example Following the above algorithm, we convert a Moore machine into a Mealy machine as follows:

Lecture 06: Theory of Automata:08 6 Theorem 9 For every Mealy machine Me, there is a Moore machine Mo that is equivalent to it. Proof by constructive algorithm: We cannot just do the reverse of the previous algorithm. If we try to push the printing instruction from the edge (as it is in Me) to the inside of the state (as it should be for Mo), we may end up with a conflict: Two edges may come into the same state but have different printing instructions, as in this example:

Lecture 06: Theory of Automata:08 7 Proof by constructive algorithm (cont.): What we need are two copies of q 4, one that prints a 0 (labeled as q 1 4 /0), and the other that prints a 1 (labeled as q 2 4 /1). Hence, – The edges a/0 and b/0 will go into q 1 4 /0. – The edge b/1 will go into q 2 4 /1. The arrow coming out of each of these two copies must be the same as the edges coming out of q 4 originally.

Lecture 06: Theory of Automata:08 8 Proof by constructive algorithm (cont.): If all the edges coming into a state have the same printing instruction, we simply push that printing instruction into the state. becomes

Lecture 06: Theory of Automata:08 9 Proof by constructive algorithm (cont.): An edge that was a loop in Me may becomes two edges in Mo, one that is a loop and one that is not. becomes

Lecture 06: Theory of Automata:08 10 Proof by constructive algorithm (cont.): If there is ever a state that has no incoming edges, we can assign it any printing instruction we want, even if this state is the start state. If we have to make copies of the start state in Me, we can let any of the copies be the start state in Mo, because they all give the identical directions for proceeding to other states. Having a choice of start states means that the conversion of Me into Mo is NOT unique. Repeating this process for each state of Me will produce an equivalent Mo. The proof is completed. Together, Theorems 8 and 9 allow us to say Me = Mo.

Lecture 06: Theory of Automata:08 11 Example Convert the following Mealy machine into a Moore machine:

Lecture 06: Theory of Automata:08 12 Example contd. Following the algorithm, we first need two copies of q 0 :

Lecture 06: Theory of Automata:08 13 Example contd. All the edges coming into state q 1 (and also q 3 ) have the same printing instruction. So, apply the algorithm to q 1 and q 3 :

Lecture 06: Theory of Automata:08 14 Example contd. The only job left is to convert state q 2. There are 0-printing edges and 1-printing edges coming into q 2. So, we need two copies of q 2. The final Moore machine is: