I am trying to understand the larger problem of the decidability of the equality of two DFAs. I understand that this problem can be solved using minimizing DFAs, but my textbook states this can be done using symmetric difference.
Theorem: Let $EQ$ be a language, where $EQ$ = $\{<A,B> \mid \text{A and B are both DFAs and L(A) = L(B)}\}$. In my notation, $L(X)$ stands for the language that DFA $X$ recognizes.
Prove that $EQ$ is decidable. This relies on the symmetric difference of 2 sets.
Proof: Let $Q$ be a decider defined as:
On input $<A,B>$ do:
- Construct a DFA $C$ such that $L(C) = (L(A) \cap \overline{L(B)}) \cup (\overline{L(A)} \cap L(B)) $
- Run $<C>$ on the algorithm used to determine if the language recognized by a DFA is $\emptyset$ (We proved this is decidable before, and I have no issues with that).
- If that algorithm accepts, then $Q$ accepts
- If that algorithm rejects, then $Q$ rejects
For $Q$ to be a decider, we must prove that $Q$ will halt. Since we have proven that the algorithm used in step 2 is decidable, it will halt. So I have no problems with steps 2-4.
But the first step, how can I prove that constructing $C$ in that way will halt? I understand that the symmetric difference will result in a regular language because of the closure properties, but how can a decider actually carry out this process and be guaranteed to halt?
So this is my primary question, what is the algorithm for determining the language that a DFA accepts? I.e. given DFA $X$, how can I determine $L(X)$ (Again, this must halt, so we can't try every string in existence or something like that).
Some follow up questions are: What if the DFA in question accepts an infinite set of strings, how can we possibly represent that on the decider's tape (or if the complement of $L(A)$ is infinite, etc.)? How can a decider determine the compliment of a set? And if $L(C)$ ends up being an infinite set of strings, how can we process that so that we can construct DFA $C$?
My book simply states
These constructions are algorithms that can be carried out by Turing machines.
which drives me nuts! Prove it.