Combining Dfas PDF
Combining Dfas PDF
Motivation
It is always possible to start and build up an recognizer from scratch, but if we come up with
procedures to combine automata, it is possible to use existing machines to complete tasks more rapidly.
This module will example the construction of the following machines, and how to use JFLAP to
determine the resulting machine.
1) How to take the complement of a machine: a machine which accepts anything which is not
accepted by the original machine.
2) How to take the union of a machine: a machine which accepts that which is accepted by any of
two or more machines.
3) How to take the intersection of a machine: a machine which accepts that which accepted by all
of two or more machines.
By using 1,2 and 3, we can define:
4) The subtraction of two machines: a machine which accepts that which is accepted by a given
machine, but not the other.
Complement of a Machine
Consider a very simple machine, using the alphabet {a,b}, for example a machine which accepts the
symbol a.
The complement of this machine, would be a machine which accepts anything other than the single
symbol a , including accepting nothing.
To correctly take the complement of this machine, it is necessary to provide a transition to an accept
state on any additional input. Since the input alphabet is {a,b} both of these symbols must cause the
transition to an accepting state.
To use JFLAP to construct the DFA corresponding to the union we will define an NFA to model the
joint states of the machines, and then convert the NFA to a DFA and minimize the DFA.
Step 1: Create a NFA from the two DFAs. Open one of the DFAs and use the Combine Two option on
the Convert menu to select the other machine.
Step 2: Add an initial state with null transitions to the initial states of the two machines. Test to see if it
accepts both a and b
Step 3: Using JFLAP, convert to a DFA by using the convert>DFA tool, and Complete and press Done.
Can you identify the resulting states with the corresponding pairs of the original machine?
Step 4: Minimize the resulting system. Click on a node in the right most window, click on Complete
Subtree in the Minimization tool, and then finish. Press complete in the left window and then Done
To find
We use
As an example of the procedure, lets form the intersection of the simple machines above.
Step 1 : Take the complement of the two machines
Step 2: Take the union of the two complemented machines
Step 3: Convert to DFA and Minimize
Step 4: Take the complement of the final machine.
Illustration 5: Result of Step 1 and 2
For example, consider the machine (A) which accepts a or b, and remove the states associated with the
machine(B) which accepts only b.