Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17.

Similar presentations


Presentation on theme: "Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17."— Presentation transcript:

1 Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17

2 Outline  Introduction  The algorithm for exact state minimization  Binate covering problem (weighted SAT)  The implicit implementation of the algorithm  Conclusions

3 Exact State Minimization  Given a non-deterministic FSM, find a contained FSM, which has the minimum number of states  An implicit implementation of the algorithm is presented in: T. Kam, T. Villa, R. Brayton, A. Sangiovanni- Vincentelli. A Fully Implicit Algorithm for Exact State Minimization. Proc. DAC 1994, pp. 684-690 T. Kam, T. Villa, R. Brayton, A. Sangiovanni- Vincentelli. A Fully Implicit Algorithm for Exact State Minimization. Proc. DAC 1994, pp. 684-690

4 The Algorithm  Generate the compatibles  Compute the constraints Covering conditions Covering conditions Closure conditions Closure conditions  Determine prime compatibles  Solve the resulting binate covering problem  Derive the minimized FSM from the solution

5 Compatibles  Definition: A compatible is a subset of states that can be combined together Compatibles can overlap Compatibles can overlap Unlike classes of equivalent state of the CS-FSMUnlike classes of equivalent state of the CS-FSM The number of compatibles can be exponential The number of compatibles can be exponential  Computation of the complete set of compatibles Find all the pairs of incompatible states Find all the pairs of incompatible states Start with one-step incompatible pairsStart with one-step incompatible pairs Traverse backwards to find all pairs of incompatible statesTraverse backwards to find all pairs of incompatible states Find all the subsets of states, which contain at least one incompatible state pair Find all the subsets of states, which contain at least one incompatible state pair Find all the non-empty subsets of states, which do not belong to the above set (these are compatibles) Find all the non-empty subsets of states, which do not belong to the above set (these are compatibles) Correction: Pair-wise compatibility does not guarantee group- wise compatibility. Additional checking is needed to show that the pair-wise compatible states belonging to a compatible, as computed above, are group-wise compatible. Correction: Pair-wise compatibility does not guarantee group- wise compatibility. Additional checking is needed to show that the pair-wise compatible states belonging to a compatible, as computed above, are group-wise compatible.

6 Variables and Constraints  Introduce a Boolean variable for each compatible This variable is 1 iff the compatible is selected to become a state after of the FSM after state minimization This variable is 1 iff the compatible is selected to become a state after of the FSM after state minimization  Constraints are of two types: Covering constraints Covering constraints Express the property that each state of the original machine is contained in at least one selected compatibleExpress the property that each state of the original machine is contained in at least one selected compatible Example: c1 + c3 + c6Example: c1 + c3 + c6 Closure constraints Closure constraints Express the property that, if a compatible is selected, then for every input there is a transition into another selected compatibleExpress the property that, if a compatible is selected, then for every input there is a transition into another selected compatible Example: c1 => c5 + c7 + c8Example: c1 => c5 + c7 + c8

7 Class Sets  Definition. For compatible C and input i, an implied set is a subset of states reachable from states in C under input i.  Definition. A class set of compatible C is its implied set D satisfying the conditions: D has more than one state D has more than one state D is not contained in C D is not contained in C D is not contained in any other implied set D’ of C D is not contained in any other implied set D’ of C

8 Prime Compatibles  To solve exactly the state minimization problem, it is sufficient to consider a subset of compatibles called prime compatibles.  It was shown that at least one minimum cover of the FSM consists entirely of prime compatibles A. Grasselli and F. Luccio. A method for minimizing the number of internal states in incompletely specified sequential networks. IRE Trans. Electr. Computers, EC-14(3): 350-359, June 1965. A. Grasselli and F. Luccio. A method for minimizing the number of internal states in incompletely specified sequential networks. IRE Trans. Electr. Computers, EC-14(3): 350-359, June 1965.  Definition. A compatible C’ dominates a compatible C if C’ contains C C’ contains C The class set of C’ is contained in the class set of C The class set of C’ is contained in the class set of C  Definition. A compatible C is a prime compatible if it is not dominated by any other compatible

9 Binate Covering Problem  BCP is a problem of finding an assignment of Boolean variables such that This assignment satisfies the covering and closure constraints expressed in the CNF form This assignment satisfies the covering and closure constraints expressed in the CNF form The number of positive polarity variables in the satisfying assignment is minimum The number of positive polarity variables in the satisfying assignment is minimum  BCP is a special case of weighted SAT problem The weights are 1 if the variable is positive and 0 if the variable is negative The weights are 1 if the variable is positive and 0 if the variable is negative

