On Reversible Transducers

Deterministic two-way transducers define the robust class of regular functions which is, among other good properties, closed under composition. However, the best known algorithms for composing two-way transducers cause a double exponential blow-up in the size of the inputs. In this paper, we introduce a class of transducers for which the composition has polynomial complexity. It is the class of reversible transducers, for which the computation steps can be reversed deterministically. While in the one-way setting this class is not very expressive, we prove that any two-way transducer can be made reversible through a single exponential blow-up. As a consequence, we prove that the composition of two-way transducers can be done with a single exponential blow-up in the number of states. A uniformization of a relation is a function with the same domain and which is included in the original relation. Our main result actually states that we can uniformize any non-deterministic two-way transducer by a reversible transducer with a single exponential blow-up, improving the known result by de Souza which has a quadruple exponential complexity. As a side result, our construction also gives a quadratic transformation from copyless streaming string transducers to two-way transducers, improving the exponential previous bound.


Introduction
Automata and transducers.Automata theory is a prominent domain of theoretical computer science, initiated in the 60s [4] and still very active nowadays.Many extensions of finite automata have been studied such as automata over more complex structures (infinite words, trees, etc) or transducers which can be seen as automata with an additional write-only output tape and which will be the focus of our study in the remainder of this article.
Transducers have been studied for almost as long as automata [1] and important results have been obtained, however the theory of transducers is not as advanced as automata theory.The language A ˚aA ˚can be recognized by a deterministic (left) or codeterministic (right) automaton, but not by a reversible one.

113:2
One of the reasons for this is that many descriptions which are equivalent for automata become different in expressiveness in the case of transducers.For instance, deterministic and non-deterministic automata recognize the same class of languages, the regular languages.However this is not the case for transducers since in particular a deterministic transducer must realize a function while a non-deterministic one may realize a relation.Similarly, by allowing the reading head to move left and right, one gets a two-way model of automata and it is known that two-way automata are as expressive as one-way automata [12].However two-way transducers can model relations and functions that are unobtainable in the one-way case, such as the function mirror which reverses its input.Recently, two-way transducers were also proven to be equivalent to the one-way deterministic model of streaming string transducers [2], which can be thought of as transducers with write-only registers.
Reversible transducers.A transition system is called reversible when for every input, the directed graph of configurations is composed of nodes of in-degree and out-degree at most one.This property is stronger than the more studied notion of determinism since it allows to navigate back and forth between the steps of a computation.In this article, we study the class of transducers that are simultaneously deterministic and codeterministic, i.e. reversible.The main motivation for the definition of this class is its good properties with respect to composition.When we consider one-way transducers, runs only go forward and thus determinism gives good properties for composition: the next step of a run is computed in constant time.However, when considering composition of two-way transducers, the second machine can move to the left, which corresponds to rewinding the run of the first machine.Then the stronger property of reversibility allows for this back and forth navigation over runs of transducers, and we recover the property of reaching the next (or previous here) step of a computation in a constant time.This leads to the recovery of the polynomial state complexity of composition which exists for deterministic one-way transducers.
Let us now discuss the expressiveness of reversible transducers.Regarding automata in the one-way case, it is well-known that any regular language can be recognized by a deterministic one-way automaton and symmetrically by a codeterministic one-way automaton, since the mirror of a regular language is still regular.However, the class of one-way reversible automata is very restrictive (see Figure 1 for an example or [11] for a study of its expressive power, where they are called bideterministic).It turns out however, that if we allow bidirectionality then any regular language can be recognized by a reversible automaton.In fact, a two-way reversible automaton can be constructed from either a one-way or two-way automaton using only a linear number of states (see [9] and [10], respectively).We prove, as a consequence of our main theorem, that reversible transducers are as expressive as functional two-way transducers, and exactly capture the class of regular functions.As stated earlier, regular functions are also characterized by streaming string transducers (SST).As a byproduct, we also give a quadratic construction from copyless SST to reversible transducers, improving results from [3,6].

