270 likes | 454 Views
FSM Decomposition using Partitions on States. 290N: The Unknown Component Problem Lecture 24. Outline. Once upon a time… Motivating example Terminology Definition of SP-partitions Decomposition using SP-partitions Computation of SP-partitions Extensions for ND FSMs. Motivating Example.
E N D
FSM Decomposition using Partitions on States 290N: The Unknown Component Problem Lecture 24
Outline • Once upon a time… • Motivating example • Terminology • Definition of SP-partitions • Decomposition using SP-partitions • Computation of SP-partitions • Extensions for ND FSMs
Motivating Example Y1 = y1’y2’y3x’+y2y3’x’ + y2y3x Y2 = y2’x +y1’y2’y3’x’ + y1y3 Y3 = y1x+y2y3’x + y2y3x’ + y1’y2’x’ Z = y2y3 Y1 = y1x+y1’x’ Y2 = y3x’ Y3 = y2’y3’ Z = y1’y2’y3’
Terminology • FSM is {I, O, S, , } • A partition on S is a set of disjoint subsets of states, whose set-union is S, i.e. = {Bk}; Bi Bj =, i j; Ui Bi = S • Notations • Subsets Bk are called blocks • B(s) denotes the block containing state s • s t iff s and t are in the same block, i.e. B(s) = B(t)
Partitions and Equivalence Relations • Relation R on sets S and T is a subset of pairs • R = { (s,t) | s R t } • Equivalence relation R • Reflexive: for all s, s R s • Symmetric: if s R t, then t R s • Transitive: if s R t and t R u, then s R u • Proposition. If R is an equivalence relation on S, then the set of equivalence classes is a partition on S, and conversely, every partition on S is an equivalence relation R
Operations on Partitions • Definition. Product of partitions, 1 and 2, is a partition 12 on S such that s 12 tiff s 1 tand s 2 t • Definition. Sum of partitions, 1 and 2, is a partition 1+2 on S such that s 1+2 tiff there exist a sequence of states in S, s=s0,s1,…,sn, for which si 1 si+1or si 2 si+1 • Definition. Partition 2 is larger or equal to partition 1, 12, if and only if 1 2 = 1 (equivalently, 1 + 2 = 2)
Example • S = { 1,2,3,4,5,6,7,8,9 } 1 = { 1,2 | 3,4 | 5,6 | 7,8,9 } 2 = { 1,6 | 2,3 | 4,5 | 7,8 | 9 } • 12 = { 1 | 2 | 3 | 4 | 5 | 6 | 7,8 | 9 } • 1+2 = { 1,2,3,4,5,6 | 7,8,9 } 1 2 3 4 5 6 7 8 9
Partitions as a Lattice • Definition. Let (S, ) be a partially ordered set, and T be a subset of S. Then s S is the least upper bound (l.u.b.) of T iff • s t for all t in T • s’ t for all t in T implies that s’ s • Definition. A lattice is partially ordered set, L = (S, ), which has a l.u.b. and a g.l.b. • Definition. If L is a finite lattice, then it has a l.u.b. and g.l.b. for the set of all elements in L, denoted by 1 and 0. Element 1 is called identity, and 0 is called zero. • Theorem. Partitions form a lattice.
Lattice of subsets of S={1,2,3} Lattice of partitions on S={1,2,3} Example {1,2,3} {1,2,3} {1,2} {1,3} {2,3} {1,2 | 3} {1,3|2} {1 | 2,3} {1} {2} {3} {1 | 2 | 3}
SP-Partitions • Definition. A partition on the set of states S of the machine M = (S,I,O,,) has the substitution property (is SP-partition) iff the states in any block, under all inputs, transit into another block, i. e. x [ s t ] [ (s,x) (t,x) ]
Example SP-partition: = { 1,2 | 3,4,5 } = { A,B } B A B
-Image of FSM • Definition. Let be an SP-partition on the set of states S of the machine M = (S,I,O,,). Then, the -image of M is the machine M = ({B},I,) with (B,x) = B’ iff (B,x) B’.
Example SP-partition: = { 1,2 | 3,4,5 } = { A,B } B A B
Observations • Observation 1. Machine Mperforms only part of the computation of machine M, because it only keeps track of which block of contains the given state. • Observation 2. If is an SP-partition, and we know the block of , which contains the given state of M, then we can compute the block of , to which this state of M is transformed by any input sequence. Machine M performs this computation. On the other hand, if is not an SP-partition, then it is not possible to predict where the given state will go under some input sequences. In other words, an SP-partition defines an uncertainty about the states of M, which does not spread as the machine operates.
SP-Partitions as a Sub-Lattice • Lemma. SP-partitions are closed under product and sum operations. • Theorem. SP-partitions form a sub-lattice of the lattice of all partitions
Example 1 = { 1,2 | 3,4 | 5,6 | 7,8 } 2 = { 1,2,3,4 | 5,6,7,8 } 3 = { 1 | 2 | 3 | 4,5 | 6 | 7 | 8 } 4 = { 1,2 | 3,4,5,6 | 7,8 } 5 = { 1 | 2 | 3,6 | 4 | 5 | 7 | 8 } 6 = { 1 | 2 | 3,6 | 4,5 | 7 | 8 } 1 4 2 5 3 1 6 0
Observations • Lattice of SP-partitions shows all non-trivial parallel-serial decompositions of the FSM • The lattice is a picture of FSM structure • Algebraic properties of the lattice are reflected in the machine properties, and vice versa • FSMs can be classified according to their lattices
Decomposition of FSMs • Definition. Machine M is decomposable into two machines, M1 and M2, if the set of i/o strings produced by M is equal to the set of i/o strings produced by the composition of M1 and M2. • Definition. Decomposition of M into two machines, M1 and M2, is non-trivial if M1 and M2have fewer states than M.
Parallel Composition • Definition. Given the state machines M1 = (S1, I, 1) and M2 = (S2, I, 2), and the output function : S1 S2 I O, the parallel composition of M1 and M2is the machine M = (S1 S2, I, O, , ), where ((s1,s2), (x1, x2)) = (1(s1, x1), 2(s2, x2)). M I1 S1 M1 O S2 M2
Serial Composition • Definition. Given the state machines M1 = (S1, I1, 1) and M2 = (S2, I2, 2) with I2 = S1 I1, a set of output symbols O, and an output function : S1 S2 I1 O, then the serial composition of M1 and M2 with the output function is the machine M = (S1 S2, I1, O, , ), where ((s,t),x) = (1(s, x), 2(t,(s,x))). I1 M S1 S2 O M1 M2
Theory • Theorem 1. Machine M has a non-trivial parallel decomposition iff there exist two non-trivial SP-partitions 1 and 2 on the states of M, such that 12= 0. • Theorem 2. Machine M has a non-trivial serial decomposition iff there exist a non-trivial SP-partition on the states of M.
Parallel Decomposition (part 1) SP-partitions: 1 = { 0,1,2 | 3,4,5 } = { A,B } 2 = { 0,5 | 1,4 | 2,3 } = { I,II,III } A B
Parallel Decomposition (part 2) M M S1 M1 I S2 M2 M1 M2
Serial Decomposition (part 1) SP-partition: = { 1,2 | 3,4,5 } = { A,B } B A B
Serial Decomposition (part 2) Another partition: = { 1,3 | 2,4 | 5 } = { a,b,c } a c b
Serial Decomposition (part 3) M M M1 M2 M2 M1
Computation of All SP-partitions • For every pair of states, s and t, compute the SP-partition containing these states in one block. • The resulting non-trivial partitions are the smallest partitions of the lattice of SP-partitions • Find all possible sums of the above partitions • The resulting non-trivial partitions are the remaining partitions of the lattice of SP-partitions