Computer - New - Automata Theory Lecture 6 Equivalence and Reduction of Finite State Machines
Computer - New - Automata Theory Lecture 6 Equivalence and Reduction of Finite State Machines
• Two finite-state machines are equivalent if they have the same input
alphabet (and for machines that output strings, the same output
alphabet), and if for every input string, the two machines produce
the same output.
• The concept of equivalence raises two questions. Firstly, how can we
tell if two given finite-state machines are equivalent? Even though
their alphabets are finite, there are infinitely many possible input
strings because an input string can be arbitrarily long. We cannot
possibly test them all.
• Starting with the initial state, A, we can reach the state B (and also the black hole,
Z, since the diagram has no arrow leading out of A with a “1” label).
• From D we can reach Z and A. So starting from A the only states we can ever reach
are A, B, D and Z. The others, C, E and F are inaccessible and so can be deleted.
• The systematic way of doing this is to prepare a list of accessible states. But first
it’s a good idea to express the FSA as a state table
• The State Table for the above FSA is:
• We begin by writing down the initial state, in this case A. Even if it’s
not possible to ever return to that state, it’s accessible simply
because we start there.
• A: look out for the input state of state “A” , write them out
• A B Z ……….(1)
Next state of the above is state B, hence write out its inputs B
BD, putting it in equation (1) we have
• A B Z B D ….(2)
• Remove one B as B.B=B
• A B Z D …….(3)
• The next state is Z ( note that you deal with the states as they
appear in the production)
• Z ZZ
• A B Z D Z Z , taking only one Z we have
• A B Z D ………(4)
• Next is state D which has ZA as the input, simplifying, we have
• A B Z D Z A = A B Z D…..(5)
• But now there is nothing further to be considered.
• We can simply erase the corresponding rows from the table to give:
• Equivalent States
• Consider the diagram bellow and find its equivalent
• Solution:
(2) Introduce the accepting states with
(1) draw the state table asterisk
• We rule up a table with as many rows as in the original table, but with many columns.
• We copy the states, and the transition table into this larger table and then copy the
accepting state column into the next column, converting *’s to 1’s and blanks to 0’s.
• The next column gives the 0-equivalence partition, “1” for accepting states
and “0” for non-accepting states. Denoted by ≡0.
• Then fill the 0ther columns by looking for the combination of each input
state and assign them the values they now assume from the 0-equivalence
column
• Fill these new combination under the new possible input values.
• The 0-equivalence and these new input values column forms a pattern to
generate the first-equivalence
• These three column starting from the first set of input pattern forms the
first-equivalence rows in order of encounter.
• Label this column starting from 0 until the last pattern is exhausted
• Then we scan those columns, together with the ≡1 column itself,
to get the ≡2 column.
• States B and D are equivalent (at all levels) so having them both
involves unnecessary redundancy.
• Example:
• Identifying states B and D and also F and G in the above example we
get the reduced machine.
• Solution
• Because F is the initial state we must label it 0. Since T(F, 0) = A,
state A must be labelled “1” (the next available number).
• The next blank occurs in the shaded cell and that corresponds to
T(A, 0) = S.
• Looking down the last column we note that S has not yet been
assigned a code, so it gets the next available code of 2.
•
• Solution: All states are accessible.
Identifying state C with B and D with A: Putting it in standard form we get:
• Class done finish