Synthesis problem and uniformization of transducers.
In the bigger picture of verification, two-way transducers can be used to model transformations of programs or non-reactive systems.If we consider the synthesis problem, where the specification is given as a relation of admissible input-output pairs, an implementation is then given as a function, with the same domain, relating a unique output to a given input.The uniformization problem asks if given a relation, we can extract a function that has the same domain, and is included in the relation.We argue that the synthesis problem can be instantiated in the setting of transformations as the problem of uniformization of a non-deterministic two-way transducer by a functional transducer.Our main result states that we can uniformize any non-deterministic two-way transducer by a reversible transducer with a single exponential blow-up.

Related work.
As stated earlier, reversible one-way automata were already considered in [11].Two-way reversible automata were shown to capture the regular languages in [9] by a construction from a one-way deterministic automaton to a two-way reversible automaton with a linear blow-up.This construction was extended to two-way automata in [10], still with a linear complexity.However, these constructions for automata cannot be simply extended to transducers because more information is needed in order to produce the outputs at the right moment.To the best of our knowledge, reversible transducers have not been studied yet, however, since we introduce reversible transducers as a tool for the composition of transducers, our work can be linked with the construction of Hopcroft and Ullman that gives the composition of a one-way transducer and a two-way transducer, while preserving determinism.Our construction strictly improves theirs, since ours produces, with a polynomial complexity instead of an exponential one, a reversible transducer that can in turn be easily composed.
A procedure for the uniformization of a two-way non-deterministic transducer by a deterministic one has been known since [7].The complexity of this procedure is quadruply exponential, while our construction is done in a single one, and produces a reversible transducer.
Organization of the paper.Preliminary definitions are given in the next Section.In Section 3, we present our main results on composability and expressiveness of reversible transducers.Section 4 is devoted to the main technical construction of the paper.Connections with streaming string transducers are discussed in Section 5 while further works are considered in Section 6.

Automata and transducers
Given a finite alphabet A, we denote by A ˚the set of finite words over A, and by ε the empty word.We will denote by A $% the alphabet A Z t$, %u, where the new symbols $ and % are called the left and right endmarkers.A language over A is a subset L of A ˚. Given two finite alphabets A and B, a transduction from Automata.A two-way finite state automaton (2FA) is a tuple A " pA, Q, q I , q F , ∆q, where A is a finite alphabet; Q is a finite set of states partitioned into the set of forward states Q `and the set of backward states Q ´; q I P Q `is the initial state; q F P Q `is the final state; ∆ Ď Q ˆA$% ˆQ is the state transition relation.By convention, q I and q F are the only forward states verifying pq I , $, qq P ∆ and pq, %, q F q P ∆ for some q P Q.However, for any backward state p ´P Q ´, ∆ might contain transitions pp ´, $, qq and pq, %, p ´q, for some I C A L P 2 0 1 7 113:4 On Reversible Transducers q P Q.Note that, in our figures, we do not represent explicitly the initial and final states, and rather use arrows labeled with the endmarkers to indicate the corresponding transitions.A configuration u.p.u 1 of A is composed of two words u, u 1 P A $% and a state p P Q.The configuration u.p.u 1 admits a set of successor configurations, defined as follows.If p P Q `, the input head currently reads the first letter of the suffix u 1 " a 1 v 1 .The successor of u.p.u 1 after a transition pp, a 1 , qq P ∆ is either ua the input head currently reads the last letter of the prefix u " va.The successor of u.p.u 1 after pp, a 1 , qq P ∆ is u.q.u 1 if q P Q `, or v.q.au 1 if q P Q ´.For every word u P A $% , a run of A on u is a sequence of successive configurations " u 0 .q0 .u 1 0 , . . ., u m .qm .u 1 m such that for every 0 ď i ď m, u i u 1 i " u.The run is called initial if it starts in configuration q I .u,final if it ends in configuration u.q F , accepting if it is both initial and final, and end-to-end if it starts and ends on the boundaries of u.More precisely, it is called left-to-right if q 0 , q m P Q Abusing notations, we also denote by ∆ the extension of the state transition relation to a subset of Q ˆA$ % ˆQ composed of the triples pp, u, qq such that there exists an end-to-end run on u between p and q.For every triple pp, u, qq P ∆, we say that q is a u-successor of p and that p is a u-predecessor of q.The language L A recognized by A is the set of words u P A ˚such that $ u % admits an accepting run, i.e., pq I , $ u %, q F q P ∆.The automaton A is called a one-way finite state automaton (1FA) if the set Q ´is empty; deterministic if for all pp, aq P Q ˆA$% , there is at most one q P Q verifying pp, a, qq P ∆; codeterministic if for all pq, aq P QˆA $% , there is at most one p P Q verifying pp, a, qq P ∆; reversible if it is both deterministic and codeterministic.weakly branching if for all a P A there is at most one state p P Q and one pair of distinct states q 1 , q 2 P Q such that pp, a, q 1 q P ∆ and pp, a, q 2 q P ∆.An automaton with several initial and final states can be simulated by using non-determinism while reading the endmarker $ and non-codeterminism while reading the endmarker %, hence requiring a single initial state and a single final state does not restrict the expressiveness of our model.Let us remark that unlike in the case of most two-way machines, a reversible two-way automaton always halts on any input.Indeed, codeterminism insures that it is never the case that two transitions head to the same configuration.Hence, the unique run (due to determinism) cannot loop since no configuration can be visited twice, and the first configuration starts from the left of the initial endmarker, which is a configuration that cannot be reached later on in the run.

