UNIT 4 : State Minimization: Completely Specified Machines

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

Chapter 9 -- Simplification of Sequential Circuits.
Theory of Computing Lecture 23 MAS 714 Hartmut Klauck.
Some Slides from: U.C. Berkeley, U.C. Berkeley, Alan Mishchenko, Alan Mishchenko, Mike Miller, Mike Miller, Gaetano Borriello Gaetano Borriello Introduction.
CSE 311 Foundations of Computing I
Lecture 24 MAS 714 Hartmut Klauck
Longest Common Subsequence
VIII - Working with Sequential Logic © Copyright 2004, Gaetano Borriello and Randy H. Katz 1 Finite state machine optimization State minimization  fewer.
DFA Minimization Jeremy Mange CS 6800 Summer 2009.
Summary Showing regular Showing non-regular construct DFA, NFA
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
1 Chapter Equivalence, Order, and Inductive Proof.
Formal Language, chapter 9, slide 1Copyright © 2007 by Adam Webber Chapter Nine: Advanced Topics in Regular Languages.
Transparency No Formal Language and Automata Theory Chapter 10 The Myhill-Nerode Theorem (lecture 15,16 and B)
Sequential System Synthesis -- Finite State Machine.
FSM Decomposition using Partitions on States 290N: The Unknown Component Problem Lecture 24.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2) ICS 535 Design and Implementation.
Regular Expression (EXTRA)
ECE Synthesis & Verification - Lecture 19 1 ECE 667 Spring 2009 ECE 667 Spring 2009 Synthesis and Verification of Digital Systems Functional Decomposition.
25/06/2015Marius Mikucionis, AAU SSE1/22 Principles and Methods of Testing Finite State Machines – A Survey David Lee, Senior Member, IEEE and Mihalis.
Computation Engines: BDDs and SAT (part 2) 290N: The Unknown Component Problem Lecture 8.
Transparency No Formal Language and Automata Theory Chapter 10 The Myhill-Nerode Theorem (lecture 15,16 and B)
Data Flow Analysis Compiler Design Nov. 8, 2005.
Theory and Applications
Automating Construction of Lexers. Example in javacc TOKEN: { ( | | "_")* > | ( )* > | } SKIP: { " " | "\n" | "\t" } --> get automatically generated code.
Finding Eigenvalues and Eigenvectors What is really important?
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY For next time: Read 2.1 & 2.2.
Transparency No. 8-1 Formal Language and Automata Theory Chapter 8 DFA state minimization (lecture 13, 14)
State Minimization and Determinization EECS 290A Sequential Logic Synthesis and Verification.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Applications of Synchronous Circuits (Class 10.2 – 3/28/2013) CSE 2441 – Introduction to Digital Logic Spring 2013 Instructor – Bill Carroll, Professor.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
Zvi Kohavi and Niraj K. Jha 1 Capabilities, Minimization, and Transformation of Sequential Machines.
Zvi Kohavi and Niraj K. Jha 1 Structure of Sequential Machines.
Properties of Relations In many applications to computer science and applied mathematics, we deal with relations on a set A rather than relations from.
Markov Decision Processes1 Definitions; Stationary policies; Value improvement algorithm, Policy improvement algorithm, and linear programming for discounted.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
8.3 Representing Relations Directed Graphs –Vertex –Arc (directed edge) –Initial vertex –Terminal vertex.
Math Chapter 6 Part II. POWER SETS In mathematics, given a set S, the power set of S, written P(S) or 2 n(S), is the set of all subsets of S. Remember.
Recognizing safety and liveness Presented by Qian Huang.
Complexity and Computability Theory I Lecture #8 Instructor: Rina Zviel-Girshin Lea Epstein.
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Chapter 8. Sequential machine. Sequential machine M = ( I, O, S, , ) I : set of input O : set of output S : set of states  (state transition) : I 
SECTION 9 Orbits, Cycles, and the Alternating Groups Given a set A, a relation in A is defined by : For a, b  A, let a  b if and only if b =  n (a)
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
Minimal NFA Problems are hard Tao Jiang & B. Ravikumar N Andres Parra.
1 Section 4.2 Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST).
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Ch03-Algorithms 1. Algorithms What is an algorithm? An algorithm is a finite set of precise instructions for performing a computation or for solving a.
Efficient Signature Matching with Multiple Alphabet Compression Tables Publisher : SecureComm, 2008 Author : Shijin Kong,Randy Smith,and Cristian Estan.
Capabilities, Minimization, and Transformation of Sequential Machines
All-pairs Shortest paths Transitive Closure
Applied Discrete Mathematics Week 2: Functions and Sequences
Copyright © Cengage Learning. All rights reserved.
CSE 311 Foundations of Computing I
The time complexity for e-closure(T).
Review: NFA Definition NFA is non-deterministic in what sense?
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE 311 Foundations of Computing I
Synthesis of sequential circuits
Minimal DFA Among the many DFAs accepting the same regular language L, there is exactly one (up to renaming of states) which has the smallest possible.
DFA Equivalence & Minimization
Chapter Nine: Advanced Topics in Regular Languages
CHAPTER 15 REDUCTION OF STATE TABLES STATE ASSIGNMENT
4b Lexical analysis Finite Automata
Instructor: Aaron Roth
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 9 -- Simplification of Sequential Circuits
Presentation transcript:

UNIT 4 : State Minimization: Completely Specified Machines

State Minimization: Completely Specified Machines Two states, si and sj of machine M are distinguishable if and only if there exists a finite input sequence which when applied to M causes different output sequences depending on whether M started in si or sj. Such a sequence is called a distinguishing sequence for (si, sj). If there exists a distinguishing sequence of length k for (si, sj), they are said to be k-distinguishable.

