From Finite-Valued Nondeterministic Transducers to Deterministic Two-Tape Automata
FFrom Functional Nondeterministic Transducers toDeterministic Two-Tape Automata
Elisabet Burjons
Department of Computer Science, ETH Zurich, [email protected]
Fabian Frei
Department of Computer Science, ETH Zurich, [email protected]
Martin Raszyk
Department of Computer Science, ETH Zurich, [email protected]
Abstract
The question whether P = NP revolves around the discrepancy between active production andmere verification by Turing machines. In this paper, we examine the analogous problem for finitetransducers and automata. Every nondeterministic finite transducer defines a binary relationassociating input words with output words that are computed and accepted by the transducer.Functional transducers are those for which the relation is a function. We characterize functionalnondeterministic transducers whose relations can be verified by a deterministic two-tape automaton,show how to construct such an automaton if one exists, and prove the undecidability of the criterion. Theory of computation → Formal languages and automata theory
Keywords and phrases
Functional Transducers, Finite Automata, Production versus Verification,Undecidable Verifiability Criterion
Related Version
The results presented in this paper were also formally proved in Isabelle/HOL,a theorem prover using higher-order logic, to guarantee their correctness. The formalization isavailable at https://github.com/mraszyk/icalp20 . Acknowledgements
We thank Juraj Hromkovič and Richard Královič for inspiring discussions.
One of the simplest computation models is that of a finite automaton reading its inputword from left to right while deterministically updating its state according to a transitionfunction; once the input word has been read completely, it is either accepted or rejecteddepending on the state in which the automaton ends up. We refer to such an automatonas a deterministic finite automaton (DFA). For a nondeterministic finite automaton (NFA),the transition function may permit no or multiple transitions from a given state; the inputword is then accepted if it is accepted for any of the possible choices of transitions. The setof words accepted by an automaton A is its recognized language L ( A ). For any machinemodel M, there is a set L ( M ) of the languages recognized by such machines. It is well-knownthat deterministic and nondeterministic automata both recognize the same class of regular languages [7], i.e., nondeterminism does not add any computational power to the finiteautomaton model.Transducers are a generalization of automata. A transducer still reads the given inputword symbol by symbol, but additionally computes a separate output word while doing so.During each transition reading one input symbol, the transducer produces a possibly emptysequence of output symbols. The final output word is obtained by contatenating the outputsof all transitions. The language accepted by a transducer, called transduction , is thus a a r X i v : . [ c s . CC ] M a y From Functional Nondeterministic Transducers to Deterministic Two-Tape Automata L (2t-DFA) (cid:40) L (NFT) (cid:40) (cid:40) L (DFT) (cid:40) L (f-2t-DFA) (cid:40) L (f-NFT) Figure 1
The hierarchy of languages recognized in the different machine models. This paperproves the strict inclusion of L (f-2t-DFA) into L (f-NFT) and examines the relation between theunderlying models more closely. relation between input and output words. For a deterministic finite transducer (DFT), thisrelation is always a partial function. A transduction by a nondeterministic finite transducer(NFT) is not necessarily functional, however. If it is, we call the NFT functional (f-NFT).Another way to generalize finite automata is the multi-tape model. Here, an automatonhas multiple tapes, each with one head that can read the word written on the tape fromleft to right. There are several different but equivalent ways to model multi-tape automata,most notably the Rabin-Scott model and the Turing machine model. In the Rabin-Scottmodel, only one of the heads is reading a symbol and advancing to the next one in eachstep; the current state determines on which tape this happens. The computation is eitheraccepted or rejected once all heads have reached the end of the tape. In the Turing machinemodel, in contrast, the multi-tape automaton reads all symbols at the current head positionssimultaneously and can then move forward any subset of the heads in each step. In thispaper, we will only examine automata with two tapes (2t-DFAs). A functional two-tapeautomaton (f-2t-DFA) is one that recognizes a functional relation.We remark that both multi-tape automata and transducers can be extended to the morepowerful two-way model that allows the heads to move not only forward but also back, fromright to left. In this paper we solely consider the one-way model, however.The main motivation underlying all computation models is to study their computationalpower, i.e., the set of languages that machines can recognize in each model. It is alsointeresting to characterize the languages that can be recognized in one given model but notthe other. For instance, DFTs are less expressive than f-NFTs. Béal and Carton define theso-called twinning property and show that having this property is both a necessary andsufficient condition for an f-NFT to have an equivalent DFT [1].Given a DFT, we can construct an equivalent 2t-DFA that simply simulates the DFT onthe first tape and checks whether the output of the DFT matches the content of the secondtape. Since a DFT is inherently functional, we obtain an f-2t-DFA. Formally, we get that L (DFT) ⊆ L (f-2t-DFA). To see that this inclusion is proper, we consider the relation thatmaps any binary string w to 0 | w | if the last symbol of w is 0 and to 1 | w | otherwise. It is easyto construct an f-2t-DFA that verifies this relation as follows: The automaton advances itstwo heads synchronously, always comparing the current output symbol with the previous one.If there is a discrepency at any point, the automaton rejects; otherwise, the output word isguaranteed to be uniform. If the two heads reach the end of the input and output word atthe same time and the last two symbols match, then the automaton accepts; otherwise, itrejects. A DFT cannot compute this relation, however, because it cannot output any symboluntil it knows the last symbol of the word on the first tape, and by that time, the transducercannot recall the length of the input word which equals the number of copies of the lastsymbol that the transducer needs to produce.Furthermore, given a (functional) 2t-DFA, we can construct an equivalent (functional)NFT that nondeterministically guesses its output and verifies it by simulating the 2t-DFA.Formally, we can conclude that L (f-2t-DFA) ⊆ L (f-NFT) and L (2t-DFA) ⊆ L (NFT). We . Burjons, F. Frei, and M. Raszyk 3 will illustrate why both of these inclusions are in fact strict when discussing Example 10. Anoverview of the language classes and their inclusions is given in Figure 1.Fischer and Rosenberg [5] have shown that, given a 2t-NFA, it is undecidable whetherthere is an equivalent 2t-DFA. They prove this by a reduction from the Post correspondenceproblem. Their proof crucially relies on nonfunctional 2t-NFAs, however. In this paper, weextend the undecidability result to f-NFTs and f-2t-DFAs. The comparative expressiveness of various transducer and automaton models has been asubject of intensive study ever since these machine models were introduced. Besides thementioned results comparing DFTs to NFTs and 2t-DFAs to 2t-NFAs, Rabin and Scott [7]proved that two-way automata are as powerful as one-way automata for a single tape butrecognize strictly more language with multiple tapes. Furthermore, they prove that thedeterministic and nondeterministic multi-tape models are equivalent if the heads are movingsynchronously on all tapes. If the heads are asynchronous, however, it is even undecidablewhether a multi-tape NFA has an equivalent multi-tape DFA [5].Filiot et al. [4] showed that it is decidable whether a two-way DFT can be transformedinto an equivalent one-way DFT and provide a characterization of the two-way DFTs forwhich this is possible. It is known that two-way DFTs compute exactly those relations thatare expressible as monadic second-order logic string transductions [3]. Yao and Rivest haveshown that increasing the number of heads on a tape yields a strict hierarchy of languages [10];see also the survey by Holzer et al. [6]. A new result by Raszyk et al. [8] proves that DFTswith multiple heads are strictly more expressive than f-NFTs. Asking whether multi-headtwo-way DFAs can simulate two-head one-way NFAs is equivalent to the famous questionwhether L = NL [9].
We compare the computational power of 2t-DFAs and f-NFTs. To this end, we describea subclass of f-NFTs characterizing the relations computable by a 2t-DFA, i.e., given anf-NFT, there is an equivalent 2t-DFA if and only if the f-NFT lies in said subclass. Finally,we show this membership question to be undecidable.We have formally proved the main results of this paper (Theorems 8 and 9 and Claims 14and 15) as well as Examples 7 and 10 in the Isabelle proof assistant [2], ensuring theircorrectness. We also provide pen-and-paper proofs for all of our results.
We formally describe the automaton model and transducer model considered in this paperand then introduce some useful terminology, in particular our core notion of bounded trailing.
There are many equivalent ways of extending the one-tape automaton model to multipletapes. We base our definition on the common Turing machine model. (cid:73)
Definition 1. A two-tape deterministic finite automaton (2t-DFA), is a septuple A =( Q, Σ , Γ , ␣ , δ, q , F ) consisting offinite, nonempty sets Q , Σ , and Γ , the set of states and the input and output alphabet , a r X i v . o r g From Functional Nondeterministic Transducers to Deterministic Two-Tape Automata a blank symbol ␣ / ∈ Σ ∪ Γ ,a transition function δ : Q × (Σ ∪ { ␣ } ) × (Γ ∪ { ␣ } ) → Q × { N , R } × { N , R } ( q, σ, γ ) ( q , m , m ) satisfying σ = ␣ = ⇒ m = N (i.e., the first head cannot move past the end delimiter ␣ ), γ = ␣ = ⇒ m = N (i.e., the second head cannot move past the end delimiter ␣ ), and m = R ∨ m = R (i.e., at least one head advances in every step), andan initial state q ∈ Q and a set of accepting states F ⊆ Q . The computation of a 2t-DFA proceeds as follows. There are two tapes that we call the input and output tape; the former contains a word a ∈ Σ ∗ , the latter a word u ∈ Γ ∗ . Bothwords are delimited by the blank symbol ␣ at the end. The two tapes have one readinghead each, which we refer to as the input and output head. The input and output head areinitially positioned on the first symbol of a and u , respectively. Depending on the currentstate of the automaton and what symbols the two heads are reading, either the input oroutput head or both advance by one symbol in each step. As soon as a head reaches theblank symbol delimiting a word, it cannot move any further. The computation ends whenboth heads have reached the blank symbol. A word pair ( a, u ) is in the language acceptedby the automaton if and only if the computation on this pair of words ends in an acceptingstate. A configuration consists of the positions of the two heads and the current state. Wewrite q a −−−→ u q if the automaton can start in a state q and end up in a state q by reading aword a with the input head and u with the output head. We now formally define a nondeterministic finite transducer. (cid:73)
Definition 2. A nondeterministic finite transducer (NFT) is a sextuple T = ( Q, Σ , Γ , δ,q , F ) , where Q , Σ , Γ , q , and F are defined as for a 2t-DFA in Definition 1, but the transition function δ now is a function that maps each pair ( q, σ ) ∈ Q × Σ of a state andinput symbol to a finite subset of Q × Γ ∗ , describing the nondeterministic transition options. The computation of an NFT proceeds just like the computation of an NFA except thatthe NFT produces in each step a possible empty sequence of output symbols. The outputsfrom the single steps are concatenated to obtain the final output of the complete computation.Using the image of a two-tape machine, we can also view the computation of an NFT asreading the word on the input tape symbol-wise while writing to the initially empty outputtape, appending each step’s output. We write q a −→ u q if the transducer can go from a state q to a state q with the input head reading a ∈ Σ ∗ and the output head producing u ∈ Γ ∗ .The computation ends once the entire input word has been read, i.e., when the input headhas reached the blank symbol. If the transducer is in an accepting state at this moment, thenthe word pair ( a, u ) on the two tapes is in the relation L ( T ) computed by T . If the transitionfunction does not offer any option for a step and thus forcibly ends the computation beforethe blank symbol on the input tape is reached, then this computation does not contribute tothe relation L ( T ).A binary relation R ⊆ Σ ∗ × Γ ∗ is functional if and only if every a ∈ Σ ∗ is associated withat most one u ∈ Γ ∗ , that is, ∀ a ∈ Σ ∗ : |{ u ∈ Γ ∗ | ( a, u ) ∈ R }| ≤ (cid:73) Definition 3.
An NFT T is a functional nondeterministic finite transducer (f-NFT) if L ( T ) is a functional relation. . Burjons, F. Frei, and M. Raszyk 5 We will use the following two notions many times in our proofs. (cid:73)
Definition 4 (Shortcut guarantee g ) . Let an NFT T = ( Q, Σ , Γ , δ, q , F ) be given. Let Q ⊆ Q denote the set of all useful states, that is, states that are part of at least one acceptingcomputation. For every q ∈ Q , let g q = min {| x | | ∃ u ∈ Γ ∗ , f ∈ F : q x −→ u f } denote the lengthof a shortest word x that leads from q into an accepting state. We call g ( T ) = max q ∈ Q g q the shortcut guarantee of T . If T has no accepting computation, we formally define g ( T ) = ∞ . (cid:73) Definition 5 (Output speed s ) . Let an NFT T = ( Q, Σ , Γ , δ, q , F ) be given. We call s ( T ) = max {| γ | | ∃ q, q ∈ Q, σ ∈ Σ : ( q , γ ) ∈ δ ( q, σ ) } the output speed of T . Note that s ( T ) is well-defined since δ only maps to finite subsets of Q × Γ ∗ . Finally, we introduce our notion that characterizes f-NFTs having an equivalent f-2t-DFA. (cid:73)
Definition 6 (Bounded trailing) . An NFT T = ( Q, Σ , Γ , δ, q , F ) has bounded trailing if ∃ t ∈ N : ∀ f , f ∈ F, q , q ∈ Q, a, b , b ∈ Σ ∗ , u, v, w , w ∈ Γ ∗ : q a −−−→ uv q b −−−→ w f ∧ q a −−→ u q b −−−→ vw f = ⇒ | v | ≤ t Otherwise, we say that T has unbounded trailing . The following three sections prove bounded trailing to be a necessary and sufficientcondition for an f-NFT to have an equivalent 2t-DFA and that bounded trailing is undecidable.
In this section, we show that any NFT that has bounded trailing can be transformed intoan equivalent 2t-DFA. Let T be an NFT with a trailing bound t ∈ N . We construct anequivalent 2t-DFA A that simulates all nondeterministic computations of transducer T thatare compatible with the output seen so far. Automaton A uses its states to maintain asubword z of the output word with the following property. For the currently read prefix p of the input word, there is a prefix x of the output word such that for any computation of T that starts in the initial state q of T , reads p , reaches a state q of T , and produces anoutput w consistent with the given output tape, we can write w as xy for a prefix y of z .In other words: Whatever prefix p of its input word automaton A has read at the moment,there is an x such that every computation of T on p consistent with A ’s output word has theform q p −−−→ xy q for some prefix y of z .Automaton A stores in its current state a representation of each such computation of T ,namely the pair ( q, | y | ). We show that this is feasible with a finite set of states by maintaininga subword z of length at most r = s + t , where s and t are T ’s output speed and trailingbound, respectively. Initially, z is empty and the set P of pairs ( q, n ) stored in A ’s statecontains only a single pair, ( q , q is T ’s initial state. This reflects the fact thatthe only computation of T on the empty prefix of the input tape keeps T in its initial stateand produces no output. If L ( T ) = ∅ , then A immediately rejects in its initial state.Automaton A now proceeds as follows. As long as the length of the subsequence z staysbelow r and the output tape has not been fully read, the next symbol on the output tapeis read and appended to z . Moreover, A removes from the set P all representations ofcomputations that are no longer consistent with the extended subsequence z of the output a r X i v . o r g From Functional Nondeterministic Transducers to Deterministic Two-Tape Automata q q q q a { ( q , aba ) , ( q , abab ) , ( q , abab ) } { ( q f , ba ) , ( q f , bab ) } { ( q f , ab ) } ∅ b ∅ ∅ ∅ { ( q f , aa ) } (a) Table giving the values of the transition function δ of the NFT T . a a ␣ a b a b a b ␣ P = { ( q , } x = λz = λ a a ␣ a b a b a b ␣ P = { ( q , } x = λz = ababa a a ␣ a b a b a b ␣ P = { ( q , , ( q , , ( q , } x = aba, z = ba a a ␣ a b a b a b ␣ P = { ( q , , ( q , } x = abaz = bab a a ␣ a b a b a b ␣ P = { ( q f , } x = abababz = λ (b) The computation of the 2t-DFA A on the input ( aa, ababab ). The positions of the heads aremarked black, the subsequence z of the output tape is marked gray, and x consists of the white cellsbefore z . Figure 2
Transition function and computation from Example 7. tape. If the set P becomes empty, then automaton A rejects, because there is no computationof T consistent with the given input and output tape. Otherwise, A determines the minimum m such that ( q, m ) ∈ P for any q and drops the first m output symbols from the subsequence z .This corresponds to cutting off from z a prefix of length m and appending it to x . Notethat this is sound because none of the stored computations end before outputting the new x .This way, A maintains the invariant that there is some state q of T such that ( q, ∈ P .Once the length of the subsequence z becomes r or the output tape has been fully read,automaton A reads in the next symbol from the input tape and then simulates every singlestep that is nondeterministically possible for every single stored computation and updates theset P accordingly to a new P . The mentioned invariant guarantees that ( q, ∈ P for somestate q of T . The fact that T has bounded trailing with a trailing bound t implies that n ≤ t holds for every pair ( q, n ) ∈ P . Hence, performing one further nondeterministically possiblestep continuing T ’s computation represented by ( q, n ) ∈ P yields a pair ( q , n ) ∈ P thatsatisfies n ≤ t + s since s is the longest output that T can produce while reading a singlesymbol. This is just within the length limit r = s + t that we set for z . As before, automaton A rejects if the set P becomes empty, because this means there is no computation of T consistent with the given input and output tape. Otherwise, automaton A performs on P the normalization described in the previous paragraph to obtain a new set P that maintainsthe invariant that there is some q for which ( q , ∈ P .Finally, if both the input and output tape have been fully read, automaton A accepts ifand only if there is some q ∈ F with ( q, | z | ) ∈ P , i.e., an accepting state q of T that somecomputation of T arrives at after producing an output that matches xz until the very end,meaning that the output is equal to the content of the output tape. (cid:73) Example 7.
We consider the NFT T with the set of states Q = { q , q , q , q , q f } , ini-tial state q ∈ Q , the set of accepting states F = { q f } , and the transition function δ given in Figure 2a. We can check that the transduction computed by T is L ( T ) = { ( aa, ababa ) , ( aa, ababab ) , ( ab, ababaa ) } and that the trailing of T is bounded by t = 1.The computation of automaton A on the input-output pair ( aa, ababab ) is summarized inFigure 2b. We now describe this computation in detail. Because L ( T ) = ∅ , the initial state . Burjons, F. Frei, and M. Raszyk 7 of automaton A is storing z = λ , where λ denotes the empty word, and P = { ( q , } . Thelength of the longest output that T can produce while reading one input symbol is s = 4.Hence, the maximum length of the subsequence z maintained in A ’s state is r = s + t = 5.Because the output tape consists of six symbols, the first r = 5 of them are read andappended to z . Since all output words in L ( T ) start with the same five symbols, the onlypair in P , namely ( q , z . After this, A ’s state is storing z = ababa and P = { ( q , } .Now that the length of z is 5 = r , the first symbol a from the input tape is read. Allnondeterministic steps from δ ( q , a ) = { ( q , aba ) , ( q , abab ) , ( q , abab ) } are consistent with z ,which leads to P = { ( q , , ( q , , ( q , } . The minimum m for which ( q, m ) ∈ P for any q is m = 3. After performing the normalization of P with this m , the state of automaton A is storing z = ba and P = { ( q , , ( q , , ( q , } ).Since the length of z is now 2 < r , automaton A reads the next output symbol b andappends it to z , which thus becomes z = bab . Then A removes the pair ( q ,
1) from the set P because this pair is no longer consistent with the extended subsequence z = bab sincethe only possible transition from q produces the output aa , which is inconsistent with thesuffix ab of z = bab . The remaining two pairs ( q ,
0) and ( q ,
1) are still consistent with theextended z = bab . As ( q ,
0) stays in P , no normalization need be performed.Now that the end of the output tape has been reached, A reads in the next symbol a from the input tape despite | z | = 3 < r . Performing one step that reads a on every pair in P yields P = { ( q f , } . Note that ( q f , P because it is not consistent with b , the lastsymbol of z . After one more normalization, A ’s state is storing z = λ and P = { ( q f , } .Finally, A has reached the end of both the input and output tape, thus it checks whether( q, | z | ) ∈ P for some q ∈ F . As ( q f , ∈ P , q f ∈ F , | z | = 0, A accepts the input-output pair( aa, ababab ) ∈ L ( T ).We conclude this section by formally stating its main result. (cid:73) Theorem 8.
Any NFT with bounded trailing has an equivalent 2t-DFA.
In this section, we prove the reverse of Theorem 8 for the functional case. (cid:73)
Theorem 9.
Any f-NFT with an equivalent 2t-DFA has bounded trailing.
Proof.
Let an NFT T and a 2t-DFA A with L ( T ) = L ( A ) be given. We assume that T hasunbounded trailing and contradict the functionality of T , thus proving the theorem. We mayassume without loss of generality that A moves exactly one head in each step because anystep moving both heads at once can be simulated by two steps moving only one head at atime using one additional intermediate state.Denote the state sets of transducer T and automaton A by Q T and Q A , respectively.Let g and s be the transducer’s shortcut guarantee and output speed, respectively. Finally,we define a homestretch length h = ( g + 1) · ( | Q A | + 1) and a trail length minimum t = | Q T | · | Q A | · s · ( h + ( g + 1) s + 1). The reason for choosing exactly these values will becomeclear during the proof. For now, we note that they depend only on the given transducer T and the automaton A , hence they are constant within this proof.Since T has unbounded trailing, there are accepting computations q a −−−→ uv q b −−−→ w f and q a −−→ u q b −−−→ vw f such that | v | > t . We split the trail v into a prefix v of length a r X i v . o r g From Functional Nondeterministic Transducers to Deterministic Two-Tape Automata | v | − h and the remaining homestretch v of length h . We consider A ’s computation on theinput-output prefix ( a, uv ). The two-tape automaton model ensures that both heads of A will eventually reach the end of a and uv , respectively. Depending on which one does sofirst, we distinguish two cases. a b u v v w x h (a) Case 1: Automaton A ’s head positions when the input head has just reached the end of a andtransducer T ’s head positions after the computation q a −−−→ uv q . a b u v v w y (b) Case 2: Automaton A ’s head positions when the output head has just reached the end of uv and transducer T head positions after computing q a −−−→ u q . Figure 3
Two different input-output pairs in the relation L ( A ) = L ( T ). The black and whitetriangles represent the heads of transducer T and automaton A , respectively. Case 1: Input head is first
In this case, we consider the input-output pair ( ab , uvw );see Figure 3a and recall that v = v v . We begin by showing why we may assume withoutloss of generality that | b | ≤ g . For this, we consider transducer T ’s configuration after thecomputation q a −−−→ uv q ; the corresponding head positions are indicated by the black trianglesin Figure 3a. The shortcut guarantee g ensures the existence of a word pair ( b, w ) ∈ Σ ∗ × Γ ∗ and a final state f ∈ F such that q b −−→ w f and | b | ≤ g ; we can therefore substitute b , w , and f for b , w , and f .Now, we consider automaton A ’s computation on the same input-output pair ( ab , uvw ).Let x denote the suffix of uv that has not yet been read by A when the input head has justreached the end of a ; see the white triangles in Figure 3a for the automaton’s head positions.The input head has only b left to read but the output head all of xv w . We have alreadyestablished that | b | ≤ g using the shortcut guarantee and we know that | xv w | ≥ | v | = h since v is the homestretch. In each step, A advances exactly one head by exactly one symbol,and a head does not move anymore once it has reached the blank symbols at the end of thegiven word pair. Thus there are at most g movements of the input head left but at least h by the output head. We call a step in which the input head moves an input step and astep in which the output head moves an output step . The input steps split the remainingcomputation into at most g + 1 sequences of consecutive output steps. Since there are atleast h output steps, there is at least one sequence of h/ ( g + 1) uninterrupted output steps.Because h/ ( g + 1) > | Q A | there are within that sequence at least two different output stepsleading A into the same state. Choosing any two such steps, we can cut out the nonemptypart of the output word that starts at the position of the output head immediately after thefirst step and ends with the symbol at the position of the output head just before the secondstep. This results in an accepting computation, with the word on the input tape unmodified. . Burjons, F. Frei, and M. Raszyk 9 Hence A associates two different output words, uvw and some shorter one, with the sameinput word ab , contradicting the functionality of L ( A ) = L ( T ). Case 2: Output head is first
In this case, the output head reaches the end of uv before theinput head has finished reading a . This remains true for A ’s computation on the input-outputpair ( ab , uvw ); see Figure 3b. Let y be the still unread suffix of a at the moment when theoutput head reaches the end of uv . At this point, the input head still has to read yb andthe output head v w . In the following paragraph we will establish an upper bound on thelength of the remaining output v w .The homestretch length | v | = h is already fixed. The length of w can be boundedby combining the shortcut guarantee g and the output speed s as follows. Consider thetransducer’s computation q b −−−→ vw f . Since the output head can write at most s symbols in asingle step, we can cut off from b a prefix b such that q b −−−→ vw q for some prefix w of w withlength | w | < s and a state q . Denote by b and w the remaining suffixes such that we have b = b b and w = w w . The state q is useful as evidenced by the accepting computation q a −→ u q b −−−→ vw q b −−−→ w f . By the definition of g , we can therefore shortcut this computationby substituting q b −−−→ w f with | b | ≤ g for its last part. From this we immediately obtain | w | ≤ g · s since the output speed s tells us how many symbols the transducer can outputat most when reading one input symbol. Replacing b by b b and w by w w if necessary,we can thus assume without loss of generality that | w | ≤ | w w | < s + g · s = ( g + 1) s . Thisfinally gives us the desired upper bound | v w | < h + ( g + 1) s on the length of the remainingoutput word that A still has to read together with the input word b .We continue to examine the computation q b −−−→ vw f by transducer T ; our focus now lieson b instead of w , however. In every computation step the transducer reads one inputsymbol and produces an output of length at most s . Thus we know that there are at least | vw | /s computation steps during which T transduces one symbol from b into a nonemptyoutput; we call these steps and the corresponding head positions productive . Using the traillength bound | v | > t , we can see that the number of productive steps during the transductionof b is at least | vw | /s > t/s .Switching to the automaton computation, we now know that in the case under con-sideration A has an output suffix of length at most h + ( g + 1) s left to read. As beforewe use the fact that only one of the two heads can move in each step, but now in orderto split the input steps into at most h + ( g + 1) s + 1 consecutive sequences of steps inwhich only the input head advances through yb , with the output head standing still. Sincetransducer T has over t/s productive steps during the transduction of b —as establishedin the previous paragraph—there has to be, among the up to h + ( g + 1) s + 1 sequences ofconsecutive input steps by A , at least one during which the input head passes more than( t/s ) / ( h + ( g + 1) s + 1) ≥ | Q A | · | Q T | of T ’s productive positions. Thus there inevitablyare two different productive positions among these such that the corresponding two stepsadvancing the input head from these positions both lead automaton A and transducer T into the same state from Q A and Q T , respectively. We cut out from the input ab the partthat starts immediately after the first of these two positions and ends with the symbol atthe second position. From uvw we remove the nonempty part that is produced by thetransducer during the corresponding productive steps. We thus obtain two shortened words d ∈ Σ ∗ and w ∈ Γ ∗ such that T can transduce d into w and accept, while the computation ofautomaton A with the new input word d and the old output word uvw on its tapes will stillbe accepting. Hence two different output words w and uvw are associated to the same input a r X i v . o r g word d by the relation L ( A ) = L ( T ), which yields the desired contradiction and concludesthe proof. (cid:74)(cid:73) Example 10.
We present an illustrative example of an f-NFT with unbounded trailing.According to Theorem 9, there is no equivalent f-2t-DFA, which implies that the inclusion L (f-2t-DFA) ⊆ L (f-NFT) is proper; see Figure 1.The transducer’s alphabets are Σ = Γ = { , } and its relation is { (0 i j , i ) | i, j ∈ N } ∪ { (0 i j , j ) | i, j ∈ N } . This union contains exactly the pairs of the form (0 i j β, k ),where β is a bit valued 0 or 1 and k = i if β = 0 and k = j if β = 1. This relation is easilycomputed by an f-NFT that nondeterministically guesses β , then copies either 0 i or 0 j tothe output tape, and finally accepts or rejects depending on whether the guess was correct.No f-2t-DFA can compute this relation, however, for the following intuitive reason.Consider an input-output pair (0 i j β, k ) with sufficiently large i , j , and k . By the timethe input head reaches the first 1, the output head has either read most of 0 k already orhas a large part of it still lying ahead. In the first case, the automaton may have potentiallychecked whether k = i , but cannot remember how many zeroes of 0 k the output head hasalready passed making it impossible to check whether k = j if the input ends with β = 1.In the second case, the automaton can potentially still check whether k = j , but cannotremember how many zeroes the input head has already passed, i.e., the value of i , making itimpossible to check whether k = i if the input ends with β = 0. Therefore, the automatonfails on inputs with β = 1 in the first case and on inputs with β = 0 in the second case.To show formally that the described transducer has unbounded trailing we use thevariable names of Definition 6. For any given t ∈ N , we can choose u = b = w = w = λ ,where λ denotes the empty word, a = v = 0 t , b = 10 t
10, and b = 10 t
11. This yields twocomputations showing that the trailing bound must be at least t , namely q t −−−→ t q t −−−−−→ λ f and q t −−−→ λ q t −−−−−→ t f . In this section, we prove that determining whether an f-NFT has bounded trailing isundecidable. This is achieved by reducing the halting problem on the empty input, which isknown to be undecidable, to the problem of determining whether an f-NFT has boundedtrailing. We present a reduction via a third problem, namely determining whether a Turingmachine reaches infinitely many configurations on the empty input.
Undecidable Problems about Turing Machines
We begin by formally defining our standard model of a deterministic Turing machine with asingle tape that is unbounded in both directions. (cid:73)
Definition 11. A Turing machine is a sextuple M = ( Q, Γ , ␣ , q , F, δ ) , where Q is a finite, non-empty set of states, Γ is a finite, non-empty set of alphabet symbols, ␣ ∈ Γ is the blank symbol, q ∈ Q is the initial state, δ : ( Q \ F ) × Γ → Q × (Γ \ { ␣ } ) × { L, R } is a (partial) transition function, and F ⊆ Q is the set of accepting states. . Burjons, F. Frei, and M. Raszyk 11 A configuration of a Turing machine consists of its current state, the content of thetape, and the position of the head on the tape. We will only consider the computationsof a Turing machine on the empty input, the initial configuration thus always consists ofthe initial state q , a tape containing only blank symbols, and the head scanning one ofthem. A configuration is called accepting if its current state q is accepting, i.e., if q ∈ F .A configuration is called halting if it is accepting or the transition function is undefinedfor the current state q ∈ Q \ F and the symbol a ∈ Γ currently scanned by the head. Ifa configuration is not halting, the next configuration reached in one step of the Turingmachine’s computation is obtained by updating the current state, writing a non-blank symbolto the tape’s cell scanned by the head, and moving the head either one cell to the left or onecell to the right.Any configuration reached during the Turing machine’s computation on the empty inputconsists of a finite contiguous sequence of non-blank symbols and the position of the headscanning either any symbol within this sequence or one of the two blank symbols delimitingit. Hence, we can represent a configuration of the Turing machine as a finite sequence ofcells of two types: In every configuration there is exactly one cell of the first type, namelythe one currently scanned by the head. In our representation, this type of cell contains somepotentially blank symbol and the current state. The second type of cells contains a non-blanksymbol only. The initial configuration, for example, is represented by a single cell containingthe blank symbol and the initial state—recall that we consider only the computation on theempty input.A Turing machine halts on the empty input if it reaches a halting configuration during itscomputation starting in the initial configuration. The undecidability of determining whethera halting configuration can be reached is well known. We show that it is also undecidablewhether a given Turing machine reaches infinitely many different configurations during itscomputation on the empty input. (cid:73)
Lemma 12.
The problem of determining whether a Turing machine reaches infinitelymany different configurations during its computation on the empty input is undecidable.
Proof.
We prove the lemma by contradiction. Suppose that there is an algorithm A ∞ that decides for every given Turing machine M whether it reaches infinitely many differentconfigurations on the empty input. We will use A ∞ to design an algorithm A H that decidesfor any Turing machine M whether it reaches a halting configuration on the empty input.The latter problem is known to be undecidable, yielding the desired contradiction.Given a Turing machine M , algorithm A H first invokes A ∞ to decide whether M reachesinfinitely many different configurations on the empty input. If it does, then A H outputs “No”because reaching a halting configuration implies reaching only finitely many configurationsin total. Otherwise, A H simulates M ’s deterministic computation on the empty input stepby step, remembering all configurations, until either a halting or a previously encounteredconfiguration is reached. Then A H outputs “Yes” in the former case and “No” in thelatter. (cid:74) Because both the set of states and the alphabet are finite, the set of all configurations ofa bounded length is necessarily finite. It follows that a Turing machine M reaches infinitelymany configurations if and only if it reaches configurations of arbitrary length. (cid:73) Corollary 13.
The problem of determining whether a Turing machine reaches configurationsof arbitrary length on the empty input is undecidable. a r X i v . o r g c c c · · · c k copy c c c · · · c k c c c · · · c k step c c c · · · c k − c k (a) The two types of valid inputs for T and the corresponding accepted outputs. Each c i with i > M , c is its initial configuration, and c i is c i ’s successorconfiguration. c c c · · · c k copy c c c · · · c k c c c · · · c k step c c c · · · c k c k +1 (b) Two accepting computation patterns of T that make unbounded trailing inevitable if M reachesarbitrarily long configurations. Here, c is still the initial configuration of M on the empty input,but c i +1 is now the successor configuration of c i , under a single computation step of M . Figure 4
Accepting computation patterns of transducer T , which depends on Turing machine M . Reduction to Bounded Trailing
We show how to construct from a given deterministic Turing machine M an f-NFT T ( M ) suchthat T has unbounded trailing if and only if M reaches configurations of arbitrary length.A valid input for T is a sequence of M ’s configurations followed by one of two specialsymbols that we call mode indicators . The configurations are represented by finite sequencesof cells as described in the previous section and separated from each other by a dedicatedsymbol not occurring anywhere else. The two mode indicators are represented by a cellcontaining either of the two words in { copy , step } . The transducer T starts its computationby nondeterministically guessing the mode indicator and then operates in the correspondingmode described below. If the guess turns out to be wrong or if the input is invalid in anyway, the computation is aborted and the transducer rejects the input. Copy Mode
Copy the given input to the output tape symbol by symbol while moving theheads synchronously, omitting only the mode indicator in the end.
Step Mode
In the first step, output M ’s entire fixed initial configuration c while reading andremembering the first input symbol. Then read from the input sequence one configuration c after the other. While reading c , compute and output the successor configuration c that M reaches from c in one computation step. Of course, this all assumes that such aconfiguration c exists; otherwise, T aborts the computation as it does for invalid inputs.The two types of input-output pairs after an accepting computation are depicted in Figure 4a.To see that T can in fact realize these computations, observe that the changes necessaryto turn a configuration c into its successor configuration c do, on the one hand, only dependon the single type-one cell of c containing the currently scanned symbol and the current stateand, on the other hand, only affect the immediate proximity of this cell.Hence, the successor configuration c can indeed be computed from c by a finite transducerthat essentially is still copying each configuration symbol by symbol, but with a buffer ofthree cells, which allows it to modify the configuration in the right place to produce thesuccessor configuration. Transducer T can be effectively computed from any given Turingmachine M ; we omit the technicalities.We can easily check that the described transducer T is functional as follows. On the onehand, it rejects all invalid inputs anyway. On a valid input, on the other hand, T takes onlya single nondeterministic decision to choose the operating mode and then accepts for onlyone of the two choices, depending on the mode indicator. We state the functionality formally. (cid:66) Claim 14.
Transducer T is functional, i.e., T is an f-NFT. . Burjons, F. Frei, and M. Raszyk 13 We will now sketch the proof of the crucial connection between the length of M ’sconfigurations and T ’s trailing. (cid:66) Claim 15.
The f-NFT T has unbounded trailing if and only if Turing machine M reachesconfigurations of arbitrary length during its computation on the empty input.The transducer T takes only one nondeterministic decision during any computation,namely to operate in either copy or step mode, the rest of the comptuation is deterministic.According to Definition 6, the only way for any trailing to occur is therefore a pair of two com-putations, one in copy mode and one in step mode, producing consistent output words. One ofthese two output words is a prefix of the other; we call it the common prefix of the two compu-tations. See Figure 4b for an example of the arising situation. In the next paragraph we arguewhy the configurations within the common prefix represent a valid computation of M and whythe maximal trail length is equal to the length of the longest configuration, up to a constant.Since transducer T always starts by outputting the initial configuration c in step mode,this has to be the first configuration on the output tape in copy mode as well. In copy mode, T can only write this configuration c to the beginning of the output tape if c is also thefirst configuration on the input tape. The step mode behavior now ensures that the secondconfiguration on the output tape is the successor of c , call it c . Iterating this argument, wesee that the common prefix indeed contains a valid computation c , c , . . . , c k , where eachconfiguration is the successor of the previous one under one computation step of M . Finally,the trail is always as long as the configuration that is currently being read, up to the size ofthe three cells contained in the buffer. Thus the maximal trail length is indeed always equalto the length of the longest configuration occurring in a computation of M on the emptyinput word up to constant.Finally, we state the main result of this section. (cid:73) Theorem 16.
Whether a given f-NFT has bounded trailing is an undecidable problem.
Proof.
We prove the theorem by contradiction. Suppose that there is an algorithm A deciding whether an f-NFT has bounded trailing. We construct an algorithm A ∞ decidingwhether a Turing machine M reaches configurations of arbitrary length. The latter problemis undecidable by Corollary 13, yielding the contradiction.Given a Turing machine M , algorithm A ∞ constructs the f-NFT T and uses algorithm A to decide whether T has bounded trailing. If it does, then A ∞ outputs “No,” otherwiseit outputs “Yes.” The correctness of algorithm A ∞ follows from Claim 15. (cid:74) We have shown f-NFTs to be more powerful than f-2t-DFAs, characterized f-NFTs havingan equivalent f-2t-DFA as those with bounded trailing, proved that it is undecidable whetheran f-NFT has bounded trailing, and showed how to construct the f-2t-DFA if it is possible.The undecidability of transforming a 2t-NFA into an equivalent 2t-DFA has been known forthe nonfunctional case already, albeit without the characterization and without constructionof the deterministic automaton [5]. The picture painted by these results is still not complete,however, even if we restrict our attention to the question of decidability exclusively, ignoringthe characterization and construction. The undecidability in the nonfunctional case wasproved using 2t-NFAs whose relations map every input word to infinitely many output words.Thus, it still remains open whether the undecidability still holds for NFTs that are notfunctional but still finite-valued. a r X i v . o r g
The results of this paper already show that bounded trailing is sufficient for an equivalent2t-DFA to exist for any NFT, finite-valued ones in particular. We conjecture that our proofof the necessity of this condition can be expanded to cover the finite-valued case with moretechnical work. Together with the established undecidability of bounded trailing in thefunctional and hence also finite-valued case, this would prove that our undecidable criterionof bounded trailing still holds for finite-valued NFTs, thus closing this remaining gap.
References M-P. Béal and O. Carton. Determinization of transducers over finite and infinite words.
Theoret. Comput. Sci. , 289(1):225–251, 2002. E. Burjons, F. Frei, and M. Raszyk. Formalization associated with this paper, 2020. https://github.com/mraszyk/icalp20 . J. Engelfriet and H. J. Hoogeboom. Two-way finite state transducers and monadic second-orderlogic. In
Automata, Languages and Programming . Springer, 1999. E. Filiot, O. Gauwin, P-A. Reynier, and F. Servais. From two-way to one-way finite statetransducers. In
LICS 2013 , pages 468–477. IEEE Computer Society, 2013. P. C. Fischer and A. L. Rosenberg. Multitape one-way nonwriting automata.
Journal ofComputer and System Sciences , 2(1):88 – 101, 1968. M. Holzer, M. Kutrib, and A. Malcher. Complexity of multi-head finite automata: Originsand directions.
Theoretical Computer Science , 412(1):83 – 96, 2011. M. O. Rabin and D. Scott. Finite automata and their decision problems.
IBM Journal ofResearch and Development , 3(2):114–125, 1959. M. Raszyk, D. A. Basin, and D. Traytel. From nondeterministic to multi-head deterministicfinite-state transducers. In
ICALP 2019 , volume 132 of
LIPIcs , pages 127:1–127:14, 2019. I. H. Sudborough. On tape-bounded complexity classes and multihead finite automata.