Concise Representations of Reversible Automata

,


Introduction
Reversibility is a fundamental principle in physics: in thermodynamics a transformation is reversible if, after occurring, it can be inverted in order to recover the original state of the system.In the study of computational models, reversibility means that each elementary step can be inverted, thus recovering the previous state of the system.In other words, every configuration must admit at most one predecessor.As shown by Landauer, the irreversibility in computation leads to heat dissipations [10], while Toffoli proved that it is ideally possible to build sequential circuits with zero internal power dissipation [16].This observation suggested to study reversible computations in which there is no loss of information.
Reversibility has been studied on various computational models.In the case of general devices as Turing machines, Bennet proved that each machine can be simulated by a reversible one [1], while Lange, McKenzie, and Tapp proved that each deterministic machine can be simulated by a reversible machine which uses the same amount of space [11].As a corollary, in the case of a constant amount of space, this implies that each regular language is accepted by a reversible two-way deterministic finite automaton.Actually, this result was already proved by Kondacs and Watrous [6].In the case of one-way automata, the situation is different a .The class of languages accepted by reversible automata is a proper subclass of the class of regular languages.For example, the regular language a * b * cannot be accepted by any reversible automaton [15], even if multiple initial states are allowed.Classical automata, namely automata with a single initial state and a set of final states, have been considered in the works by Holzer, Jakobi, and Kutrib [4,7,8].In particular, they gave a characterization of regular languages which are accepted by reversible automata [4].This characterization is given in terms of the structure of the minimum deterministic automaton, i.e., the smallest deterministic automaton accepting the language under consideration.Furthermore, the authors provided an algorithm that, in the case the language is acceptable by a reversible automaton, allows to transform the minimum deterministic automaton into an equivalent reversible automaton, which in the worst case is exponentially larger than the given minimum automaton.In spite of that, the resulting automaton is minimal, namely there are no reversible automata accepting the same language with a smaller number of states.However, it is not necessarily unique.In fact, contrary to the minimum deterministic automaton that is unique for a fixed language, there could exist different reversible automata with the same (minimal) number of states accepting the same language.Further results concerning minimality and reducibility for reversible automata have been proved in [3,12].
Due to the above mentioned exponential state gap between deterministic automata and equivalent reversible automata, an explicit representation of a minimal reversible automaton can be exponentially larger than the representation of the corresponding minimum deterministic automaton.However, the minimal reversible automaton produced by the construction provided by Holzer, Jakobi, and Kutrib [4] is obtained by creating copies of some parts of the minimum automaton.So, its transition table contains repeated patterns.Thus, it is interesting to investigate whether it is possible to obtain a concise representation of it, by avoiding to repeat those patterns.To this aim, in this paper we present two concise representations of reversible automata, which can be used to simulate reversible computations without explicitly writing down the description of the reversible automaton.
The first representation is based on a parameter β which is equal to the maximum number of incoming transitions with the same letter in each state of the given deterministic automaton A. Given β and A it is possible to simulate the computations of a reversible automaton A equivalent to A, without explicitly representing it.The drawback of this simple representation is that even when the given automaton A is minimum, the simulated reversible automaton A is not necessarily a From now on, we will consider only one-way automata.Hence we will omit to specify "one-way" all the times.minimal.This motivates us to look for a different concise representation, which exploits the fact that all the minimal reversible automata accepting a language have the same "state structure", in the sense that, for each given A, there exists a function c : Q → N, such that for each state q in A, there exist exactly c(q) states equivalent to q in each minimal reversible deterministic automaton equivalent to A [12].The second representation is given in terms of the minimum deterministic automaton A accepting the language under consideration and such function c.We prove that, by using such representation, it is possible to simulate the behaviour of a minimal reversible automaton equivalent to A without explicitly representing it.Both representations have polynomial size with respect to the size of the given deterministic automaton A and require a precomputation (of the parameter β and of the function c, respectively) which can be performed in linear time.