State Minimization: Completely Specified Machines PS NS, z x=0 x=1 A E, 0 D, 1 B F, 0 D, 0 C E, 0 B, 1 D F, 0 B, 0 E C, 0 F, 1 F B, 0 C, 0 Example: states A and B are 1-distinguishable, since a 1 input applied to A yields an output 1, versus an output 0 from B. states A and E are 3-distinguishable, since input sequence 111 applied to A yields output 100, versus an output 101 from E.

Completely Specified Machines States si and sj (si ~ sj ) are said to be equivalent iff no distinguishing sequence exists for (si, sj ). If si ~ sj and sj ~ sk, then si ~ sk. So state equivalence is an equivalence relation (i.e. it is a reflexive, symmetric and transitive relation). An equivalence relation partitions the elements of a set into equivalence classes. Property: If si ~sj, their corresponding X-successors, for all inputs X, are also equivalent. Procedure: Group states of M so that two states are in the same group iff they are equivalent (forms a partition of the states).

Completely Specified Machines PS NS, z x=0 x=1 A E, 0 D, 1 B F, 0 D, 0 C E, 0 B, 1 D F, 0 B, 0 E C, 0 F, 1 F B, 0 C, 0 Pi : partition using distinguishing sequences of length i. Partition: Distinguishing Sequence: P0 = (A B C D E F) P1 = (A C E)(B D F) x =1 P2 = (A C E)(B D)(F) x =1; x =1 P3 = (A C)(E)(B D)(F) x =1; x =1; x =1 P4 = (A C)(E)(B D)(F) Algorithm terminates when Pk = PK+1

Completely Specified Machines Outline of state minimization procedure: All states equivalent to each other form an equivalence class. These may be combined into one state in the reduced (quotient) machine. Start an initial partition of a single block. Iteratively refine this partition by separating the 1-distinguishable states, 2-distinguishable states and so on. To obtain Pk+1, for each block Bi of Pk, create one block of states that not 1-distinguishable within Bi , and create different blocks states that are 1-distinguishable within Bi .

Completely Specified Machines Theorem: The equivalence partition is unique. Theorem: If two states, si and sj, of machine M are distinguishable, then they are (n-1 )-distinguishable, where n is the number of states in M. Definition: Two machines, M1 and M2, are equivalent (M1 ~ M2 ) iff, for every state in M1 there is a corresponding equivalent state in M2 and vice versa. Theorem. For every machine M there is a minimum machine Mred ~ M. Mred is unique up to isomorphism.

Completely Specified Machines Reduced machine obtained from previous example: PS NS, z x=0 x=1 A E, 0 D, 1 B F, 0 D, 0 C E, 0 B, 1 D F, 0 B, 0 E C, 0 F, 1 F B, 0 C, 0 P4 = (A C)(E)(B D)(F) =     PS NS, z x=0 x=1  , 0 , 1  , 0 , 1  , 0 , 0  , 0 , 0

State Minimization of CSMs: Complexity Algorithm DFA ~ DFAmin Input: A finite automaton M = (Q, , , q 0, F ) with no unreachable states. Output: A minimum finite automaton M’ = (Q’, , ’, q ’0, F’ ). Method: 1. t :=2; Q0:= { undefined }; Q1:=F; Q2:= Q\F. 2. while there is 0 < i  t, a   with (Qi,a)  Qj, for all j  t do (a) Choose such an i, a , and j  t with  (Qi,a)  Qj  . (b) Qt +1 := {q  Qi |  (q,a)  Qj }; Qi := Qi \ Qt +1; t := t +1. end.

State Minimization of CSMs: Complexity 3. (* Denote [q ] the equivalence class of state q , and {Qi } the set of all equivalence classes. *) Q’ := {Q1, Q2, ..., Qt }. q ’0 := [q0]. F’ := { [q]  Q’ | q  F }.  ’ ( [q], a) := [(q,a)] for all q  Q, a  .

State Minimization of CSMs: Complexity Standard implementation: O (kn 2), where n =|Q| and k = || Modification of the body of the while loop: 1. Choose such an i, a  , and choose j1,j2  t with j1  j2,  (Qi,a)  Qj1  , and  (Qi,a)  Qj2  . 2. If |{q  Qi | (q,a)  Qj1}|  |{q  Qi | (q,a)  Qj2}| then Qt +1 := {q  Qi | (q,a)  Qj1 } else Qt +1 := {q  Qi | (q,a)  Qj2 } fI; Qi := Qi \ Qt+1; t := t +1. (i.e. put smallest set in t +1 )

State Minimization of CSMs: Complexity Note: |Qt +1|  1/2|Qi|. Therefore, for all q  Q, the name of the class which contains a given state q changes at most log(n ) times. Goal: Develop an implementation such that all computations can be assigned to transitions containing a state for which the name of the corresponding class is changed. Suitable data structures achieve an O (kn log n) implementation. Details in N. Blum IPL ‘96 [Originial O (kn log n) algorithm in Hopcroft 1971]

State Minimization of CSMs: BDD Implementation X and Y are spaces of all states: |S| E0(x,y) =  (xi ~ yi) (initially all states are equivalent) i=1 Ej +1(x,y) = Ej (x,y)  i (o,z,w ) [T (x,i,z,o ) T (y,i,w,o ) Ej (z,w )] (i.e. states x,y continue to be equivalent if they are j - equivalent and for all inputs the next states are j - equivalent )