Transducers.
A two-way finite state transducer (2FT) is a tuple T " pA, B, Q, q I , q F , ∆, µq, where B is a finite alphabet; A T " pA, Q, q I , q F , ∆q is a 2FA, called the underlying automaton of T ; and µ : ∆ Ñ B ˚is the output function.A run of T is a run of its underlying automaton, and the language L T recognized by T is the language L A T P A ˚recognized by its underlying automaton.Given a run of T , we set µp q P B ˚as the concatenation of the images by µ of the transitions of T occurring along .Note that in the deterministic (or codeterministic) case we are able to extend µ to end-to-end runs since in this case we can unambiguously associate an end-to-end run to a unique sequence of transitions pp, u, qq.The transduction R T Ď A ˚ˆB ˚defined by T is the set of pairs pu, vq such that u P L T and µp q " v for an accepting run of A T on $ u %.Two transducers are called equivalent if they define the same transduction.A transducer T is respectively called one-way (1FT), deterministic, weakly branching, codeterministic or reversible, if its underlying automaton has the corresponding property.Examples.Let us consider the language L aa Ď ta, bu ˚composed of the words that contain two a symbols in a row.This language is recognized by the deterministic one-way automaton A 1 , represented in Figure 2a, and by the reversible two-way automaton A 2 , represented in Figure 2b.However, it is not recognizable by a one-way reversible automaton.Let us analyze the behavior of A 2 to see how moving back and forth through the input allows it to recognize L aa in a reversible manner.First, A 2 uses an intermediate step to go from 1 back to 0 `when reading a b, to avoid creating non-codeterminism.Second, once A 2 reads two consecutive a symbols, it does not go directly in the final state looping on every input, since this would generate non-codeterminism.Instead, A 2 goes in an inverse copy of the first three states, where it rewind its run until the left endmarker.It is then free to go in the looping accepting state.

Results on reversible transducers
In this section, we present the main results of our paper.In Subsection 3.1, we show the polynomial composition of reversible transducers.In the following, we give expressiveness results of the class of reversible transducers, relying on this composition procedure as well as the construction presented in Section 4.