Preliminaries
In this section we recall some basic definitions and results that will be used in the paper.For a detailed exposition, we refer the reader to [5].Given a set S, let us denote by #S its cardinality and by 2 S the family of all of its subsets.Given an alphabet Σ, |w| denotes the length of a string w ∈ Σ * and ε the empty string.
A deterministic automaton is a tuple A = (Q, Σ, δ, q I , F ), where Q is the set of states, Σ is the input alphabet, q I ∈ Q is the initial state, F ⊆ Q is the set of accepting states, and δ : Q × Σ → Q is the partial transition function.The function δ can be extended to words in the standard way.The language accepted by A is , there exists w ∈ Σ * such that δ(q I , w) = p, and productive, i.e., if there is w ∈ Σ * such that δ(p, w) ∈ F .When the set of states Q is finite, the automaton A is said to be a deterministic finite automaton (dfa).In this paper we only consider automata with only useful states.
We say that two states p, q ∈ Q are equivalent if for all w ∈ Σ * , δ(p, w) ∈ F exactly when δ(q, w) ∈ F .Two automata A and A are said to be equivalent if they accept the same language, i.e., L(A) = L(A ).By minimal automaton (in a certain family of automata) we mean an automaton with a minimal number of states.When the minimal automaton is unique (e.g., for the family of all dfas accepting a certain regular language) we call it minimum.
A strongly connected component (scc) C of a dfa A = (Q, Σ, δ, q I , F ) is a maximal subset C of Q such that in the transition graph of A there exists a path between each pair of states in C. We introduce the relation ≺ on the set of sccs of A, such that, for two such components Given a dfa A = (Q, Σ, δ, q I , F ), a state r ∈ Q is said to be irreversible when #δ R (r, a) ≥ 2 for some a ∈ Σ.In this case, for each q ∈ δ R (r, a), the transition from q on a is said to be irreversible.If a state is not irreversible, then it is said to be reversible.The dfa A is said to be irreversible if it contains at least one irreversible state, otherwise A is reversible (rev-dfa).As pointed out in [8], the notion of reversibility for a language is related to the computational model under consideration.In this paper we only consider dfas.Hence, by saying that a language L is reversible, we refer to this model, namely we mean that there exists a rev-dfa accepting L. The following result presents a characterization of reversible languages: Theorem 2] Let L be a regular language and M = (Q, Σ, δ, q I , F ) be the minimum dfa accepting L.Then, L is accepted by a rev-dfa if and only if there do not exist two states p, q ∈ Q, a letter a ∈ Σ, and a string w ∈ Σ * such that p = q, δ(p, a) = δ(q, a), and δ(q, aw) = q.
According to Theorem 1, a language L is reversible exactly when the minimum dfa accepting it does not contain the forbidden pattern consisting of two transitions on the same letter a entering in the same state r, with one of these transitions arriving from a state in the same scc as r.An algorithm to convert a minimum dfa M into an equivalent rev-dfa, if any, was obtained in [4].Furthermore, the resulting rev-dfa is minimal.
We present an outline of the algorithm.It iteratively builds a rev-dfa A in the following way.At the beginning A is a copy of M .Then, the algorithm considers a minimal (with respect to ) scc C that contains an irreversible state and replaces it with a number of copies which is equal to the maximum number of transitions on the same letter incoming in a state of C.This process is iterated until all the states in A are reversible.
In [4], it has also been observed that there are reversible languages having several nonisomorphic minimal rev-dfas, while in [12, Lemmata 5 and 6] the following result has been proved: Lemma 2. Let M = (Q, Σ, δ, q I , F ) be the minimum dfa accepting a reversible language L. There exists a function c : Q → N such that for each state q ∈ Q: • in any rev-dfa equivalent to M there are at least c(q) different states equivalent to q. • in any minimal rev-dfa equivalent to M there are exactly c(q) different states equivalent to q.
Furthermore, if p, q ∈ Q are in the same scc, then c(p) = c(q).

