190 likes | 359 Views
Exact State Minimization of Non-Deterministic FSMs. 290N: The Unknown Component Problem Lecture 17. Outline. Introduction The algorithm for exact state minimization Binate covering problem (weighted SAT) The implicit implementation of the algorithm Conclusions. Exact State Minimization.
E N D
Exact State Minimization of Non-Deterministic FSMs 290N: The Unknown Component Problem Lecture 17
Outline • Introduction • The algorithm for exact state minimization • Binate covering problem (weighted SAT) • The implicit implementation of the algorithm • Conclusions
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
The Algorithm • Generate the compatibles • Compute the constraints • Covering conditions • Closure conditions • Determine prime compatibles • Solve the resulting binate covering problem • Derive the minimized FSM from the solution
Compatibles • Definition: A compatible is a subset of states that can be combined together • Compatibles can overlap • Unlike classes of equivalent state of the CS-FSM • The number of compatibles can be exponential • Computation of the complete set of compatibles • Find all the pairs of incompatible states • Start with one-step incompatible pairs • Traverse 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 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.
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 • Constraints are of two types: • Covering constraints • Express the property that each state of the original machine is contained in at least one selected compatible • Example: c1 + c3 + c6 • Closure constraints • Express the property that, if a compatible is selected, then for every input there is a transition into another selected compatible • Example: c1 => c5 + c7 + c8
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 is not contained in C • D is not contained in any other implied set D’ of C
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. • Definition. A compatible C’dominates a compatible C if • C’ contains 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
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 • 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
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 • Example: C1 + C2 + C5. • 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 • Example: C => C2 + C7 + C12. • The number of constraints • There are as many covering constraints as there are states • There are as many closure constrains as there are class sets in all compatibles
Implicit Implementation • Given are the transition relationT(i,cn,ns) and the output relationO(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 • A subset of states can be represented as one minterm • 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 • Each on-set minterm of the characteristic function corresponds to one compatible belonging to the set of compatibles
Operations on Positional Sets • Equality: (X=Y) = i (xiyi) • Containment: (XY) = i (xi yi) • Strict containment: (XY) = (XY) & !(X=Y) • Complementation, union, intersection and sharp are Boolean operations: NOT, OR, AND, and AND-NOT
Set Containment and Set Union • Set-containment is true iff positional-set A contains positional-set B • SetContainx(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 • SetUnionx(A,Y) = i [yi [x(A(x)& xi)]]
Maximal and Tuplen,k(x) • Maximalx(A) = A(x) & !y[A(y) & (y x)] • Tuplen,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) ); }
Output Incompatible Pairs • Definition. A pair is output incompatible there exists an input, for which the outputs are not compatible: OICP(y,z) = Tuple1(y) & Tuple1(z) & i !o[ O(i,y,o) & O(i,z,o) ]
Incompatible Pairs • ICP(y,z) = OICP(y,z) • ICPk+1(y,z) = ICPk(y,z) +i,u,v[T(i,y,u) & T(i,z,v)&ICPk(u,v)] • ICPk+1(y,z) = ICPk(y,z) = ICP(y,z)
Incompatibles and Compatibles • IC(c) = y,z [ ICP(y,z) & i (yi+zi ci) ] • C(c) = !Tuple0(c) & !IC(c)
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) & SetUnionn(F(c,i,n),d)] • CCS(c,d) = !Tuple0(c) & !(c d) & Maximald CI(c,d)
Prime Compatibles • Dominance(c’,c) = (c p) & SetContaind[CCS(c,d), CCS(c’,d)] • PC(c) = C(c) & !c’[C(c’) & Dominance(c’,c)]