LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN 51 . 84 I^6T no. 171-187 cop. a. Digitized by the Internet Archive in 2013 http://archive.org/details/sometheoremsalgo174puar Report No. I7U 510. f 4- SOME THEOREMS AND ALGORITHMS vto. 174— ON A NEW FORM OF DECOMPOSITION FOR AUTOMATA cop. 3 by W Arthur T. Pu April 12, 1965 JAW 07 1366 LlBkAkY Report No. Ifk SOME THEOREMS AND ALGORITHMS ON A NEW FORM OF DECOMPOSITION FOR AUTOMATA by Arthur T. Pu April 12, 1965 Department of Computer Science University of Illinois Urbana, Illinois ACKNOWLEDGMENT The author wishes to thank Professor David E. Muller of the Department of Mathematics for his helpful suggestions. INTRODUCTION In recent years, due to the need to obtain economical realization of machines, especially large computers, intensive effort has been devoted in the theory of decomposition of machines. Based on criterion of reduced dependence, Hartmanis [^-,5] and Hartmanis and Stearns [6,7] have published a series of articles on this subject. Probing through the properties of semi- groups, Krohn and Rhodes [9] were able to attain a rather general theory. However, their results and the results of most of the others [13,1^-] were based on the question of decomposition into series or parallel connections. The information is not allowed to interflow between blocks. With the new technology, such as microelectronic technique, progressing so rapidly, the problem of economical realization no longer lies in the com- plexity of logical design in each building block. Rather it tends to depend on the number of connections between basic building blocks. The problems arising from future practical design thus will clearly emphasize the importance of having smaller number of connections. With this in mind, the present work starts from an entirely new approach to the problem of decomposition. This approach allows information to interflow between blocks. Hopefully, some of the known results will be special cases of our theory. This report represents the result of preliminary investigation. Part 1 is devoted to the basic theorems of decomposition. A decomposition of a machine M = into two machines M , M ; M = , M = is defined as a one-to-one mapping cp from S ~* A X B satisfying certain conditions. We prove that for any given n , n there is at least one decomposition of an n-state machine into two machines with n , n states each if and only if n n > n. We further define the notion of "strongly equivalence" between two decompositions of a given machine, and later give a necessary and -1- sufficient condition. We introduce the concept of connecting lines between decomposed machines. Using the notion of covering, we show that the problem of determining the number of connecting lines becomes a covering problem. Finally, we introduce the new concept of "measure" and give a special example of such a measure. In order to obtain a best decomposition with respect to a measure, we must have a method to generate all decompositions of a machine. In Part 2, we develop two algorithms. The first one generates without duplication all decompositions of a given machine up to strongly equivalence. The second algorithm generates without duplication all decompositions for a fixed pair of integers n , n . The above algorithms do not depend on the specific measure one is using, thus it can be used to obtain a best decomposition with respect to any measure. ■2- PART 1 1. Basic Theorems of Decomposition Let us consider an automaton M = , where S denotes the set of states, T the set of input letters and f the transition function. Let the number of states in M be n. Let n , n be two positive integers such that n,n > n. Let A', B' be two sets of n , n elements respectively. Then there exist one-to-one functions from S -* A' X B'. Let cp be such a function. Let A C A' , B C B' such that A = {a e A' |(a,b) e Image cp for some b e B'} B = {b e B' |(a,b) e Image cp for some a e A'}. For each a e A and b e B, define B = {b e B|(a,b) e Image cp} cl A = {a e A|(a,b) £ Image cp} for (a,b) e Image cp, let s denote the state in S such that cp(s ) = (a,b), aD ao and for each t e T, let (a ,b ) = cp(f(s ,t)). For each a e A, define clu f :B X T -* B such that f (b,t) = b , for each b e B and t € T. Similarly, cl a. 9, cl we may define f-,:A, X T -* A such that f (a,t) = a . It is easy to check that ff } . and ff, }, _, are well defined. We now have the relation for each 1 a J aeA l VbeB s e S, t € T cp(f(s,t)) = (f b (a,t),f a (b,t)) where cp(s) = (a,b) . Now suppose we consider the tuples: and , we cl . D . i J know that they form incomplete machines. Therefore, for each correspondence cp -3- from states S to A X B, it induces a natural decomposition of machines into smaller machines (however, incomplete ones). Figure 1 can be regarded as the block diagram of our decomposition. Each a. € A, b . e B will be viewed as states, and {f }, {f, ] are transition 1 ' ,] ' a . b . i J functions. Original inputs are fed into both parts. Although we can regard the parts after decomposition as machines by considering f or f as part of a . d . i J the input, we shall refer to them as partial machines in order to distinguish them from others. Inputs Inputs "b. 3 -f"W* a. i FIGURE 1 Definition 1 . A decomposition of an n-state machine into two incomplete machines with n , n , states respectively where n n > n, is a one-to-one mapping cp from the n-tuple (s,,s p , ...,s ) to (a. , a. ,...,a. ) X (b . , . . . ,b . ) n i 1 i 2 1 n ' °1 J n such that [1,2,3,..., n-J = (i^ig,. . .,i Q ) and (1,2,..., n g ) - Cj^...,^}. We remark that in the above definition we may consider "P( s v) = ( a - ,"b • ) f° r each s e S. Furthermore, for cp to be a decomposition k X k J k k we required that A = A' and B = B' . -h- Theorem 1. For a given n-state machine M there is at least one decomposition into two incomplete machines with n , n states respectively iff n-^ > n, n < n, and n < n. Proof . Suppose n n > n and n < n, n < n. Let n > n . Let A, B be two sets with n , n elements respectively; A = (a 1 ,a 2 , . . . ,a n ) B- 0, v -b z ,...,-b ) The desired decomposition is cp(s s ,...,s ,s ,...,s ,...,s ) 2 2+1 1 (a ,a ,...,a ) x (b ,b ,...,b ) x l 2 n J l J 2 d n a n ,a ,...,a ,a ,...,a ,a ,...,a ) X (b.. ,b , . . . ,b ,b , . . . ,b ) 1' 2' ' n' n_ ' ' n ' p ' ' p 1' 2' n ' q n q 2 2+1 1 ^1 ^n-n 2 ^1 n-n where b , a are chosen arbitrarily from B and A respectively such that q. p. i k (a. ,b . ) ^ (a. ,b . ) whenever k ^ I and 1 < k, i < n. Conversely, consider X k J k ' X l 3 £ a decomposition cp of a given n-state machine M. Let n , n_, be the numbers of distinct a. , b. respectively. Then n n_ > n; otherwise cp cannot be one-to-one, Since there are only n-states, none of n , n can be bigger than n. QED Definition 2 . Let P be a permutation on {l,2,...,n , ) and P be a permutation on {l,2,...,n }. We define P X P as an operation which sends d A is (a ,...,a ) X (b ,...,b ) to (a , } ,...,a , } ) X (b , y...,* ,. v). 1 n J l J n A U 1 ; A U n ; B u l ; B V V -5- Definition 3 - Two decompositions cp , cp p of the same n-state machine are said to be strongly equivalent ; cp = cp if and only if n , n are the same for both cp , cp such that if , are the decomposed machines, then A , A are the same machine, and B , B are the same machine (up to renaming the states and inputs). We note that two n-state machines are the same if (l) there exists an assignment of states to distinct numbers such that their transition tables are the same, and (2) if for each input i in one machine there exists an input j in the other and vice versa such that their next state table are the same. Lemma 1 . Given two decompositions cp , cp p of an n-state machine with the same n n and n_, if P„ is a transposition on a. , a. , for some k, £, 1 < k, £ < n n , 1 2' A l'l-,' — — 1 k £ such that cp = (P X l)cp . Then cp = cp . Proof. Let cp,(s,,...,s ) = (a. ,...,a. ,...,a. ,...,a. ) X (b . , . . . ,b . ). T l 1 n i n ' l, i/i i j, j 1 k £ n 1 n Then (P X l)q> (s n , . . . ,s ) = (a. ,...,a. ,...,a. ,...,a. ) X (b . , . . . ,b . ). A ^V 1' n y i 1 ' ' i^' ±^' i n y j ' j n y We shall prove the lemma in two parts. (a) To show that A , A p are the same machine. Consider A, , A p as machines by regarding B X T as the set of input alphabets. In the transition table of A , we denote each state a. , 1 < m < n , by m. m Thus, the states a. , a. are denoted by k and £ respectively. In the \ X i transition table of A_, we denote each state by the same number as in A, , except a. , a. will be denoted by k, £ respectively. Since cp = (P X l)cp £ \ d A 1 and P is a transposition on a. , a. , the transition tables of machine A, A X k X i 1 and A p after the above denotation will be the same. Thus A , A are the same machine. (b) To show that B and B are the same machine. In both the transition table of B, and B p , let each state b . , 1 < m < n , m be denoted by m. The transition tables of B , B are the same except under -6- the inputs (i X a. ) and (I X a. ) as I ranges over T. However, for \ X H each (i X a. ) in B there is an input (i X a. ) in B and vice versa such that their next states are the same. This is caused by the trans- position P . Therefore, B , B are the same machine. QED Theorem 2 . Two decompositions cp , cp , of the same n-state machine are strongly equivalent if and only if n, , n , are the same for both decompositions such that there are two permutations P , P such that cp = (P X P )cp . A d d A 15 ± Proof. Suppose n , n are the same for cp , cp and there are P., P^ such that J- 2 1 d A B cp 2 = (P A X Pg)^- Certainly (P A X P B )cp 1 = (P A X l)(l x Pg)^- Since every permutation is a composition of transpositions, by repeated usage of Lemma 1, we have cp = cp . Conversely, let cp (s ,...,s ) = (a ,...,a ) X (b , . . . ,b ) and 1 n J l J n cp 2 (s 1 , . . .,S n ) = (a R ,. . . ,a k ) X (b^ , . . . ,b - ) and that cp 1 = cp 2> Now consider 1 n 1 n 3- . « • • • « 3- . i/ i l i a V'' a k J 1 n' Since cp = cp implies cp and cp have the same n and n p , thus there is exactly n., distinct a. among them. Moreover since A n , A^ have the same transition 1 l 1' 2 table, it is not hard to see that if a. = a. , then a n = a, . Then let P. be ' i i ' k k A m n m n the n distinct columns in £L. • • • • « ct . X l 1 n Similarly, we obtain P It is easily shown that cp = (P X P R )cp-, . QED -7- Proposition 1 . For a given n-state machine M, there is just one equivalence class of decomposition in which n or n ? is one. Proof . Let cp , cp be any two decompositions of M with n = 1. By Theorem 1 } n is necessarily n. Let cp 1 (s 1 , S2 ,..., Sn ) - (a^...,^) x (b ,...,b. ) 1 n (P 2 (s 1 ,s gJ ...,s n ) = (a 1 ,...,a 1 ) x (b , . . . ,b ) ■h J n We have (l,2,...,n) = (i-^ig, . . . ,i n ) = (j-^jg, . . . ,0 n 3 Let P = I = identity permutation and B " Then P is a permutation on (1,2,..., n). Clearly cp„ = (P. X P T) )cr n . Thus cp p = cp by Theorem 2. QLD Proposition 2 . Given an n-state machine M, there is just one equivalence class of decomposition with n = n = n. Proof . Let cp , cp , be two decompositions of M with n = n = n. Let cp^s ,...,b ) = (a ,a. ) x (b b ) 1 n °1 n and cp 2 ( Sl ,...,s n ) = {* ,...,a i ) X (D ,...,* ) 1 n 1 n We also have: -8- (1,2,. ..,n) = {i 1 ,...,i n } = {j 1 ,...,j n } = U lf ...,£ n ) = {k 1 ,...,k n } Let Then it is obvious that P , P are permutations on the set {l,2,...,n} and A B that cp 2 = (P A X P B )cp x . QFD Definition h . For any two symbols a , a of A, f is compatible with f ; Ida, a^ f ~ f if and only if they are the same mapping over their common domain a i a 2 (i.e., B n B XT). a l a 2 We note that compatibility is not an equivalence relation. It is an equivalence relation only when n n p = n, since in that case the common domain for all f is B X T. a Suppose we consider a set of mutually compatible functions f as one cl . 1 function. As a. ranges over A, we obtain a collection of such distinct functions 1 ' If t. is the number of elements in this collection, denote by F. the minimum t. l ' A i as we range over all such possible collections. Similarly, we define F^ . In B view of the nature of f and f , it is reasonable to take [log F ] and St . D . r\ i J |"log F 1 as the numbers of lines from A to B and from B to A respectively. For any nonnegative real number x, fx| denotes the least nonnegative integer bigger or equal to x. Here we shall introduce the covering problem. A cover E of a given set A is a collection of nonempty subsets A, of A such that their union is A; •9- £= (A k |A k C=A, U I A k = A) Any collection of elements in Z having the same property, namely their union is A, is a subcover of the cover Z. A minimum subcover L of a given cover Z is a subcover such that it has the least cardinality. The classical covering problem is to find the minimum subcover of a given cover of a set. Let A = {a ,a , ...,a ). Let Z = {\l\ C A > such that a11 f ,a. 6 A, , will be the same function over their common domain}. If Z^ is a i minimum subcover of Z, then the cardinality of Z^; card (Z^) is equal to F . Since a subcover Z n of Z is a subfamily of Z such that for each f , a e A, 1 H i a. is in some element of Z , therefore if L is a minimum subcover, card (ZuJ = F . Thus, the problem of finding F , F - which is the same as the problem of determining the number of connecting lines becomes a covering problem. This covering problem is the same problem as, for example, the state minimization of incomplete machines. Thus, a detailed discussion of this type of problem can be found in several articles [1,2, 3,8,10>12] • As noted before, the compatibility is an equivalence relation only when n n n_ = n. In this case, the numbers F., F are uniquely determined by the numbers of equivalence classes. This is the special case where the given cover Z of A (or B) is itself the minimum cover. As for the case when n n > n, we can still obtain a crude estimation on the nuriber of connecting lines without going into the covering theorem as follows. For a given state a. e A and input I € T, we refer the set of all a. € A which are next states of this state input pair (a.,l) under all possible f, as the successor set. Let L A be the maximum number of distinct elements in \ A all the successor sets as (a.,l) ranges over A X T. -10- Proposition 3 . The number L is a lower bound on the number of input configurations from B to A (i.e., [log L 1 is a lower bound on the number of connecting lines from B to A). Proof . The definition of L implies that there are at least L number of distinct f , since these f map the same input state pairs to distinct next J 3 state. Therefore L is a lower bound. QED A similar result for L„ can also be obtained. J3 2. The Measure of a Machine In the course of studying the theory of decomposition of machines, one natural question arises as to how one compares one decomposition against another. Here, we will introduce the notion of a "measure" of a machine, and we extend it to be "a measure of a decomposition." Now we will show some required properties of a measure of a machine and its relationship to a measure of a decomposition. A measure should be a real -valued function which measures the complexity of a given machine. Certainly, it is a function of the number of states as well as the number of input alphabets. This measure should be able to extend to be a measure of a decomposition and there the number of connection lines reveals its importance. For a single-state machine, the measure should equal zero. This is due to the fact that in reality it requires nothing to construct. If one puts two identical n-state machines side by side, the performance will be the same as one n-state machine. However, it is twice as complicated. Thus the measure for such a decomposition should be twice that of the original n-state machine. This also shows that the measure of a decomposition is the sum of the measures of each decomposed machine. Thus, for a decomposition which gives a single-state machine as a part, the decomposition will have a measure equal to that of the -11- original measure of the machine. This also coincides with the actual fact, since it necessarily is a composition of a single-state machine and an original machine. We remark that the number of connecting lines alone cannot be the measure of a decomposition. Once again, if one considers two identical n-state machines operating side by side, there is no connecting line, yet the decomposi- tion is twice as complicated. The following is the development of a special measure of a machine. This measure seems to be quite reasonable and it satisfies all the desired properties . 3. A Special Measure For an n-state machine M of K input configurations and Q output configurations, the circuit realization in terms of a set of combinational logical devices and memory elements is given in Fig. 2. K inputs ,. ■ r\ outputs . Combinational Logic T- — ^ .__ y i \ y 2 Y 2 . • y n 9 Y n Memory FIGURE 2 ■12- By a result of Muller [11], the maximal complexity for any electronic switching circuit of p inputs and q outputs is determined to be |3[2 /r], where r = p + log q and p is a constant independent of p and q. Applying it to our case, for the combinational part, p = log k + log n and q = log Q + log n. Then r = log nk + log log nQ. Therefore, we have the complexity for the combinational part: p[2 r /r] nk log Qn log nk + log log nQ Since |3 is a constant independent of p,q, we can eliminate the term [log log nQ] in the above expression [1]]. We shall define this complexity to be zero in the case when both denominator and numerator vanish. For the memory part, the complexity is defined as a [log n], where a is a constant. Definition 5 . The measure 0t\ of an n-state machine with k inputs and Q outputs is: ?n = a [log n] + p nk log nQ log nk For nonprinting machines, Q is one; thus the measure for such machines is: a [log n] + p nk log n log nk r A Definition o . Two inputs t , t of T are said to be A equivalent; t = t , if and only if for all a e A, f (b,t ) = f (b,t ) for all b whenever the equation makes sense. -13- Definition 7 - If a , a , in A, then a is said to be equivalent to a ; a, =a iff f ~ f and for all b e B, f. (a.,t) = f. (a_,t) for all t € T, 12 a a^ ' V 1' ' b N 2' ' ' whenever the equation makes sense. ■p Similarly, we can define t = t and b s bp. Suppose cp is a decomposition of a given n-state machine M. (We shall always consider nonprinting machines unless otherwise stated. ) Let n A be the number of distinct a. under -" and T. the number of distinct t under l A "=". We denote similarly for r^, T . Using Definition 5 the measure 7P for part A in Fig. 1 ^l k = a [log n A -] + (3 VA F B lQg n A ' • l0 S n A T A F B ■ Correspondingly, the measure 77\ for part B is: ^? B = a [log rig] + r n B T B F A log "B l0gn B T B F A Definition 8 . The measure of a decomposition cp is defined as the sum of the measure of part A and part B. Now we proceed to show that this measure does have the desired property. Proposition h . Let 7T( be the measure of a given n-state machine M. If cp is any decomposition of M into two machines such that M = M - M , then 7?' - 2ffi , where #7 denotes the measure of cp. Proof . By Proposition 2, there is essentially one type of decomposition with n = n = n. Let the machine M be of K inputs. Then by Definition 5 , ■\h- 7n M = a [log n] + p nK log n log nK For the decomposition cp, it can be shown that F = F = 1, T. = T = K and A rs A d n = rL = n. Readily, we have: ^7=2 ia[log n] + nK log n log nK = 2fr, (u QFD Proposition 5. If cp is any decomposition of a given n-state machine M into two machines such that M is a 1-state machine, then frf = fy V2 '1 cp ; M" Proof. If M is of 1-state machine, by Theorem 1, M must be of n-state machine. By Proposition 1, there is essentially one type of decomposition with n = 1, ii- = n. Again, assume M is of K inputs. Then it can be easily shown that for decomposition cp, n = 1, n A £5 T^ = K. Hence, F A = F B = 1, T A = 1 and -7T) = a[log n] + p nK log n log nK = % M QFD has another feature. Let an n-state machine be such that n = n n In addition to the desired properties, our special choice of measure Consider the worst case in which n ■■-- n , rL == n_, F^ = n_, F. = n_, T. : K == T_,. This A1Jdc:i3c:A1A d is the case where nothing can be reduced under the defined equivalence relations. Then the measure of this decomposition is: -15- M - a [log n ] + p ' n l ¥:n 2 l0g "l 1 log n-Kri- + a[log n 2 ] + p rn 2 Kn 1 log n g log n 2 Kn 1 a[log n 1 + log n 2 ] + p ■n n K(log n_ + log n ) log nK = a [log n] + p nK log n log nK — m This particular decomposition has a measure equal to that of the original machine. It shows that the measure of any decomposition with n n = n cannot be greater than that of the original machine, since this is the worst situation that we can have. In fact, it can be stated more rigorously. Proposition 6 . For any nonprinting n-state machine M with K input, any decomposition cp of M with n = n • n have measure equal to or less than that of the original machine. Proof . Let n = n n with n > ru. We will consider the worst case. We know that the maximal number of distinct compatible functions is limited by the number of elements in the domain. In fact, for B part the number F_ is limited by n 2 I F B = Min[n 2 ,1^] Similarly for F . Since n > n , F = n , then the measure for the decomposition in the worst case is ypi = [log n 1 J + a [log n 2 ] + p ■n Kn 2 log n 1 log n ] Kn 2 j + P ' n 2 KF B l0g n 2 _ log n 2 KF B = a [log n] + p _ nK log n 1 log nK + P rn 2 KF B log n 2 log n 2 KF B -16- X Thus, by replacing F^ by n n and by the fact that . B 1 log x function for x > 2, we have is an increasing ■n 2 KF B log n 2 i _ log n 2 KF B j < nk log n r c log nK Therefore we have 7n < a[log n] + p nK log n log nK in M -17- QED PART 2 A best decomposition of a given machine is defined to be the one which gives the least measure. Now, suppose we are interested in finding a best decomposition of a machine with respect to our special measure. Since 1 < n < n, 1 < n < n and n n > n, there are only finitely many choices of n and n . Thus, it is possible to find the best decomposition. For our choice of measure, the numbers n^ n } F, F^, T , T play the most important part. Yet, once the decomposi- tion is given, these numbers are uniquely defined. Thus, the problem of finding a best decomposition becomes a problem of finding all possible decompositions for a machine. This later task, if successful, will be independent of the choice of measure. Therefore, for any reasonable choice of measure, this algorithm will be able to give the best decomposition according to that measure. 1. An Algorithm for Generating All Decompositions without Duplication Consider an array of n X n squares with rows labeled a. , 1 < i < n, and columns labeled b., 1 < j < n. They are labeled in consecutive order. Then J a square in a.th row and b .th column is labeled (a.,b.). Suppose we denote each state in an n-state machine by a number in an arbitrary way from 1 to n. Each placement of these n numbers into the n X n array of squares is a one-to-one mapping cp from (l,2,...,n} to A X B in such a way that cp(i) is equal to the label of the square in which the number i is placed. Then cp is indeed a decom- position of the n-state machine. Definition 9 - The kth rectangle is a k X k array of squares in which k squares are occupied such that at least one of the k occupied squares lies in each row and each column. -18- Definition 10 . If the kth rectange is a k X k array of squares, then the kth neighboring rectangle is a (k + l) X (k_ + l) array of squares. In order to make possible a procedure to generate decompositions without duplication, we shall order the squares in this n X n array of squares. There are many ways of doing this. However, we shall make the following choice for ordering these squares. The ordering will he done during the algorithm. The square at the upper left-hand corner will have the least order. As all squares of kth rectange are orders, order the kth neighboring rectange as follows: first order the new column (if any) from up to down, then order the new row from left to right. The square that is common to both the new column and the new row will have the highest order. Definition 11 . A state j is said to be moved in order in the kth (neighboring) rectangle if the state j is moved step by step into unoccupied squares of the kth (neighboring) rectangle according to the order of the squares. State j is not allowable to be moved into any square that state j has occupied previously. The algorithm starts with certain initial decomposition. The initial decomposition is obtained as follows: State 1 is put into the square at the upper left-hand corner. After putting state i, the unordered squares of the ith neighboring rectangle will be ordered according to the method mentioned before. Then state (i + l) is put into any unoccupied square of the ith neighboring rectangle. As this process terminates we obtain an nth rectangle. All squares in the nth neighboring rectangle have been ordered. If the nth rectangle is n x n~, we have a decomposition of this n-state machine into two partial machines with n ,n states each. -19- In each move in the following steps, if there are unordered squares appearing in the neighboring rectangle, we shall order them according to the ordering method mentioned before. However, the ordering will not exceed the boundary of this n X n array of squares. Step 1 . State n is moved in order in the (n - l)th neighboring rectangle. Each move results in a new decomposition. After state n has occupied the square having the highest order in the (n - l)th neighboring rectange, execute the next step. Step i . (A ) State (n - i + l) is moved in order in the (n - i)th neighboring rectangle. (A ) For each move in (A,), state (n - i + 2) is moved in order in the new (n - i + l)th neighboring rectangle. ,A.) For each move in (A. ,), state (n - i + j ) is moved in order in the new (n-i+j - l)th neighboring rectangle. (A.) For each move in (A. n ) , state n is moved in 1 N i-l" order in the new (n - l)th neighboring rectangle. Each sequence of execution from (A.. ) to (A. ) results in a new decomposition. After each state (n - i + j), 1 < j < 1, reaches the perspective highest orders in the perspective neighboring rectangles, execute the next step. -20- We will now proceed to show that the above algorithm will generate all decompositions of an n-state machine without duplication. Proposition 7 - From each strongly equivalence class of decomposition, there is a representative of the following form: 1. The state 1 is in the upper left-hand corner. 2. State 2 is in one of the unoccupied squares in the first neighboring rectangle. 3. After state i is obtained, state (i + l) is in one of the unoccupied squares in the ith neighboring rectangle. Proof . As a result of Theorem 2, any permutation among a. (or b.) will give strongly equivalent decompositions. Thus each equivalence class will have a representation in the above form. QED From here on, we refer to the above form of a decomposition to be the normal form. For a given decomposition cp in the normal form, for each a. e A, let min cp (a.) denote the minimum number k such that cp(s ) - (a.,b.) for any 1 K. ' 1 j b. € B. Proposition 8 . For any given a., a. € A, i < j if and only if min cp" (a.) < min cp" (a.). Proof . (l) Let a., a. e A such that i < j . Since cp is in the normal form, at least one state is in a.th row before any later state is in a.th row. Thus min cp (a. ) < min cp~ (a . ) . (2) Conversely, let min cp (a. ) < min cp" (a.) and i f. j. Then i > j. J Yet, by the proof of (l), i > j implies min cp" (a.) > min cp" (a.) which leads to a contradiction. Hence if min cp" (a.) < min cp" (a.), then i < j. QED -21- Proposition 9 - From each strongly equivalence class, there exists a unique representative in the normal form. Proof. Suppose there are two decompositions cp, , cp_ both of normal form and = cp„. Then there exists permutations P., P^ such that (P. X P- D )cp 1 = cp_. If 1 2 A rs A is J. d P A 4- If then it is at least a transposition on some letters a., a.. Without A ' ' i J loss of generality, assume i < j. By Proposition 8, min qr (a.) < min cp (a.). -L _L J- ^J -1 -1 -1 -1 However, min cp (a.) = min cp (a.) and min cp (a.) = min cp (a.). Therefore, £~ X. _LJ C— fj J__L we have i < j implies min cp Q (a.) > min cp_ (a.), which contradicts the assumption C— J. C— fj that cp is in the normal form. Therefore, P = I. Similarly, we can show P = I. Hence the representative in normal form from each strongly equivalence B class is unique. QED Theorem 3 . All decompositions of a given n-statemachine M are generated without duplication from the above algorithm. Proof . First, we note that the algorithm will terminate. The ordering of the squares is done during the process of the algorithm. The size of the nth rectangle is expanding until it reaches the boundary of n X n array of squares. Eventually, only squares inside the n X n array of squares are ordered. Thus, the algorithm terminates as soon as the states exhaust all finite possible moves, In the construction of the algorithm, we require state 1 to be at the upper left-hand corner. For each state (i + l), it is in one of the squares in the ith neighboring rectangle. Therefore, only decompositions of the normal form are generated. Now, we shall prove by induction on the number of states that each decomposition cp in the normal form is generated. Suppose cp is such a decomposi- tion in the normal form for a two-state machine. Then cp is of one of the following three types: (l) n ± = 1, n p = 2; (2) n = 2, n^ = 2; (3) n ± = 2, n = 1. In the algorithm, state 1 is fixed, and there are three unoccupied but -22- ordered squares in the first neighboring rectangle. However, state 2 is moved in order in these three unoccupied squares. Hence, no matter which one of the three type cp is, cp is obtained. Suppose this is true for any j-state machine. Namely, so long as cp is of the normal form, the positions of each of the j states in the j X j array of squares will be reached by the algorithm. Consider the first j states of a given (j + l) -state machine. These j states are inside the j X j array of squares. By induction hypothesis, the positions of these states can be reached. State (j + l) is in any unoccupied but ordered square in the jth neighboring rectangle. Since state (j + l) is moved in order, the position of the (j + l) state under cp can also be reached by the algorithm. Hence, for any n-state machine, this algorithm generates all decompositions of the normal form. Since by Proposition 7 > each strongly equivalence class contains a representative in the normal form, therefore, this algorithm essentially generates all decompositions of a given n-state machine. From Proposition 9> the representation in normal form from each strongly equivalence class is unique, hence this algorithm generates all decompositions without duplication. QED Remark 1 . The n X n array of squares is symmetric with respect to the main diagonal. Therefore, although the algorithm generates no duplication, it will generate two decompositions cp = , cp = such that A n ,B are the same and B ,A are the same. This can be eliminated if we put more restriction in the algorithm. We can make modifications to the above algorithm such that only decompositions whose n, , n are less than or equal to some fixed numbers n' , n' respectively, will be generated without duplication. ■23- The method of ordering the squares will "be the same except that only the squares inside n' X n' array of squares will be eventually ordered. We require the initial decomposition to have an nth rectangle less than or equal to n' X n' The algorithm is exactly the same as before. Since the ordering will not continue in that direction once it reaches the boundary n' (or n'), the proof for generation without duplication of all decompositions whose n , n ? are less than or equal to n' , n' respectively is the same as before. 2. An Algorithm for Generating without Duplication All Decompositions with n , n p Fixed The following is the construction of an algorithm which generates only those decompositions whose n , n are fixed (n n > n). These are decompositions whose nth rectangles are exactly n X n . Suppose we are putting n states into an n X n array of squares. State 1 is put into the square at the upper left-hand corner. Suppose state i is put into some unoccupied square in the (i - l)th neighboring rectangle, and the resulting ith rectangle is n . X n . l^i 2, i Proposition 10 . If n - i > n - n . > and n - i > n - n . > 0, then state (i + l) can be put into some squares in the ith neighboring rectangle such that n - (i + 1) > n 2 - n 2 i+1 > and n - (i + l) > r^ - n ± ±+1 > 0. Proof . First, we shall describe the method. If n - i > n - n > and d d , 1 n - i > n - n . > 0, then state (i + l) is put into any unoccupied square in J- JL « X the ith neighboring rectangle. If n - i = n - n . > (or n - i = n - n . > 0), state (i + l) must be put into the (n . + l)th row (or (n . + l)th column). l,i d , i Let the resulting (i + l)th rectangle be (n.. . .. X n_ . ,). Certainly & v ' & v l,i+l 2,i+l 7 J n n ., > n n . and n_ . .. > n^ . l,i+l - l,i 2,i+l - 2,i -2k- (a) if n - i > n. - n. . > and n - i > n n - n 1 . > 0. We have v ' 2 2,1 1 l,i n-i-l>ru-ru. - 1 > 0. Since these integers, 2 2,i n-i-l>n^-n o .>0. Therefore n - (i + l) > n - n . _ > 0. — 2 2,i — 2 2,i+l — Similarly, n - (l + l) > n - n- . - > 0. (b) if n - i > n A - n n . = and n - i > n n - n n . > 0. We have v ' 2 2,i 1 l,i — n-i-l>n-n=0. Since n^ = n^ , then n 2 i = n 2 i+l = n 2' Therefore n - (i + l) > n„ - n . , = 0. If n - i > n, - n_ . = 0, we — 2 2,i+l 1 l,i can similarly obtain n- (i + l) > n_ - n n . n =0. If J — 1 l,i+l n - i > n - n . > 0, we can obtain n - (i + l) > n - n > by (a). _L J_ y 1 -L J- y It J- (c) if n - i = n - n . > (or n - i = n - n > 0). In this case, n n . , = n n . + 1. Thus n-i-l = n_ -n n . - 1 > 0. l,i+l l,i 1 l,i - Hence n - (i + l) = n, - (n_ . + l) = il. - il. . > 0. Q£D 1 l,i 1 l,i+l— Proposition 11 . After the state n is in some square (using the method in Proposition 10) we obtain a decomposition of this n-state machine into two partial machines with states n and n each. Proof . By Proposition 10 we know for each state i, n - i > n - n • ^ an< ^- n-i>n-n_.>0. Thus, when i = n, we have > n n - n . > and > n^ - n^ . > 0. Hence n., = n n and n^ = n„. Therefore, the nth rectangle — 2 2,i — l,n 1 2,n 2 ' is exactly n X n . QED Definition 12 . A state (i + l) is said to be moved in order into an allowed square in the ith neighboring rectangle if state (i + l) is moved in order such that (1) when n - i - n„ - n_ . (or n - i = n - n . ), this square (— £- « J. J- J. • 1 lies in the (n_ . + l)th column (or in the (n n . + l)th row). 2,i l,i (2) when n - i > n - n . and n - i > n~ - n_ . , this square lies in the ith neighboring!; rectangle. -25- We shall start the algorithm with an initial decomposition whose nth rectangle is exactly n_ X n_. This is done by the method described in Proposition 10. The ordering of the squares is as before. Once the initial decomposition is chosen, all n 1 n_ squares are ordered. Let (n - i) be the smallest number such that for state (n - i), n-(n-i)=n, -n. . and n-(n-i)=n„-n~ 1 l,n-i 2 2,n-i Step 1 . State (n - i) is moved in order into an allowed square in the (n - i - l)th neighboring rectangle. Each move results in a new decomposition. After state (n - i) reaches the allowed square of the highest order, execute the next step. Step j . (A ) State (n - i - j) is moved in order into an allowed square in the (n - i - j - l)th neighboring rectangle. (A, ) For each move in (A ), state (n-i-j + k-l) is moved in order into an allowed square in the new (n-i-j+k-2)th neighboring rectangle. (A. . .. ) For each move in (A. .), state n is moved in in order into an allowed square in the new (n - l)th neighboring rectangle. Each sequence of move from (A, ) to (A. . n ) results in H v r v i+j+1 a new decomposition. After each state reaches its perspective allowed squares of highest order, execute the next step. •26- Theorem h . For any given n-state machine M, if n , n are given fixed numbers such that n n > n, then all decompositions into machines with exactly n , n state each are generated without duplication by the above algorithm. Proof. The algorithm will terminate since there are only finitely many allowed squares for each state. By Proposition 10 and Proposition 11, we know that each decomposition obtained from the algorithm will have the nth rectangle exactly equal to n X n . Since these decompositions are also obtainable from Theorem 3, only the representatives in the normal form of the strongly equivalence classes are generated. Suppose for a given decomposition cp, the procedure outlined in Proposition 10 is violated for some state i. Then if n, . X n_ . is the l,i 2,i resulting ith rectange, we have n - i < n - n . > or n - i < n - n . > 0. Suppose n - i < n - n > 0. No matter how one puts the rest states (i + l), (i + 2), . . . , n, we have n < n +1, where i + 1 < k < n. Hence 1,K — K.,1— 1 n n . . < n n . + j for 1 < j < n - i. Therefore n, - n n . . > n n - (n, . + j). 1,1+ J - l,i - J - 1 1,1+ J - 1 l,i Yet n - (i + j) < n - (n . + j). Thus n - (i + j) < n - n . . for i 1,1 i 1,1+ j 1 < j < n - i. For i = n - i, we have < n n - n n . Therefore n, ^ n n . — — ° 1 l,n l,n ' 1 Hence any violation in the procedure will not generate a decomposition of the desired typed. Since the representative in the normal form from each strongly equivalence class is unique (Proposition 9), all decompositions into partial machines with n , n state each are generated without duplication. QFD Remark 2 . When n = n , the case discussed in Remark 1 will occur. If n ^ n , then n X n array of squares is not symmetric with respect to the main diagonal. Therefore all decompositions are distinct even if we do distinguish the machine on the right from the left. -27- REFERENCES Beatty, J. and R. E. Miller. "Some Theorems for Incompletely Specified Sequential Machines with Applications to State Minimization." AIEE Proceedings of the Third Annual Symposium on Switching Circuit Theory and Logical Design , pp. 123-136, September 1962. Ginsburg, S. "A Technique for the Reduction of a Given Machine to a Minimal State Machine." Trans. IRE , EC-8, vol. 3, pp. 3^6-355, September 1959- Ginsburg, S. "Synthesis of Minimal State Machine." Trans. IRE , EC-8, vol. h, pp. 441-4^9, December 1959- Hartmanis, J. "Symbolic Analyses of a Decomposition of Information Processing Machines." Information and Control , 3, pp. 15^-178, June i960. Hartmanis, J. "On the State Assignment Problem for Sequential Machine I." Trans. IRE , EC-10, pp. I57-I65, June 1961. Hartmanis, J. and R. E. Stearns. "On the State Assignment Problem of Sequential Machine II." Trans. IRE , EC-10, pp. 593-603, December 1961. Hartmanis, J. and R. E. Stearns. "Pair Algebra and Its Application to Automata Theory." Information and Control , 7, pp. 485-507, December I96U. Karp, R. "Some Techniques of State Assignment for Synchronous Sequential Machines." IBM Report RC-938, May 1963. Krohn, K. and J. L. Rhodes. "Algebraic Theory of Machines I, II, III." Proceedings of the Symposium on Mathematical Theory of Automata , Brooklyn, Polytechnique Institute, April 1962. Miller, R. E. "State Reduction for Sequential Machines." IBM Research Report RC-121, June 15, 1959. Muller, D. E. "Complexity in Electronic Switching Circuits." Trans. IRE , EC-5, March 1956. Paull, M. C. and S. H. Unger. "Minimizing the Number of States in Incompletely Specified Sequential Switching Functions." Trans. IRE , EC-10, PP. 356-367, September 1959. Yoeli, M. "The Cascade Decomposition of Sequential Machines. " Trans. IRE , EC-10, pp. 587-592, December 1961. Yoeli, M. "Cascade-Parallel Decomposition of Sequential Machines." Trans. IRE , EC-12, pp. 322-323, June 1963. -28- tUlec Ut .processor ol vi»u» 30112088398208