A Simple Concise Representation
In this section we present our first concise representation.Let us start with a construction for simulating a dfa by an equivalent rev-dfa, in which we use the information about the maximum number of incoming transitions with respect to the same letter in the irreversible states.
Let A = (Q, Σ, δ, q I , F ) be a dfa with all useful states and let β be the maximum number of transitions on the same letter incoming in a state of A, i.e., We observe that β > 1 if and only if A is irreversible.We define the following automaton with infinitely many states A ∞ = (Q × N, Σ, δ , q I , F × N) where: • The transitions are defined as follows: Let δ(q, a) = p and δ R (p, a) = {q j1 , . . ., q j k }, k ≥ 1 for q, p ∈ Q, a ∈ Σ.Then, for x ≥ 0: where i ∈ {1, . . ., k} is such that q = q ji .
Notice that, if δ ( q, x , a) = p, y then x ≤ y.Roughly speaking, the idea of the construction is to use the second component of the states of A ∞ as labels in order to distinguish different copies of a state reached from an irreversible transition in A. The formula used for the second component allow us to obtain this goal, as we will prove in Theorem 3.
We denote by A the automaton obtained by restricting A ∞ to useful states.
Theorem 3. Let A = (Q, Σ, δ, q I , F ) be a dfa and A = (Q , Σ, δ , q I , F ) be the automaton obtained by applying the above construction to A, restricted to useful states.Then L(A ) = L(A) and A is reversible.
We showed that A simulates A. We have now to prove that it is finite if and only if A does not contain the forbidden pattern.
Theorem 4. The automaton A = (Q , Σ, δ, q I , F ) obtained by applying the above construction to a dfa A = (Q, Σ, δ, q I , F ) is infinite if and only if A contains the forbidden pattern.