Composition of reversible transducers
The nicest feature of reversible transducers has to be the low complexity (and simplicity) of their composition.Indeed the composition of two such transducers is polynomial in the number of states of the inputs, and the construction is itself quite simple.This is due to the fact that the difficult part in the composition of transducers is to be able to navigate the run easily.In the one-way case, the composition is easy since runs can only move forward.In the two-way case, one needs to advance in the run, but also rewind it.Since the former is made easy by the determinism, and the latter is symmetrically handled by the codeterministim, composition of reversible transducers is straightforward.Let us also remark that only the first transducer has to be reversible in order to obtain a polynomial complexity.However the reversible nature of the obtained transducer depends on the input transducers being both reversible.
Theorem 1.Let T 1 be a reversible two-way transducers and T 2 be two-way transducer with n 1 and n 2 states respectively, such that T 1 can be composed with T 2 .Then one can construct a two-way transducer T 3 with n 1 ¨n2 states realizing R T2 ˝RT1 .Furthermore, if T 2 is reversible, deterministic or codeterministic, then so is T 3 .
Proof.Let T 1 " pA, B, Q, q I , q F , ∆, µq and T 2 " pB, C, P, p I , p F , Γ, νq.We define T 3 " pA, C, Q ˆP, pq I , p I q, pq F , p F q, Θ, ξq.The idea is that at each step, T 3 simulates a transition I C A L P 2 0 1 7