10 Setting Up the BCP Problem  Given is a set of prime compatibles with class sets computed  Covering constraints For each state S, which belongs to the compatible C, create the sum of prime compatible Ci, which contains this state For each state S, which belongs to the compatible C, create the sum of prime compatible Ci, which contains this state Example: C1 + C2 + C5.Example: C1 + C2 + C5. Correction: This constraint is needed only for the initial state. Correction: This constraint is needed only for the initial state.  Closure constraints For each compatible C and for each class set D of C, create the sum of compatibles Ci containing D For each compatible C and for each class set D of C, create the sum of compatibles Ci containing D Example: C => C2 + C7 + C12.Example: C => C2 + C7 + C12.  The number of constraints There are as many covering constraints as there are states There are as many covering constraints as there are states There are as many closure constrains as there are class sets in all compatibles There are as many closure constrains as there are class sets in all compatibles

11 Implicit Implementation  Given are the transition relation T(i,cn,ns) and the output relation O(i,cs,o) of the FSM  Use positional notation to represent sets of states Introduce as many Boolean variables as there are states in the FSM Introduce as many Boolean variables as there are states in the FSM A subset of states can be represented as one minterm A subset of states can be represented as one minterm For example, n = 6, subset is {s1,s2}, minterm is 011000.For example, n = 6, subset is {s1,s2}, minterm is 011000. A set of subsets of states (a set of compatibles) can be represented by a characteristic function A set of subsets of states (a set of compatibles) can be represented by a characteristic function Each on-set minterm of the characteristic function corresponds to one compatible belonging to the set of compatiblesEach on-set minterm of the characteristic function corresponds to one compatible belonging to the set of compatibles

12 Operations on Positional Sets  Equality: (X=Y) =  i (xi  yi)  Containment: (X  Y) =  i (xi  yi)  Strict containment: (X  Y) = (X  Y) & !(X=Y)  Complementation, union, intersection and sharp are Boolean operations: NOT, OR, AND, and AND-NOT

13 Set Containment and Set Union  Set-containment is true iff positional-set A contains positional-set B SetContain x (A,B) =  x[  A (x)   B (x)] SetContain x (A,B) =  x[  A (x)   B (x)]  Set-union of a number of positional sets is a positional set containing all the elements from the original positional sets SetUnion x (A,Y) =  i [yi  [  x(  A (x) & xi)]] SetUnion x (A,Y) =  i [yi  [  x(  A (x) & xi)]]

14 Maximal and Tuple n,k (x)  Maximal x (  A ) =  A (x) & !  y[  A (y) & (y  x)]  Tuple n,k (x) contains all positional sets of size n, containing exactly k ones Tuple(i,k){ if (k < 0 or i < k ) return 0; if ( i = 0 and i = k ) return 1; return ITE( xi, Tuple(i-1,k-1), Tuple(i-1,k) ); }

15 Output Incompatible Pairs  Definition. A pair is output incompatible there exists an input, for which the outputs are not compatible: OICP(y,z) = Tuple 1 (y) & Tuple 1 (z) &  i !  o[ O(i,y,o) & O(i,z,o) ]

16 Incompatible Pairs  ICP(y,z) = OICP(y,z)  ICP k+1 (y,z) = ICP k (y,z) +  i,u,v[T(i,y,u) & T(i,z,v)&ICP k (u,v)]  ICP k+1 (y,z) = ICP k (y,z) = ICP(y,z)

17 Incompatibles and Compatibles  IC(c) =  y,z [ ICP(y,z) &  i (yi+zi  ci) ]  C(c) = !Tuple 0 (c) & !IC(c)

18 Implied Set and Class Set  F(c,i,n) =  p [ C(c) & (c  p) & T(i,p,n) ]  CI(c,d) =  i [  n F(c,i,n) & SetUnion n (F(c,i,n),d)]  CCS(c,d) = !Tuple 0 (c) & !(c  d) & Maximal d CI(c,d)

19 Prime Compatibles  Dominance(c’,c) = (c  p) & SetContain d [CCS(c,d), CCS(c’,d)]  PC(c) = C(c) & !  c’[C(c’) & Dominance(c’,c)]


Download ppt "Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17."

Similar presentations


Ads by Google