Reversal (as the name implies) involving swapping states and transitions in a FSA, such that it accepts the reverse of a language. The procedure for producing a minimally equivalent DFA (from an NFA) requires reversal.
If has more than one accept state, is guaranteed to become a NFA. Else, it can be a DFA (if was originally a DFA).
Procedure
Let be an finite state automata. To reverse (to produce ) , we:
- Check if has only one accept state, . If it does, do nothing. If has more than one accept state, create a new state and connect all previous accept states to via epsilon transitions That is, for each state in , add an -transition from that state to . Then, make this the only accept state.
- Reverse every transition. That is, if we had , it now becomes .
- Finally, make the initial state and make the initial state the accept state. I.e. swap the accept and initial states.
%%🖋 Edit in Excalidraw, and the dark exported image%%