113:6
On Reversible Transducers δ P ∆, plus the behavior of T 2 over the production µpδq P B ˚of this transition.To be precise, the transducer T 3 also detects when it simulates an initial or final configuration of T 1 (i.e.upon reading an endmarker in the initial or final state), and accordingly adds the corresponding endmarker to the production before simulating T 2 .The partition of the set of states of T 3 depends on the combination of the signs of both components.If T 2 is moving to the right, we use the determinism of T 1 , we update the first component of the current state according to the unique transition δ originating from it, and we simulate T 2 entering µpδq from the left.To do so, T 3 needs to have access to the same letter of the input tape as T 1 .Thus, we have pQ `ˆP `q Ď pQ ˆP q `and pQ ´ˆP `q Ď pQ ˆP q ´.If T 2 is moving to the left, then we use the codeterminism of T 1 to rewind the corresponding run, we update the first component of the current state according to the unique transition δ arriving in it, and we simulate T 2 entering µpδq from the right.To do so, T 3 needs to have access to the letter on the other side of the input head (with respect to T 1 ).Thus, we have pQ ´ˆP ´q Ď pQ ˆP q ànd pQ `ˆP ´q Ď pQ ˆP q ´.
We now define the transition function Θ and the production function ξ.Let pq, a, q 1 q P ∆ be a transition of T 1 such that " pp, v, p 1 q is an end-to-end run of T 2 , where v denotes the word µpq, a, q 1 q P B ˚.
If is a left-to-right run of T 2 , then ppq, pq, a, pq 1 , p 1 qq belongs to Θ and produces νpp, v, p 1 q.
If is a left-to-left run of T 2 , then ppq, pq, a, pq, p 1 qq belongs to Θ and produces νpp, v, p 1 q.
If is a right-to-right run of T 2 , then ppq 1 , pq, a, pq 1 , p 1 qq belongs to Θ and produces νpp, v, p 1 q.If is a right-to-left run of T 2 , then ppq 1 , pq, a, pq, p 1 qq belongs to Θ and produces νpp, v, p 1 q.The behavior of the transducer T 3 is completely determined by the combined behaviors of transducers T 1 and T 2 .When T 3 simulates a transition of T 1 , it also simulates the corresponding end-to-end run of T 2 over the production of this transition.If the direction of both simulations is the same, then T 3 moves forward.Otherwise, it moves backward.The transducer stops when it reaches a final state in both T 1 over the input, and T 2 over the simulated run over partial productions of the run of T 1 over the input.Then the final output of T 3 is the concatenation of the outputs of the partial runs of T 2 it simulates, which corresponds to the output of T 1 .Hence, the transducer T 3 realizes the composition T 2 ˝T1 .The possible determinism (resp.codeterminism) of T 3 is a direct consequence of the one of T 1 and T 2 .Indeed, a witness of non-determinism (resp.non codeterminism) of T 3 can be traced back to a witness run of either T 1 or T 2 that is not deterministic (resp.codeterministic).

One-way transducers
In the next subsections, we give some procedures to construct a reversible transducer from either a one-way or a two-way transducer.The main ingredient of the proofs is the technical construction from Lemma 6 (presented in Section 4) which constructs a reversible transducer from a weakly branching codeterministic one-way transducer.The proofs of this section share the same structure: in order to build a reversible transducer that defines a function F, we express F as a composition of transductions definable by reversible transducers, and we conclude by using Theorem 1.The detailed constructions are presented in the full version of this article.Building on Lemma 6, we show that codeterministic one-way transducers can be expressed as the composition of weakly branching codeterministic ones.
Theorem 2. Given a codeterministic 1FT with n states, one can effectively construct an equivalent reversible 2FT with 4n 2 states.

113:7
Proof.Let T be a codeterministic 1FT with n states.The function R T can be expressed as the composition R T 1 ˝RM , where M and T 1 are defined as follows.
Transducer M is a reversible 1FT with a single state that multiplies all the letters of the input word by n while marking them with a state of T ; Transducer T 1 is a weakly branching and codeterministic one-way transducer that has the same set of states as T .On input R M puq, T 1 mimics the behavior of T on u, while using the fact that the input word is larger to desynchronize the non-deterministic branchings that were occurring simultaneously in T .Intuitively, a transition of T can only be taken by T 1 at the copy of the letter corresponding to the target state of the transition.By Lemma 6, T 1 can be made into a reversible 2FT T 2 with 4n 2 states.Therefore, since both T 2 and M are reversible, we can conclude using Theorem 1, finally obtaining a reversible 2FT with 4n 2 states equivalent to T .
Using composition again, the statement can be extended to deterministic one-way transducers.
Theorem 3. Given a deterministic 1FT with n states, one can effectively construct an equivalent reversible 2FT with 36n 2 states.
Proof.Let T be a deterministic 1FT with n states.Then s T , the transducer obtained by reversing all transitions of T , is codeterministic.The function R T can be expressed as the composition R M B ˝R s T ˝RM A , where M A and M B realize the mirror functions over the input and output alphabet of T respectively.Both of them are realized by a 3 states reversible transducer.Then by Theorem 2, we can construct s T 1 which has 4n 2 states, is reversible and realizes the same function as s T .By Theorem 1, we can compose the three transducers, finally obtaining a reversible transducer equivalent to T with 9 ¨4n 2 states.

Two-way transducers
We now prove our main result, which states that any two-way transducer can be uniformized by a reversible two-way transducer.Let us recall that uniformization by a deterministic transducer was done in [7].We use similar ideas for the uniformization.The key difference is that we rely on the construction of Section 4 while in [7], the main construction is the tree-trimming construction of Hopcroft-Ullman from [8].

Theorem 4. Given a 2FT T with n states, one can effectively construct a reversible 2FT T 1 whose number of states is exponential in n, and verifying L
Proof.Let T " pA, B, Q, q I , q F , ∆, µq be a 2FT with n states.We define a function uniformizing R T as the composition R T 1 ˝RU ˝RDr , where D r , U and T are defined as follows.
The right-oracle D r is a codeterministic one-way transducer with 2 n 2 `n states that enriches each letter of the input word u P A $% with information concerning the behavior of T on the corresponding suffix, represented by the set of pairs that admit a left-to-left run, and the set of states from which T can reach the final state.The uniformizer U is a deterministic one-way transducer with n! states.On input u 1 " R Dr puq, U uses the information provided by D r to pick a run u of T on input u, and enriches each letter a i of the input word with the sequence of transitions occurring in the run u that correspond to the letter a i .Finally, the reversible transducer T 1 has the same set of states as T , and follows the instructions left by U to solve the non-determinism and the non-codeterminism.

On Reversible Transducers
As a consequence of Theorem 2 and Theorem 3, there exist two reversible 2FT D r 1 and U 1 whose number of states are exponential in n, and that verify R D 1 r " R Dr and R U 1 " R U .Therefore, since D r 1 , U 1 and T 1 are reversible, by Theorem 1 there exists a reversible transducer T 2 whose number of states is exponential in n, and that satisfies R T The following result is a direct corollary of Theorem 4, applied to deterministic two-way transducers.
Corollary 5. Reversible two-way transducers are as expressive as deterministic two-way transducers.

