An important tool in our understanding of finite state automata is in converting from a non-deterministic finite automaton (NFA) to a deterministic finite automaton (DFA).
Okay problem: NFA states can have multiple edges. We can create a concatenated state that’s the union of any destination states, i.e., for , we can create . Then, any of the original output transitions are also concatenated. If either and/or are accepting states, then the union is also an accepting state.
Any missing states in our NFA are assigned the empty set. This is converted to the error state (where all edge transitions are self-loops).
The epsilon-closure (E-closure) of a state , denoted , is the set of states that can be reached from by one or more transitions, including itself. The E-closure of a set of states , denoted is the set union of E-closures of members of :
If there are transitions in the NFA, we instead use the epsilon-closures to encode the states. We follow these steps:
- First, compute the epsilon-closures of the states.
- Create as a set with the E-closure states of .
while
there are unmarked states in- Select an unmarked state from and possibly add to transition table.
- For each input symbol, compute the E-closure of states that we can transition to from the current state.
- Add new states that DNE in to . If the states we found in the step above already exist in , we can skip them.
- Make the accepting states of the NFA accepting states in the DFA.