<p>If you choose a crisp, symmetric model of NFA $A$ with state set $Q$, where an input symbol maps a subset of $Q$ into another subset of $Q$, with initial and final (accepting) subsets of $Q$, then your sketch is practically a proof.  In fact, it will work even if you start, more generally, with an NFA rather than a DFA. (You do have a bit of confusion about final vs accepting states -- they are the same thing, and you'd simply interchange them)</p>

<p>To formalize it, you would indeed use induction to define the transition relation on strings and subsets of states: $\delta (Q_1,xa) = \delta (\delta (Q_1,x),a)$ and the reverse: $\delta_R (Q_2,ax) = \delta_R (\delta_R (Q_2,x),a)$ and show that you get an NFA $A_R$ that accepts exactly the reverses of strings accepted by $A$, the crucial step being that $\delta (Q_1,x)=Q_2 \Leftrightarrow  \delta_R (Q_2,x)=Q_1$ for string $x$. Finish by applying that to the initial and final state subsets, which define the language accepted by $A$ and its reverse by $A_R$, string reversal also being given by an inductive/recursive definition.</p>

CC BY-SA 3.0
2012-03-07T07:54:45.470Z
2012-03-07T17:17:08.277Z
2012-03-07T17:17:08.277Z
David Lewis
<p>I have seen descriptions for an algorithm that can take a regular deterministic finite automata and create a non-deterministic finite automata that is guaranteed to generate the reverse of string accepted by the DFA.  Does anyone know of a "formal" proof that shows this is true in all cases?  Guessing induction would be used to prove?</p>

<p>The algorithm goes something like this:</p>

<ol>
<li>Take original DFA, and change the initial state to the final state</li>
<li>Reverse all accepting states in DFA to non-accepting states</li>
<li>Set original starting state to accepting state and reverse all transitions</li>
</ol>

<p>Any thoughts would be greatly appreciated!</p>

CC BY-SA 3.0
2012-03-07T18:32:18.110Z
Welcome to cstheory, a Q&A site for research-level questions in theoretical computer science (TCS). Your question does not appear to be a research-level question in TCS. Please see the [FAQ] for more information on what is meant by this and suggestions for sites that might welcome your question. Finally, if your question is closed for being out of scope, and you believe you can edit the question to make it a research-level question, please feel free to do so. Closing is not permanent and questions can be reopened, check the [FAQ] for more information.
Kaveh
<fl.formal-languages><automata-theory><regular-language><compilers><automated-theorem-proving>
Proof that DFA that accepts string has NFA that accepts reversal of string
Prov
# Proof that DFA that accepts string has NFA that accepts reversal of string

(Asked by: username_0 on 2012-03-07)

I have seen descriptions for an algorithm that can take a regular deterministic finite automata and create a non-deterministic finite automata that is guaranteed to generate the reverse of string accepted by the DFA. Does anyone know of a "formal" proof that shows this is true in all cases? Guessing induction would be used to prove?

The algorithm goes something like this:

1. Take original DFA, and change the initial state to the final state
2. Reverse all accepting states in DFA to non-accepting states
3. Set original starting state to accepting state and reverse all transitions

Any thoughts would be greatly appreciated!

**Tags:** fl.formal-languages, automata-theory, regular-language, compilers, automated-theorem-proving
> **Comments:**
> **username_1**: Welcome to cstheory, a Q&A site for research-level questions in theoretical computer science (TCS). Your question does not appear to be a research-level question in TCS. Please see the [FAQ] for more information on what is meant by this and suggestions for sites that might welcome your question. Finally, if your question is closed for being out of scope, and you believe you can edit the question to make it a research-level question, please feel free to do so. Closing is not permanent and questions can be reopened, check the [FAQ] for more information.  

---

## 1 answers

### Answer by username_2 on 2012-03-07. Score: 4

If you choose a crisp, symmetric model of NFA $A$ with state set $Q$, where an input symbol maps a subset of $Q$ into another subset of $Q$, with initial and final (accepting) subsets of $Q$, then your sketch is practically a proof. In fact, it will work even if you start, more generally, with an NFA rather than a DFA. (You do have a bit of confusion about final vs accepting states -- they are the same thing, and you'd simply interchange them)

To formalize it, you would indeed use induction to define the transition relation on strings and subsets of states: $\delta (Q\_1,xa) = \delta (\delta (Q\_1,x),a)$ and the reverse: $\delta\_R (Q\_2,ax) = \delta\_R (\delta\_R (Q\_2,x),a)$ and show that you get an NFA $A\_R$ that accepts exactly the reverses of strings accepted by $A$, the crucial step being that $\delta (Q\_1,x)=Q\_2 \Leftrightarrow \delta\_R (Q\_2,x)=Q\_1$ for string $x$. Finish by applying that to the initial and final state subsets, which define the language accepted by $A$ and its reverse by $A\_R$, string reversal also being given by an inductive/recursive definition.


---