4
The tree-outline construction In this section lies the heart of our result.We show that any weakly branching and codeterministic transducer can be made reversible.These hypotheses allow us to simplify our proof, and still obtain a more general result, as a corollary.
Lemma 6.Let T be a codeterministic and weakly branching 1FT with m states.Then one can effectively construct a reversible 2FT T 1 with 4m 2 states that is equivalent to T .
Proof.The construction presented in this proof is illustrated on an example in Figure 3. Let T " pA, Q, q I , q F , ∆, µq be a codeterministic 1FT, and let ă be a total order over Q.As an example, take the codeterministic 1FT T presented in figure 3a.
Let T 1 " pA, F, f I , f F , ∆ 1 , µ 1 q be a 2FT defined as follows: On input u P L T , T 1 explores depth first the run-tree T u composed of the initial runs of T on the word $ u % (illustrated in Figure 3b).More precisely it explores the "sheath" of the run-tree (see Figure 3c for a graphical representation).To do this, the states of T 1 are composed of two states of T with a marker.The first state represents the upper part of the sheath, while the second state represents the lower part.Moreover the marker is used to denote whether we are above the branch (q) or below the branch (q).
Initially we start with the state pq I , q I q and go forward according to the transitions of T .While moving forward whenever a branching state q is reached, if the state is marked q it moves to the maximal successor of q (in order to stay above the branch) and symmetrically if the state is marked q it moves to the minimal successor of q (in order to stay below the branch).Whenever one of the branches reaches a dead end we continue the sheath exploration by switching the marker (i.e.changing from above the branch to below or vice-versa) and start moving backward accordingly to the transitions of T .While moving backward, if the successor of a branching state q is reached, while we were inside the fork, e.g. in state q max (where q max is the maximal successor of q), we continue the exploration of the sheath by going in the state q min and we start moving forward again.Whenever the upper and lower explorations of the sheath coincide, i.e. in states of the form pq, qq (represented in red in Figure 3d), it means we are on a prefix of the accepting run, we can thus produce the corresponding output.
Formally T 1 " pA, F, f I , f F , ∆ 1 , µ 1 q is defined as follows: F " F `YF ´where F `" QˆQYQˆQ and F ´" pQˆQYQˆQqztpp, pq, pp, pq | p P Qu f I " pq I , q I q f F " pq F , q F q We define the transition relation ∆ 1 by differentiating several types of behavior, depending on whether we are going f orward, or backward, whether the upper component or the lower component is involved, and whether it is above or below its branch.Let p and q be two states in Q, and a P A be a letter.If p has no a-successor, then: (fua) `pp, qq, a, pp, qq ˘P ∆ 1 , and (fuw) `pp, qq, a, pp, qq ˘P ∆ 1 .If p has an a-successor, but not q, then: (flw) `pp, qq, a, pp, qq ˘P ∆ 1 , and (fla) `pp, qq, a, pp, qq ˘P ∆ 1 .Otherwise, p and q admit an a-successor.We denote p max (resp.p min ) the maximal (resp.minimal) a-successor of p (resp.q) with respect to ă. Then: If p min ‰ p max , then: (buw) `pp max , qq, a, pp min , qq ˘P ∆ 1 , and (bua) `pp min , qq, a, pp max , qq ˘P ∆ 1 .If q min ‰ q max , then: (bla) `pp, q min q, a, pp, q max q ˘P ∆ 1 (blw) `pp, q max q, a, pp, q min q ˘P ∆ 1 (fualw) `pp, qq, a, pp max , q min q ˘P ∆ 1 , (fuwla) `pp, qq, a, pp min , q max q ˘P ∆ 1 , (bulw) ppp min , q min q, a, pp, qqq P ∆ 1 , and (bula) `pp max , q max q, a, pp, qq ˘P ∆ 1 .
We define µ 1 as the function such that for every pp, a, qq P ∆: if q " p min " p max then µ 1 `pp, pq, a, pq, qq ˘" µpp, a, qq if q " p min ‰ p max then µ 1 `pp max , qq, a, pq, qq ˘" µpp, a, qq if q " p max ‰ p min then µ 1 `pq, p min q, a, pq, qq ˘" µpp, a, qq and µ 1 ptq " ε for every t P ∆ 1 which is not of one of theses forms.Theorem 7. Given a copyless SST with n states and m variables, one can effectively construct an equivalent reversible 2FT with 8m ¨n2 states.
Proof.We write Z as the composition of a one-way deterministic transducer D 1 and a reversible one T .The first transducer has the same underlying automaton as Z, the difference being that it outputs the substitution of Z instead of applying it.Then T is a transducer that navigates the substitutions to produce the output word of Z.This can be done in a reversible fashion thanks to the property of copylessness of Z.Note that the transducer T was already defined in [6], Section 4. Formally, let Z " pA, B, Q, q I , q F , ∆, X , O, τ q be a copyless SST with n states and m variables, and let S Z Ă S A,X be the range of τ .We express R Z as the composition of R D1 : L A Z Ñ S Z and R T2 : S Z Ñ B ˚, defined as follows.
D 1 is a deterministic 1FT obtained by stripping Z of its SST structure, i.e., D 1 " pA, S Z , Q, q I , q F , ∆, τ q.It maps each word of L A Z to the corresponding sequence of substitutions.
T " pS Z , B, P, init, f in, Γ, νq where P `" X o Z tinit, f inu, P ´" X i .States labeled by i (resp.o) are in (resp.out) states and appear when we start (resp.finish) producing a variable.We define Γ and ν as follows: pinit, σ, initq P Γ; pinit, $, O i q P Γ; pO o , %, f inq P Γ; pX i , σ, Y i q P Γ and νppX i , σ, Y i qq " v if σpXq " vY... with v P B ˚; pX i , σ, X o q P Γ and νppX i , σ, X o qq " v if σpXq " v; pX o , σ, Y i q P Γ and νppX o , σ, Y i qq " v if there exists a variable Z where σpZq " ...XvY..; pX o , σ, Y o q P Γ and νppX o , σ, Y o qq " v if σpY q " ...Xv.Due to copylessness, for any σ and any variable X, there is at most one variable Y such that X appears in σpY q.Plus, as the variables are ordered by their appearance in σpY q, the transducer T is reversible.It starts by reaching the end of the word, then starts producing the variable O.By following the substitution tree of O, it then produces exactly the image of the input by Z.
By Theorem 3, there exists a reversible 2FT D 1  1 with 4n 2 states satisfying R D 1 1 " R D1 .Finally, since both D 1  1 and T are reversible, by Theorem 1 there exists a reversible transducer T 1 with 8m ¨n2 states such that R T 1 " R T ˝RD 1  1 " R Z .