Proof. (⇒) If
A contains infinitely many states then for each m > 0 there exists a string w ∈ Σ * such that δ (q I , w) = q, x with x ≥ m and q, x ∈ Q is an useful state.Without loss of generality we can choose w in such a way that the second component of the state which is reached in A by reading any proper prefix of w is smaller than x.Thus w = w 1 a 1 w 2 a 2 • • • w a , with w 1 , . . ., w ∈ Σ * , a 1 , . . ., a ∈ Σ, such that irreversible transitions are used on a ˆ only, for ˆ = 1, . . ., .
We consider the path on w in A .By construction, the second component of a state is changed only while reading symbols a ˆ , ˆ = 1, . . ., : let δ ( q I , 0 , w we can find two values i = j, such that the pairs (a i , p i ) and (a j , p j ) are equal.Without loss of generality suppose i < j.Then in A we have #δ R (p i , a i ) > 1 and δ(p i , w i+1 a i+1 , . . ., w j a j ) = p j = p i , which gives the forbidden pattern in A.
(⇐) If A contains the forbidden pattern then there exist two useful states and δ(p 2 , aw) = p 2 .Let r = δ(p 1 , a) and δ R (r, a) = {q j1 , . . ., q j k }.Since p 1 = p 2 we get k > 1 and two different indices i, i such that p 1 = q ji and p 2 = q j i .Moreover, β > 1.Now we want to prove that the simulation of the forbidden pattern bring us to have infinitely many useful states in A .
Due to p 1 = p 2 , in A there exist two different states of the form p 1 , x 1 and p 2 , x 2 such that δ ( Since r and p 2 belong to the same scc, in A there exists a path from r, x2 to some state p 2 , y 2 with y We can iterate this argument by obtaining a sequence of infinitely many useful states r, x , ≥ 0 and x −1 < x .This allows us to conclude that A contains infinitely many states. Two examples related to the previous construction are shown in Figure 1 and Figure 2, where β = 2. Let us apply the construction to transform the dfa shown in Figure 1 through an equivalent rev-dfa.Given for instance δ(q 3 , b) = q 5 , we have δ R (q 5 , b) = {q 3 , q 4 }, k > 1 and i = 1.Then δ ( q 3 , 1 , b) = q 5 , 2 .Now we apply the same construction to the dfa in Figure 2. Given for instance δ(q 1 , b) = q 2 , we have δ R (q 2 , b) = {q I , q 1 }, k > 1 and i = 2. Then δ ( q 1 , 0 , b) = q 2 , 1 .This time taking δ(q 2 , a) = q 3 , we have δ R (q 3 , a) = {q 1 , q 2 }, k > 1 and i = 2. Then δ ( q 2 , 1 , a) = q 3 , 3 .Actually, the simulation of a computation on a string does not require the explicit construction of the automaton A .In fact, once we have β the computation of the automaton can be obtained, using the transition table of A and (1).For instance on aba we have the following steps: Notice that the second components in the states having the same q are not necessarily consecutive numbers, in the sense that it is possible to have some gaps in the numbering as illustrated in Figure 2 (states of the form q 3 , x in the automaton on the right).
We point out that the automaton A can be simulated without explicitly constructing its transition table.Indeed, to simulate A it is enough to know the value of β, which can be computed from the transition table of A, and to follow the transitions of A applying (1) to compute the states reached by A .So, a concise representation of A is given by the value of β and the automaton A. We will discuss later in this section how to compute β and how much the value of the second component of a state of A can be large.
Even when applied to a minimum dfa, the above construction produces a revdfa which is not necessarily minimal as illustrated in Figure 3 and Figure 4: in Figure 3 a minimum dfa M = (Q, Σ, δ, q I , F ) and an equivalent minimal rev-dfa (obtained by applying the algorithm in [4]) are shown.Notice that the minimal rev-dfa contains five states which are equivalent to q 7 .Instead, Figure 4 shows the rev-dfa A obtained by the above construction (notice that β = 3 and the chosen order for each set of states with outgoing transitions to a reversible state with the same letter is: (q 2 , q 3 ) for δ R (q 4 , b), (q I , q 5 , q 6 ) for δ R (q 7 , a), and (q 5 , q 6 ) for δ R (q 7 , b)).In particular, A contains six states equivalent to q 7 .q I q 1 q 2 q 3 q 4 q 5 q I , 0 q 1 , 0 q 2 , 0 q 2 , 1 q 3 , 0 q 4 , 0 q 3 , 1 q 4 , 1 q 5 , 0 q 5 , 1 q 5 , 2 q 5 , 3  It could be interesting to observe that, by choosing a different order for the states in δ R (q, a), q ∈ Q, a ∈ Σ, and applying the same construction, the minimum automaton in Figure 3 is simulated by a minimal rev-dfa.For example, the minimal rev-dfa in Figure 5 is obtained by applying the construction to A and considering the following order: (q 3 , q 2 ) for δ R (q 4 , b), (q 6 , q 5 , q I ) for δ R (q 7 , a), and (q 6 , q 5 ) for δ R (q 7 , b).
Concise Representations of Reversible Automata 9 q I q 1 q 2 q 3 q 4 q 5 q 6 There also exist cases in which the (non)minimality is not influenced by the selected order of the states.Let us consider, for example, the automaton in Figure 6.Recalling that the simulation increases the value of x in each pair q, x only when an irreversible transition is encountered along a path, let us show how the construction works.For the sake of simplicity, we proceed by analyzing the states in topological order.
Starting from q I = q I , 0 and reading b(a + b), no irreversible state is passed through, so the second parts of the state pairs do not change.Reading the symbol b, the state q 4 can be reached from q 2 and q 3 .Since there are no copies of these states, the only possible reached states should be q 2 , 0 and q 3 , 0 , leading to the state set { q 4 , 0 , q 4 , 1 }, independently from the chosen order of the states {q 2 , q 3 } = δ R (q 4 , b).Thus, by reading a or b, it is possible to reach the states { q 5 , 0 , q 6 , 0 , q 5 , 1 , q 6 , 1 }.Let us now consider the state q 7 : it can be reached from q I , 0 , q 2 , 0 , and q 3 , 0 with the letter a, thus leading to the states in { q 7 , 0 , q 7 , 1 , q 7 , 2 } = r q7,a , independently from the chosen order of the elements in δ R (q 7 , a).Furthermore, q 7 can be also reached from the states q 5 and q 6 by reading the symbol b.Recalling that the only reached states in the simulation equivalent to q 5 and q 6 are q 5 , 0 , q 6 , 0 , q 5 , 1 , and q 6 , 1 , it is possible to reach the states in { q 7 , 0 , q 7 , 1 , q 7 , 3 , q 7 , 4 } = r q7,b by reading a b, independently from the chosen order of the states in δ R (q 7 , b).So, considering all the reached states of the simulated automaton, it is possible to observe that there are five copies equiv-q I q 7 , 0 q 7 , 1 q 7 , 2 q 7 , 3 q 7 , 4 q 7 , 5 alent to q 7 , while the minimum number of copies of such a state, obtainable by applying the algorithm by Holzer, Jakobi, and Kutrib outlined in Section 2, would be four, as shown in Figure 6, i.e., #(r q7,a ∪ r q7,b ) > c(q 7 ), where c(q) denotes the number of different states equivalent to q in any minimal rev-dfa (cf.Lemma 2).
In Theorem 4 it has been proved that when a dfa A does not contain the forbidden pattern, then the automaton A obtained by applying the above construction is finite.Furthermore, by Theorem 3, A is reversible and, as already observed, not necessarily minimal.Hence, it is interesting to know what is the maximum value of the second component in a state of A .In order to give a bound we will use the following lemmata.
Lemma 5. Given a dfa A with at least two states, if the initial state q I is not reversible or every state other than q I is not reversible, then A contains the forbidden pattern.
Proof.Let A = (Q, Σ, δ, q I , F ) be a dfa.Since transitions entering the initial state q I can only arrive from states in the same scc of q I , if the initial state would be irreversible, then A should contain the forbidden pattern.
Suppose now that q I is reversible and every state other than q I is irreversible.Let p 0 be one of them.Then, there are two incoming transitions in p 0 with the Concise Representations of Reversible Automata 11 q I , 0 q 1 , 0 q 2 , 0 q 3 , 0 q 4 , 1 q 4 , 0 q 5 , 1 q 6 , 1 q 5 , 0 q 6 , 0 q 7 , 4 q 7 , 3 q 7 , 1 q 7 , 0 b, a b, a b, a b, a a Fig. 5.A minimal rev-dfa obtained by applying the construction to the dfa in Figure 3, for a suitable chosen order for the states with outgoing transitions on the same symbol to irreversible states same letter a 0 from two different states.At most one of them could be q I , while the other one, say p 1 , must be irreversible.Hence, even in p 1 there are two incoming transitions with the same letter a 1 from two different states, where at least one of them, say p 2 , is irreversible.By iterating the argument we can construct an arbitrarily long sequence of irreversible states p 0 , p 1 , p 2 , . . .and letters a 0 , a 1 , a 2 , . . .such that #δ R (p , a ) > 1 and δ(p +1 , a ) = p for ≥ 0. Since Q is finite, sooner or later we will find i, j, i < j, such that p j = p i .This implies that there is a string w = a j−1 a j−2 • • • a i+1 such that δ(p j , wa i ) = p i .Since p i = p j and p i has two incoming transitions on the same letter a i we conclude that A contains the forbidden pattern.
We are now ready to prove the following lemma.Lemma 6.Let A = (Q , Σ, δ , q I , F ) be the automaton obtained by applying the above construction to a dfa A = (Q, Σ, δ, q I , F ) which does not contain the forbidden pattern.Given w ∈ Σ * and q = δ(q I , w), let p 1 , . . ., p k ∈ Q be all the states reached by irreversible transitions during the computation of A on input w.Then δ (q I , w) = q, x , where 0 ≤ x < β k .
a Fig. 6.A minimum dfa for which it is not possible to simulate the rev-dfa by using the construction based on the knowledge of β and an equivalent minimal rev-dfa obtained by applying the algorithm outlined in Section 2 Proof.Let w 0 , . . ., w k be k + 1 strings such that w = w 0 • • • w k and δ(q Notice that if q is an irreversible state, then p k = q and w k = ε.By construction of A , there exists the path δ ( q I , 0 , w x .It is possible to observe that, since p k is the last irreversible state along the path from q I to q, x k = x.Then, from the definition of δ , we have 0 As a consequence of Lemma 6, the value of the second components of states of A is smaller than β k , where k is the maximum possible number of irreversible states along a path starting in the initial state.Considering Lemma 5, we obtain: Corollary 7. If a dfa A with #Q ≥ 2 does not contain the forbidden pattern, then the maximum value of the second component of a state of A obtained applying the above construction to A is smaller than Observe that the maximum value of the second component in a state of A is reached when in each irreversible state r of A the maximum number of incoming transitions for the same letter a is equal to β, i.e., #δ R (r, a) = β.Two examples Algorithm 1 Computation of β from a dfa A = (Q, Σ, δ, q I , F ) where Q = {q 1 , . . ., q n } 1: Let C be an array of size n 2: β ← 0 3: for all a ∈ Σ do 4: if m ≥ β then β ← m 11: return β have been shown in Figure 1 and Figure 2. The dfa on the left of Figure 2 has a path from q I to q 3 reading the string w = aba containing all irreversible states.
We also observe that β has an important role in the construction, so we believe useful to outline how β can be computed (Algorithm 1).Given a dfa A = (Q, Σ, δ, q I , F ) containing only useful states, we assume that δ resides in a transition table T of size #Q • #Σ.The key observation is that a state is irreversible with respect to a symbol when it occurs more than one time in a column of T .Hence, the problem can be reduced to find the maximum number of occurrences of a state in a column of T .The algorithm uses an array in which the number of occurrences of each state is stored (Lines 4-8).For each column of T we can find the maximum number of occurrences of some state (Line 9).The value can be stored in a variable and updated at each iteration.In this way the algorithm keeps in the variable the current maximum value.The final value of the variable is the value of β.Since we need to visit each column of T , the overall time is O(#Q • #Σ), which is linear in the cardinality of Q.

Another Concise Representation
The drawback of the representation described in Section 3 is that the reversible automaton is not necessarily minimal.In this section we give a different representation which avoids such problem.Before proceeding, let us recall the properties related to minimal rev-dfas shown in Lemma 2. According to these, all the minimal rev-dfas accepting L have the same "state structure", in the sense that all of them should contain exactly c(q) states equivalent to each state q of M .
Here we present an easy way to compute the value of c(q), for each q ∈ Q of a given automaton M not containing the forbidden pattern, that is summarized in Algorithm 2.
The algorithm firstly transforms the transition graph of M by decomposing it q I , 0 for each q ∈ Q to the minimum dfa in Figure 2 q I q 1 q 2 q 3 q 4 q I , 0 q 1 , 0 q 2 , 0 q 2 , 1 q 3 , 0 q 4 , 0 q 3 , 1 q 4 , 1 q 5 , 0 q 5 , 2 q 5 , 1 q 5 , 3 By applying the construction described in this section, instead, the set of the second components of the states equivalent to any state q ∈ A is equal to {0, . . ., c(q) − 1}.Furthermore, we remind the reader that the reversible automaton obtained by applying the construction described in Section 3 is not necessarily minimal.Now we apply the construction to the minimum dfa M in Figure 8.The states of M are grouped into the sccs {q I , q 1 }, {q 2 }, {q 3 , q 4 }, {q 5 }.Consider the following number of copies c(q): c(q I ) = c(q 1 ) = 1, c(q 2 ) = c(q 3 ) = c(q 4 ) = 2 and c(q 5 ) = 4.For instance, given δ(q 4 , b) = q 5 , δ R (q 5 , b) = {q 3 , q 4 }, we have δ ( q 4 , 0 , b) = q 5 , c(q 3 ) + 0 = q 5 , 2 .Note that, even in this case, it is possible to simulate an irreversible computation of the rev-dfa A without explicitly constructing it: given a letter and knowing the state in which the automata is, given by the tuple state, index , it is always possible to obtain the next state.As example, consider the minimal dfa showed in Figure 8 (on the left) and the input string x = abbab.So, the computation of the simulated rev-dfa passes through the following states: q I , 0 The main difference between this simulation and the previous one based on the knowledge of β is that, starting from the minimum dfa accepting a reversible language, the resulting automaton is minimal.Such a property is proved in the following theorem.Theorem 9. Let M = (Q, Σ, δ, q I , F ) be a minimum dfa accepting a reversible language L. Let A = (Q , Σ, δ , q I , F ) be the dfa obtained by applying the construction to M , then L(A ) = L, and A is reversible and minimal.
Proof.First, it is enough to observe that each q, x ∈ Q is equivalent to q ∈ Q.
Third, we observe that by Lemma 8, A contains at most c(p) copies of any state p ∈ Q. However since A is reversible, by Lemma 2 it should contain at least c(p) many different states equivalent to p. Hence we conclude that A is a rev-dfa containing exactly c(p) copies of each state p of the minimum dfa M .According to Lemma 2 this implies that A is minimal.
According to the results in this section, given a minimum dfa M , after computing c(q) for each state q of M , we can simulate a minimal rev-dfa A equivalent to M , without explicitly representing it, starting from the initial state q I = q I , 0 and using (2) at each step to compute the next state.Since A can have exponentially many states with respect to M , this avoids to write down a large description.

Conclusion
We have presented two concise representations of a reversible automaton A equivalent to a given dfa A. Both of them allow to simulate the rev-dfa without explicitly writing down its transition table which, in the worst case, can be exponentially larger.In particular, the algorithm for converting a dfa accepting a reversible language to an equivalent minimal rev-dfa given in [4] iteratively creates copies of sccs of A in order to eliminate irreversibility.Here, for the simulation of A , we follow the computation on A and we use a variable, updated at each step of computation, containing the copy index of the corresponding scc in A .
The first representation in Section 3 requires an easy precomputation of a parameter β, but the simulated automaton is not necessarily minimal.Instead, the second representation in Section 4 requires the more involved precomputation of the function c, but the simulated automaton is minimal.Both precomputations can be done in polynomial time.Notice that the time required for the simulation of one computation step of a rev-dfa in one of these forms is the same as for the given dfa, with additional constant time for updating the variable.
Even when the rev-dfa A obtained from a minimum dfa A in the first representation is not minimal, its size is not too far from the size of a minimal rev-dfa in the following sense.In Lemma 6 we gave an upper bound of the maximum value of the second component in a state of A , i.e., β kp , where k p is the maximum number of irreversible states on a path in A from the initial state q I to p. Since A is reversible we have c(p) ≤ β kp (Lemma 2).Furthermore, in the path at least two copies of each irreversible state should be created to obtain a reversible automaton.Then, 2 kp ≤ c(p) ≤ β kp .This implies that A has a polynomial number of states with respect to the number of states of A if and only if each minimal rev-dfa equivalent to A has a polynomial number of states.
Recently, the definition of reversibility for finite automata has been deepened and relaxed, thus allowing different degrees of reversibility, the degree one corresponding to reversible automata [9].In particular, finite automata whose computations can

Fig. 1 .
Fig. 1.A dfa where β = 2 and the equivalent rev-dfa obtained by using the construction

Fig. 2 .
Fig. 2. A dfa where β = 2 and the equivalent rev-dfa obtained by using the construction

Fig. 3 .
Fig. 3.A minimum dfa and an equivalent minimal rev-dfa

Fig. 4 .
Fig.4.A non minimal rev-dfa obtained by applying the construction to the minimum dfa in Figure3where β = 3

Fig. 7 .
Fig.7.A minimal rev-dfa obtained by applying the construction based on the knowledge of c(q) for each q ∈ Q to the minimum dfa in Figure2