How can I construct a DFA of the language L = { L1 \ L2 }
The DFA's of L1 and L2 are given, but how can I "substract" one DFA from another? Is this somehow possible with the relative complement http://en.wikipedia.org/wiki/Complement_(set_theory) and DeMorgans Law?
My solution:
To my understanding, the desired DFA can be obtained by using a modified product automaton, as used for the intersection of L1
and L2
, but the terminal states have to be defined differently. Instead of making a product state (q_1,q_2)
a terminal state if and only if q_1
and q_2
are terminal states in A(L1)
and A(L2)
respectively, define it to be a terminal state if and only if q_1
is a terminal state and q_2
is not a terminal state.
I'm not quite sure if besides this elementary argument, the result can be applied by the set formulation of De Morgan's law.