Conclusion
We argue that reversible transducers can be seen as a canonical representation of regular transductions.We believe that the polynomial complexity of composition of reversible transducers is a good tool for the verification of cascades of transformations of non-reactive systems.While preserving the expressive power of functional transducers, reversible transducers allow for easier manipulations, the best example being their polynomial composition.Thanks to the tree-outline construction that we presented, one can uniformize a non-determinsitic two-way transducer by a reversible one with a single exponential blow-up.This improves the known constructions that were used up to now, however it is still open whether this blow-up can be avoided.In [10] the authors extended the result of [9] and showed that deterministic two-way automata can be made reversible with a linear blow-up.We conjecture that our approach can also be extended to the two-way case and that deterministic two-way transducers can be made reversible using only a polynomial number of states.
I C A L P 2 0 1 7

113:12 On Reversible Transducers
We have shown that applying this construction allows for a quadratic transformation from copyless streaming string transducers to reversible two-way transducers.The converse does not hold, since even on languages deterministic two-way automata are known to be exponentially more succint than deterministic one-way automata.Beyond this, we do not reject the possibility that if one were to embed some recognition power into the variables of a SST, it may be possible to have a polynomial transformation from reversible automata to copyless SST.

Figure 1
Figure 1The language A ˚aA ˚can be recognized by a deterministic (left) or codeterministic (right) automaton, but not by a reversible one.

Figure 2
Figure 2Two automata recognizing the language Laa " A ˚aaA ˚.

1 Figure 3
Figure 3Illustrations of the proof concepts of Lemma 6.For the sake of clarity, the outputs of T are omitted.