Lexicographic Transductions of Finite Words
Abstract
Regular transductions over finite words have linear input-to-output growth. This class of transductions enjoys many characterizations, such as transductions computable by two-way transducers as well as transductions definable in MSO (in the sense of Courcelle). Recently, regular transductions have been extended by Bojańczyk to polyregular transductions, which have polynomial growth, and are characterized by pebble transducers and MSO interpretations. Another class of interest is that of transductions defined by streaming string transducers or marble transducers, which have exponential growth and are incomparable with polyregular transductions.
In this paper, we consider MSO set interpretations (MSOSI) over finite words, that were introduced by Colcombet and Loeding. MSOSI are a natural candidate for the class of “regular transductions with exponential growth”, and are rather well behaved. However, MSOSI for now lacks two desirable properties that regular and polyregular transductions have. The first property is to have an automata description. This property is closely related to a second property, that of being regularity preserving, meaning preserving regular languages under inverse image.
We first show that if MSOSI are (effectively) regularity preserving then any automatic -word has a decidable MSO theory, an almost 20 years old conjecture of Bárány.
Our main contribution is the introduction of a class of transductions of exponential growth, which we call lexicographic transductions. We provide three different presentations for this class: first, as the closure of simple transductions (recognizable transductions) under a single operator called maplex; second, as a syntactic fragment of MSOSI (but the regular languages are given by automata instead of formulas); and third, we give an automaton based model called nested marble transducers, which generalize both marble transducers and pebble transducers. We show that this class enjoys many nice properties including being regularity preserving.
Keywords and phrases:
Transducers, Automata, MSO, Logical interpretations, Automatic structuresFunding:
Emmanuel Filiot: research director at F.R.S.-FNRS. This work was partially funded by the FNRS project 40020726.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Automata extensionsAcknowledgements:
Nathan Lhote would like to warmly thank Mikołaj Bojańczyk, Rafał Stefański and Lê Thành Dũng (Tito) Nguyễn for many interesting discussions at different stages of this work.Funding:
This work has been partly funded by the QuaSy project (ANR-23-CE48-0008).Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Before discussing lexicographic transductions, the central notion of this article, we give some context on transduction classes and connections to automatic structures.
MSOSI and the connection to automatic structures.
MSO set interpretations (MSOSI) were introduced in [11], as a generalization of automatic structures (as well as -automatic, tree automatic and -tree automatic structures). Indeed an automatic structure can be seen as an MSOSI whose domain is a single structure with decidable MSO theory such as . Using a framework of transformations turns out to be very fruitful, and most of the properties of automatic structures already hold for set-interpretations over structures with decidable MSO theory. The core property of automatic structures (and their generalizations) is that they have a decidable FO theory. More generally, MSOSI have what we call the FO backward translation property, meaning that the inverse image of an FO definable set by an MSOSI is MSO definable. This property is obtained via simple, yet powerful, syntactic formula substitution. This technique actually allows to show more generally that MSOSI are closed under post-composition by FO interpretations (FOI).
Generally speaking, automatic structures do not have a decidable MSO theory. This has motivated a line of research that looks for interesting structures with a decidable MSO theory. For instance, morphic -words, as well as two generalizations called -lexicographic -words [2] and toric -words [4], have been shown to have a decidable MSO theory. Morphic -words and -lexicographic -words are particular cases of automatic -words111Not to be confused with automatic sequences.. An automatic -word is an automatic structure with unary relations and a single binary relation that is a total order isomorphic to (it is crucial that the structure be given by its order relation and not by the successor). To the best of our knowledge, it is not known whether an automatic -word with an undecidable MSO theory exists, raising the next conjecture.
Conjecture 1 ([2], Section 9).
Any automatic -word has a decidable MSO theory222Bárány actually conjectures that any automatic -word has a so-called canonical presentation..
In [2, Corollary 5.6], the author even shows that -lexicographic -words are closed under sequential transductions. As we show in Proposition 11 this property is deeply connected to preserving MSO definable sets by inverse image (which we call regularity preserving333It follows the terminologiy of [3]. This property is sometimes called regular continuity [10].) and is stronger than having a decidable MSO theory.
A different setting where one can obtain regularity preserving transductions, is provided in [8] where it is shown that MSO interpretations (MSOI) from finite words to finite words characterize the polyregular transductions. Once again, as for automatic -words, the output structure must be defined by its order and not by the successor.
This calls for a more unifying argument and systematic study of MSOSI whose output structures are linearly ordered, that we phrase as a conjecture444One could state stronger conjectures extending the structures to trees, -words or infinite trees.:
Conjecture 2.
MSOSI from finite words to finite words are regularity preserving.
On regular transductions with exponential growth.
The theory of finite word transducers has a long history (in fact as long as automata theory) and is still actively studied.
Various classes of transductions have been introduced, most notably (and ordered inclusion-wise): sequential (Seq), rational (Rat), regular (Reg) and the more recent polyregular transductions (PolyReg) as well as transductions defined by streaming string transducers (SST), which subsume Reg but are incomparable to PolyReg. For a recent survey, see [23].
These classes are rather well-known and enjoy nice regularity properties, including being closed under composition (except for SST which is still closed under post-composition by Seq) which entails555In Proposition 11 we see that the two are closely related. being regularity preserving. However some important questions remain open, such as equivalence of PolyReg transductions, which is not known to be decidable.
The two classes of Reg and PolyReg enjoy natural logical characterizations, namely word-to-word MSO transductions (MSOT) and MSOI, respectively. The fact that MSOT are regularity preserving is again obtained by simple formula substitution and holds for arbitrary structures. In contrast in the case of MSOI, the only known proof is via a translation into an automaton model called pebble transducers. This raises a natural question for MSOSI:
Question 1.
Can we get an automaton model corresponding to MSOSI over finite words?
A positive answer to this question would hopefully provide a proof of Conjecture 2, since natural automata models are usually closed under post-composition by Seq 5. While hope plays an important part in research, we have good reasons to think this is a hard problem: as mentioned above this would solve a long standing open problem on automatic structures.
It is rather clear that PolyReg captures the “right” notion of regular transductions with polynomial growth. While MSOSI seems like a natural candidate, not enough is known about this class yet to say that it captures the “right” notion of regular transductions with exponential growth. Let us more humbly describe what should be, in our view, a nice class of regular transductions with exponential growth: this class should be characterized by different, somewhat natural666As opposed to an artificial model like the union of PolyReg with SST., computation models which subsume the well-behaved classes of PolyReg and SST. It should be regularity preserving and potentially5 have extra closure properties by pre- or post-composition with smaller classes. In this article we introduce the class of lexicographic transductions (Lex) which meets all the above criteria.
Contributions.
The first contribution of the article is a hardness result: showing that word-to-word MSOSI are regularity preserving is at least as hard as showing that any automatic -word has a decidable MSO theory (Proposition 14). To obtain this result we define automatic transduction (AT) which are naturally equivalent to MSOSI but formulated in a way that makes the connection with automatic structures clearer. That way we obtain a one-to-one correspondence between automatic -words and automatic transductions over a unary alphabet which define a total function.
The main contribution of the article is the introduction of a new class of transductions, called lexicographic transductions (Lex). We give three different characterizations of this class and show that it enjoys many nice properties, including being regularity preserving.
The first definition of Lex is in the spirit of list functions of [7, 5]: we start with simple functions which are recognizable transductions whose range contains words of length at most only. Then we close the class under a single type of operator called maplex which works as follows: maps a word to the concatenation where are all the labellings of over some fixed and totally ordered alphabet, enumerated in lexicographic order.
Secondly, we show that this class can be expressed as a syntactic restriction of AT, which we call lexicographic automatic transductions (). These two characterizations are actually syntactically equivalent but quite different in spirit. We leverage the aforementioned correspondence between automatic -words and automatic transduction, as well as a result of Bárány to show that the nesting of maplex operators generates a strict hierarchy of transduction classes (Proposition 27).
Thirdly, we introduce an automaton model called nested marble transducers (NMT). Nested marble transducers are quite expressive: they generalize marble transducers [15, 12] which are known to coincide with SST, they also naturally generalize PolyReg. Informally, a level nested marble transducer can annotate its input as a marble transducer (i.e. it drops a marble whenever moving left and lifts a marble whenever moving right), and call a level nested marble transducer to run on this annotated configuration. This call returns both an output string and a state which the top-level transducer can use to take its next transition. This passing of information from the lower levels to the higher levels is what allows to prove closure under post-composition with a sequential transducer. This is the key ingredient to show that NMT have regular domains, are regularity preserving, and more generally are closed under post-composition by PolyReg.
Regarding expressiveness, Lex can be expressed by NMT in a rather direct way (Theorem 36). In the other way, transductions expressed in Lex do not have such a state-passing mechanism, hence showing that NMT is included in Lex constitutes the technical heart of this article (Theorem 37). An important step consists in showing that one can remove the state-passing mechanism in NMT (Theorem 33). On top of being technical, we show it is computationally costly: there is an unavoidable non-elementary blow-up to transform a nested marble transducers into nested marble transducers without state-passing. This allows to prove the equivalence between the different models. In addition, as shown in Figure 1, this equivalence holds at each level of the aforementioned hierarchy.
2 Word languages and transductions
Words and languages.
Given an alphabet , a -word (or just word if is clear from the context) is a sequence of letters from . We denote by the empty word, and by the length of a word . In particular . For all integers , we let (resp. ) be the set of words of length (resp. at most ). We let be the set of positions of , and for all , is the -th letter of . We write for the set of words over , and for the set of non-empty words. An -word is defined similarly, with a set of positions equal to . A word language over is a subset of . In this paper, we let be a symbol called separator, assumed to be distinct from any alphabet symbol. Let be two alphabets, and be two words of length . The convolution of and is the word in such that for all , .
Finite automata.
A (non-deterministic) finite automaton (NFA) over an alphabet is denoted as a tuple where is the set of states, the initial state, the final states, and the transition relation. We write when there exists a run of from state to state on , and denote by the language recognized by . When is a deterministic finite automaton (DFA), the transition relation is denoted by a (partial) function .
Word transductions.
A word transduction (or just transduction for short) over two alphabets is a (partial) function . We denote by its domain. Given two transductions with disjoint domains, we let be the transduction of domain such that if . Given , , we write the composition . Given , stands for . For , we also write for .
A transduction has exponential growth if there exists such that for all , holds. A transduction has polynomial growth if there exist such that for all , holds.
Example 3 (Reverse, copy and square).
Let be an alphabet. The transduction takes as input any word and outputs its reverse , for all . The transduction copy takes and returns .
Let be an alphabet and . Given a word and a position , we let . The transduction is defined as . For example .
Example 4 (Subwords).
Let be the transduction which enumerates all the subwords of a word in lexicographic order (with rightmost significant bit). For example . Note that sub has exponential growth.
Example 5 (Map).
Let be some alphabet and be some separator symbol. Let . Let . The transduction takes any input word of the form where for all , and returns (if all the are defined, otherwise is undefined.
Sequential and rational transductions.
Sequential transductions are transductions recognized by sequential transducers. A sequential transducer over some alphabets and (not necessarily disjoint) is a pair where is a DFA over and is a total function. We write whenever there exists a sequence of states such that where , and . The transduction recognized by is defined for all by such that . Note that . We denote by Seq the class of sequential transductions. Like sequential transducers, a (non-deterministic, functional) finite state transducer is defined as a pair but can be non-deterministic, with the functional restriction: for all words , the outputs of all the accepting runs over are all equal. With this restriction, recognizes a transduction . A rational transduction is a transduction for some , and we denote by Rat the class of rational transductions [21].
Regular and polyregular transductions.
The class of regular (resp. polyregular) transductions is the smallest class of transductions which is closed under composition of transductions and map, and contains the sequential transductions, copy and rev (resp. the sequential transductions, rev and square) [9, 5]. We denote by PolyReg the class of polyregular transductions.
3 MSO set interpretations, properties and limitations
MSO set interpretations
Signatures, formulas and structures.
A relational signature (or simply signature) is a set of symbols together with a function . We consider a set of first-order variables denoted by lower case letter as well as a set of second-order variables denoted by upper case letter . The MSO-formulas over signature , denoted by , are denoted by the grammar , where are first-order variables, is a second-order variable and with . We denote by the formulas which do not use second-order variables.
A relational structure over signature is a set called the universe of the structure, together with, for each symbol of arity , an interpretation .
Regularity preserving.
A function from -structures to -structures is called regularity preserving if the inverse image of an definable set is definable. We say that a class of functions is regularity preserving if all functions in the class are.
Word structures.
The word signature over is the tuple where are unary predicate symbols and , usually written , is a binary predicate symbol. Any word can be naturally associated with an -structure where , is a set of positions labeled , for all , and is the natural (linear) order on . We write instead of if it is clear from the context that is an -structure. A word structure over is an -structure isomorphic to some . Note that being a word structure is FO definable.
Definition 6 (MSO set interpretations [11]).
An MSO set interpretation (MSOSI) from -structures to -structures, is given by called the dimension, a domain formula , an output universe formula , and for each symbol of arity a formula , where are -tuples of variables.
The semantics of is a partial transduction from -structures to -structures. The domain of is the set of structures such that . Given such a with universe , we define its image as the structure with universe , and for each of arity , the interpretation .We say that an MSOSI is (finite) word-to-word if its domain and co-domain only contain word structures over some respective alphabets .
Remark 7.
Given an MSOSI from -structures to -structures, one can restrict the domain formula to word structures whose image are word structures. This is because being a linear order is FO-definable.
Example 8.
The transduction sub of Example 4 is definable by the MSOSI . The main idea is to let range over all possible subsets, and range over all possible singletons such that . Let . It holds true iff . Then, . The label of an output position is the label of the input position , i.e. . Finally, any two output positions , are ordered lexicographically (with rightmost significant bit): if , then , otherwise, the smallest mismatching position (i.e. a position in the symmetric difference of and ) must be in . Those properties are easily expressible in MSO.
MSO transductions, MSO and FO interpretations.
An MSO interpretation (MSOI) is an MSOSI whose free set variables are restricted to be singleton sets. This can be syntactically enforced in the universe formula , as being a singleton is an MSO definable property. Equivalently, MSOI are defined as MSOSI but instead the free variables are first-order. Note that transductions realized by MSOI have only polynomial growth. An FO interpretation (FOI) is an MSOI whose formulas are all FO-formulas. Finally an MSO transduction (MSOT) is (roughly777Classically, one adds a bounded number of copies of the input to get the full class of MSOT. speaking) an MSO interpretation of dimension . MSOT capture exactly the class of regular transductions [13, 1, 16, 23].
The following theorem is at the core of the theory of set interpretations, and automatic structures. It holds in all generality, and furthermore the compositions can be done by simple formula substitutions.
Theorem 9 ([11, Proposition 2.4]).
MSO set interpretations are effectively closed under pre-composition by MSOT and post-composition by FOI.
Exponential versus polynomial growth.
There is a dichotomy for the growth of set interpretations over words, deeply connected to the similar dichotomy for the automata ambiguity, between exponential and polynomial growths. Moreover for polynomial growth transductions, the level of growth exactly coincides with the minimum dimension of an MSOSI defining the transduction. The result holds in the more general case of trees.
Theorem 10 ([20, Theorem 1.5],[6, Theorem 2.3]).
A set interpretation over words has growth either , or for some , and this can be computed in PTime. In the latter case888Note that to get this tight correspondence, we need to allow a bounded number of copies of the input, see [20, Definition 4.3]., one can compute an equivalent MSOI of dimension .
Quite a lot is known about word-to-word set interpretations with polynomial growth, which are called polyregular transductions and enjoy many different characterizations [8, Theorem 7].
Regularity preserving.
An open question on word-to-word MSOSI is whether they are regularity preserving. This can actually be formulated in terms of closure properties.
Proposition 11.
The following are equivalent:
-
Word-to-word MSOSI are regularity preserving,
-
The class of word-to-word MSOSI is closed under post-composition with transductions computed by Mealy machines (see [24] for a definition of Mealy machines),
-
The class of word-to-word MSOSI is closed under post-composition with polyregular transductions.
Automatic transductions
We describe an automata-based presentation of MSOSI, which we call automatic transductions. Algorithmically speaking, it is more amenable to efficient processing, as it is based on automata instead of MSO, and it makes the connection between automatic structures and set interpretations more obvious.
Definition 12.
An automatic transduction (AT for short) from to -structures is described as a tuple where:
-
is a finite alphabet describing a work alphabet
-
is an automaton over recognizing the domain of the transduction,
-
is an automaton over . Words accepted by are called configurations,
-
for each of arity , is an automaton over describing tuples of the relation .
Given a word , the output -structure is defined, whenever , as follows: its universe is the set ; a predicate symbol of arity is interpreted as .
Remark 13.
Automatic transductions are essentially identical to MSOSI, except restricted to input word structures, where one can leverage the classical equivalence between MSO and automata. They can be naturally generalized to work over input structures such as -words, trees and infinite trees, giving rise to the notions of -automatic, tree-automatic and -tree-automatic transductions. Note that an -automatic structure is precisely an -automatic transduction whose domain is a single infinite word .
Transduction/structure correspondence.
In [18], we show a correspondence between word-to-word automatic transductions and automatic -words (defined therein), thanks to which we obtain the following proposition.
Proposition 14.
If word-to-word MSOSI are effectively regularity preserving, then automatic -words have a decidable MSO theory999One could actually prove the stronger implication that any automatic -word has a canonical presentation, as in [2]..
4 Lexicographic transductions
As explained in the latter section, we do not know whether MSOSI are regularity preserving, and as a consequence of Proposition 14, proving that it enjoys this property would prove a long-standing conjecture of the theory of automatic structures [2]. In this section, we introduce a subclass of MSOSI which enjoys this property, called lexicographic transductions.
Definition of lexicographic transductions
We first define this class in terms of closure of basic transductions, called simple transductions, under a lexicographic map operation. The connection with MSOSI is done at the end of this section (Subsection 4), via a corresponding subclass of automatic transductions.
Simple transductions.
A regular constant (partial) transduction of type is an expression of the form , where is a regular language over and is a word in , such that for all , is defined only if , by . A simple transduction101010It is a restriction of the known class of recognizable transduction to output words of length at most . is a finite union of regular constant transductions whose codomain only contains words of length at most . A simple transduction is denoted by such that are pairwise disjoint regular languages, and .
Lexicographic enumerators.
An ordered alphabet is a pair such that is finite set and is a linear order over . The order is extended lexicographically (using the same notation) to words of same length over , with most significant letter to the right: for all and all , if there exists a position such that and for all , . Note that is a total order over , for all . We denote the successor function on induced by .
Remind that is a fixed separator symbol. The -lexicographic enumerator is the function
where , is minimal for , is maximal for and for all , . Note that .
Example 15.
Let let be a finite order with and . For all and , we write instead of and to denote the set of pairs for all . Then .
MapLex combinator.
Let be an ordered alphabet. We define the function
such that for all alphabets, all and ,
where . Note that is in the domain of if and only if are all in the domain of . We write maplex when is clear from the context.
Definition 16 (Lexicographic transductions).
Lexicographic transductions, denoted by Lex, are defined inductively by the class of simple transductions and . Elements of are called -lexicographic transductions.
Lemma 17.
For all , its domain is regular.
Proof.
Any Lex transduction is equal to for some , some ordered alphabets and some simple transduction . Then, is defined on iff for all and all , is defined. Now, observe that is the complement of the -projection of the complement of . This entails the result as is regular and regular languages are closed under morphisms (and complement).
Remark 18.
A simple transduction , has growth , and has growth , for . One application of maplex can thus cause an exponential blowup. Note however that these exponentials don’t compose, but multiply with extra applications of maplex. Using the same notations as in the above proof, has growth .
Example 19 (Identity and Reverse).
Take and with , , and . For all , let and .
This is illustrated below on input , with the output of the simple function below every word of the enumeration.
Example 20 (Morphisms).
Let be the morphism defined by and . We have . It suffices to take with . Then, let , and . Then More generally, if is an arbitrary morphism, we show that . Note that may transform a single letter into several letters, while simple transductions output at most one letter. To overcome this difference, we consider a larger linearly ordered set. Let . If , then is the constant transduction which outputs , so . Otherwise, let with naturally ordered. Let such that for all , is the set of pairs such that . Note that for all , . Define as the set given by the regexp and the complement of the union of all . Then
Example 20 can be generalized to sequential transductions.
Lemma 21.
.
Example 22 (Domain restriction).
Let . Given a transduction in and a regular language, the transduction if is in . We show this inductively on : it is clear for . Assume with and let be the natural projection morphism. Then , which proves that is closed under domain restriction.
Example 23 (Subwords).
Example 24 (Square, illustrated on Fig. 2).
The transductions square and have been defined in Ex. 3. We show that . Let with and let such that for all of length , for all , , and for , . It holds that , because for all . It remains to show that . It is because for the following simple transduction: for all , if or , , otherwise let be the unique position at which occurs in and the unique position at which a occurs in . If , then , otherwise . Since those properties are regular, is a simple transduction.
Presentation as automatic transductions
We give an alternative presentation in terms of automatic transductions. Let be a positive integer, and be a -tuple of ordered alphabets and let . We define the associated -lexicographic order for words of the same length over by if , , and there is such that and for all , .
Definition 25.
Let be a -tuple of ordered alphabets, let and let be the associated -lexicographic order.
A -lexicographic automatic transducer over the alphabet is an automatic transducer with work alphabet such that the order is exactly . A transduction is said to be -lexicographic automatic if it can be defined by a -lexicographic automatic transducer. We denote by the class of -lexicographic automatic transductions and by the union of these, which we call lexicographic automatic transductions.
The next proposition is rather immediate.
Proposition 26 ().
For all , a transduction is -lexicographic iff it is -lexicographic automatic.
In [18], we make a connection between -lexicographic automatic transductions and -lexicographic automatic -words [2]. In [2, Theorem 6.1], the author shows that -lexicographic automatic -words form a strict hierarchy and provides explicit witnesses for each level of the hierarchy. As a consequence of Proposition 26, we obtain that -lexicographic transductions form a strict hierarchy, as stated by the following proposition.
Proposition 27.
For all , .
5 Nested marble transducers
We introduce in this section a transducer model, called nested marble transducers, and show that the class of transductions it recognizes is exactly the class of lexicographic transductions. Nested marble transducers generalize marble transducers [15, 12]. A marble transducer belongs to the family of transducers with an unbounded number of pebbles (of finitely many colours), with the following restriction: whenever it moves left, it has to drop a pebble, and whenever it moves right, it has to lift a pebble. The term marble is meant to emphasize this restriction. A nested marble transducer of level behaves like a marble transducer which can call, when reading the leftmarker , a nested marble transducer of level . A nested marble transducer of level is what we call a simple transducer. It is just a DFA with an output function on its accepting states, so it realizes a transduction whose range is finite.
Definition 28 (Simple transducers).
Let be finite sets (not necessarily disjoint). A -simple transducer is a pair where is a DFA over and is a total function.
We define two semantics for , an operational semantics which takes as input a word and also a state from which the computation starts, and returns a word and the state reached when the computation ends, if it is accepting. Otherwise is not defined. Formally, is defined for all such that for some , by .
From the operational semantics, we also define the transduction recognized by by applying the operational semantics from the initial state, and projecting away the final state, i.e. , where is the projection on the first component.
Definition 29 (Nested marble transducers from to ).
A -nested marble transducer is a -simple transducer. For , a -nested marble transducer is a tuple where:
-
is a finite set of (marble) colors, is an initial color;
-
is a finite set of states, is an initial state, and a set of accepting states;
-
is a -nested marble transducer with set of states and set of accepting states ;
-
is a transition function;
-
is a call function; is a return function;
-
is an output function.
We use -NMT (or just -NMT if , are clear from the context) as a shortcut for -nested marble transducer. is the assistant NMT and the level of . Finally, we often say marble instead of marble colour.
We now define the semantics informally. The reading head of is initially placed on the rightmost position labeled , marked with a marble of color , in state . Transitions work as follows: suppose the current state is and the reading head is on some position labeled by and by some marble of color . Whatever transition in can be applied, some output word is produced by according to . Then there are three cases:
-
1.
if and where , then the reading head moves to position in state and a marble of color is placed (on position );
-
2.
if and , then lifts the current marble and moves its reading head to position in state ;
-
3.
if then calls initialized with state , on the input word annotated with marbles. When finishes its computation in some accepting state , lifts marble , moves its reading head to position and continues its computation from state .
The (operational) semantics of is a function , that we define inductively. The case has been defined after Definition 28. If and then we assume to be defined inductively. Let us now define . A configuration of over a word is a triple such that is the current state, is the current position (where ), and is an annotation of the suffix . We define a labeled successor relation , between any two configurations where , labeled by , whenever one of the following cases hold:
-
1.
, , , and ;
-
2.
, , , and ;
-
3.
, , , and .
The function recognized by is defined, for all and all such that there exists a sequence of configurations over : where the state of is accepting (i.e. in ) and the states of configurations , , are non-accepting, by .
The transduction recognized by is defined as the projection of on and , i.e. if then . We denote by NMT the class of transductions recognizable by some . The local size of an NMT is the number of its transitions, states and marbles. Its size is its local size plus the size the lower level NMT it calls. We similarly define the number of (resp. local number of) states/marbles/transitions.
Example 30.
We describe a -NMT computing the transduction sub of Example 23. We recall that where and is a morphism. The transducer behaves as a marble transducer which computes the -lexicographic enumerator , and whenever a full annotation of its input has been computed, it calls a -NMT which computes . Let us explain how computes the next annotation in lexicographic order (which corresponds to the binary addition with most significant bit to the right). When the reading head of is on the left marker, all input positions are marked with some pebble in . Then, scans its input to the right (lifting all the pebbles it sees) until it reads a , replaces it by and moves again to the left marker, dropping pebble all the way back to the left marker. Only three states are needed. Initially, drops pebble on all positions, from right to left. We explain now how works: it scans its input from right to left, and, whenever it reads an input with , outputs . Whenever reaches the leftmarker, it calls a simple transducer which does nothing but outputting .
The following result states that NMT are closed under post-composition with Seq. To prove it, we strongly rely on the ability to pass state information through mappings and to adapt a classical product construction of automata.
Lemma 31 ().
For all , all -NMT and all sequential transducer over , one can construct, in polynomial time, a -NMT such that .
State-passing free nested marble transducers.
In the definition of NMT, there are two explicit forms of information-passing: state information can be passed from level to level through the function , and state information can be passed from level to level via the function . In addition, there is an implicit one through the domain of assistant transducers: indeed, the definition of the semantics requires that all calls to assistant transducers do accept, hence the assistant transducer can influence the master transducer by rejecting a word. In this subsection, we prove that information-passing can be removed while preserving the computational power of -NMT, however at the cost of increasing the size by a tower of exponentials of height . While state-passing was useful to prove the closure under post-composition with sequential transductions (Lemma 31), it will be more convenient to consider state-passing free nested marble transducers in the sequel, in particular to prove that NMT recognize lexicographic transductions (Subsection 5).
Definition 32.
A state-passing free -nested marble transducer (- for short), is either a simple transducer if , or, if , a -NMT such that
-
1.
is a - with set of states and initial state
-
2.
for all and
-
3.
for all and
-
4.
calls to the assistant transducer always accept.
Since the functions and play no role, we often omit them in the tuple denoting .
Theorem 33 (State-passing removal).
For all -NMT , there exists an equivalent - whose size is in that of . This non-elementary blow-up is unavoidable.
Before proving this result, we show a property on domains of NMT. A nested marble automaton of level is a nested marble transducer of level whose output function is the constant function that always returns . The language of is defined as .
Lemma 34.
A language is recognizable by a nested marble automaton of level and states iff it is recognizable by a finite automaton of size in -EXP(). This non-elementary blow-up is unavoidable.
Proof sketch.
It is clear that any regular language is the domain of some simple transduction. Conversely, let be a nested marble automaton of level . If , it is obvious.If , let where has level (in the tuple, we have omitted the output alphabet and function, since they play no role). By IH, for all pairs of states of , the language of words accepted by by a run starting in and ending in is regular, and can be described by some finite automaton of size in -EXP().
We turn into a marble automaton (of level ) such that . The marbles of are enriched with information on the states of automata , for all pairs , ensuring that knows the state of all the automata after reading the current suffix. exploits this information to simulate and whenever calls with some initial state , instead, knows, if it exists, the state of such that the current marked input is accepted by . If such a state exists, then it is unique as is deterministic, and can bypass calling and directly apply its return transition. Otherwise, stops.
The result follows as marble automata are known to recognize regular languages. The conversion of a marble automaton into a finite automaton is exponential both in the number of states and number of marbles (see e.g. [15, 12], as well as Theorem 5.4 of [22] for a detailed construction), yielding a tower of -exponential inductively.
It can be shown that this non-elementary blowup is not avoidable, because first-order sentences on word structures (with one successor) with quantifier rank , can be converted in an exponentially bigger nested marble automaton, while it is known that such sentences can be converted into an equivalent finite automaton of unavoidable size a tower of exponential of height [19].
Corollary 35.
Transductions recognized by nested marble transducers have regular domains.
We are now ready to sketch the proof of Theorem 33.
Proof sketch of Theorem 33.
There are two kinds of state-passing, through functions and . We deal with them separately. First, removal of can be done by enriching marbles with the current state, so as to pass this information to the assistant transducer. Removal of is more involved, but can be done by induction using a technique similar to the one used to prove Lemma 34. By induction hypothesis, the assistant transducer can be replaced by an equivalent state-passing free NMT. In addition, its domain is regular thanks to Lemma 34. Hence, one can enrich the marbles so as to precompute the final state reached by the assistant transducer, and in turn simulate the function . This also allows to ensures that all calls to the assistant transducer do accept.
Last, we justify the fact that the non-elementary blow-up is unavoidable. It is because the domain of any state-passing free NMT is recognizable by a finite automaton of exponential size. Indeed, the calls to assistant transducers always terminate, so the domain of does not depend on assistant transducers, hence can be described by a marble automaton, hence by a finite automaton of size exponential in the number of local states and marbles of . Thus, the existence of an elementary construction for state-passing removal would contradict the non-elementary blow-up stated in Lemma 34.
Equivalence with lexicographic transductions.
In this subsection, we prove (Theorems 36 and 37) that a transduction is recognizable by a -nested marble transducer iff it is -lexicographic. Consider some . Then for some and a simple transduction. We call the ordered alphabets of and the simple transduction of . Given an ordered alphabet , one can enumerate the annotations of a word according to the lexicographic extension using a marble automaton.
Theorem 36 ().
Any transduction is recognizable by some NMT of level . If are the ordered alphabets of and its simple transduction, represented by a sequential transducer with states, then has states and marbles.
Conversely, we prove that the transductions recognized by are lexicographic.
Theorem 37 ().
Any transduction recognizable by some of level is -lexicographic.
The proof is rather involved. We provide high level arguments. The result is shown by induction on . It is trivial for . For , the main idea is to see the sequence of successive configurations of on some input as a lexicographic enumeration. This is possible due to the stack discipline of marbles. By extending the marble alphabet with sufficient information, we define a total order on marbles such that successive configurations of , extended with this information, forms a lexicographically increasing chain.
6 Expressiveness and closure properties of lexicographic transductions
In this section, we prove that Lex contains all the polyregular transductions [5], and all the transductions recognizable by (copyful) streaming string transducers [17, 1]. We also show that Lex is closed by post-composition under any polyregular transduction, and closed by pre-composition under any rational transduction. We start by showing that lexicographic transductions preserve regular languages under inverse image.
Proposition 38.
Transductions in Lex are regularity preserving.
Proof.
It is an immediate corollary of the inclusion (Theorem 36), that NMT are closed by post-composition by a sequential transduction (Lemma 31), and that NMT have regular domains (Corollary 35).
We show that Lex subsumes both SST and PolyReg. More precisely that any transduction recognizable by a (copyful) streaming string transducer (SST) is -lexicographic. We do not give the definition of SST and refer the reader to [12] for more details. We also show that NMT of level subsume -pebble transducers. Again we do not give precise definitions of pebble transducers and refer the reader to [5].
Theorem 39 (SST and PolyReg in Lex).
The following hold:
-
,
-
A transduction definable by a -pebble transducer is in . In particular .
Proof.
It is already known that marble transducers (i.e. nested marble transducers of level ) capture exactly the class of SST-recognizable transductions [12]. The result then follows from Theorem 36 and Theorem 37. For the second statement, we note that single pebble can be simulated by one level of marbles, with colors with the restriction that at most one marble can have color per level.
Any polyregular transduction can be expressed as a composition of sequential transductions, square, map and rev [5]. We show that Lex is closed by post-composition by these transductions (e.g. for sequential functions it has been shown in Lemma 31). As a consequence we obtain that Lex is closed under post-composition by polyregular transductions.
Theorem 40.
.
Finally, we show that lexicographic transductions are closed under pre-composition by any rational transduction.
Theorem 41 ().
Let . For any rational transduction and any -lexicographic transduction , is -lexicographic.
Proof.
A rational transduction can be decomposed as a letter-to-letter rational transduction, followed by a morphism. Example 20 shows that morphisms are lexicographic. Similar ideas apply inductively to show that Lex is closed by pre-composition under morphisms and letter-to-letter rational transductions.
7 Discussion
We have introduced lexicographic transductions, a subclass of MSOSI, and provided three characterizations: in terms of closure of simple functions by the maplex operator, as lexicographic automatic transductions that can be seen as a syntactic restriction of MSOSI, and through nested marble transducers. Thanks to these characterizations, this class is shown to subsume both PolyReg and SST. Moreover, it is actually closed under post-composition by PolyReg and thus is regularity preserving, which MSOSI is not known to be.
Open questions on MSOSI.
We leave open whether MSOSI is regularity preserving. A way to attack the problem is to try to obtain an equivalent automata-based model, as stated in Question 1. However, as we have shown, a positive answer would entail that all automatic -words have a decidable MSO theory, which has been open for almost 20 years.
Open questions on Lex.
We have shown that Lex is a rather well-behaved class, however some interesting questions remain open. Although we suspect that MSOSI strictly subsumes Lex, this remains unproven. For example, we could not show that Lex is closed under pre-composition with Reg, in particular, it is already unclear whether holds.
The equivalence problem is central to transducer theory, but its decidability status is still unknown for PolyReg transductions. It is also open for Lex, which subsumes PolyReg.
One can decide whether a Lex transduction is in PolyReg (Theorem 10), however we do not know if the Lex hierarchy is decidable (already for its first level ).
Possible extensions of Lex.
While Lex has proven to be an interesting class, the zoo of word-to-word transductions with exponential growth is relatively unknown. We propose three possible extensions of Lex, in increasing expressiveness, all included in MSOSI.
The class may be an interesting class in itself and the first level coincides with the rather natural class of two-way streaming string transducers.
A more general way of extending Lex is to generalize the operation lex-enum to allow lexicographic orders where the significance of letters is given by an arbitrary MSO definable order. This class subsumes however it is not clear that it is regularity preserving.
Another possible generalization is to replace marbles with the so-called invisible pebbles of Engelfriet[14] and define nested invisible pebble transducers, where the nested levels can see the pebbles of the previous levels but not the ones of their own. We believe that the state-passing free version can be shown to be still included in MSOSI but it is not clear that it is regularity preserving. However, we conjecture that the version with state-passing can recognize non-regular languages, and hence is too expressive.
References
- [1] Rajeev Alur and Pavol Cerný. Expressiveness of streaming string transducers. In Kamal Lodaya and Meena Mahajan, editors, IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2010, December 15-18, 2010, Chennai, India, volume 8 of LIPIcs, pages 1–12. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2010. doi:10.4230/LIPICS.FSTTCS.2010.1.
- [2] Vince Bárány. A hierarchy of automatic -words having a decidable MSO theory. RAIRO Theor. Informatics Appl., 42(3):417–450, 2008. doi:10.1051/ITA:2008008.
- [3] Jean Berstel, Luc Boasson, Olivier Carton, Bruno Petazzoni, and Jean-Eric Pin. Operations preserving regular languages. Theor. Comput. Sci., 354(3):405–420, 2006. doi:10.1016/J.TCS.2005.11.034.
- [4] Valérie Berthé, Toghrul Karimov, Joris Nieuwveld, Joël Ouaknine, Mihir Vahanwala, and James Worrell. The monadic theory of toric words. Theor. Comput. Sci., 1025:114959, 2025. doi:10.1016/J.TCS.2024.114959.
- [5] Mikolaj Bojańczyk. Polyregular functions. CoRR, abs/1810.08760, 2018. arXiv:1810.08760.
- [6] Mikolaj Bojańczyk. On the growth rates of polyregular functions. In 38th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2023, Boston, MA, USA, June 26-29, 2023, pages 1–13. IEEE, 2023. doi:10.1109/LICS56636.2023.10175808.
- [7] Mikolaj Bojańczyk, Laure Daviaud, and Shankara Narayanan Krishna. Regular and first-order list functions. In Anuj Dawar and Erich Grädel, editors, Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, pages 125–134. ACM, 2018. doi:10.1145/3209108.3209163.
- [8] Mikolaj Bojańczyk, Sandra Kiefer, and Nathan Lhote. String-to-string interpretations with polynomial-size output. In Christel Baier, Ioannis Chatzigiannakis, Paola Flocchini, and Stefano Leonardi, editors, 46th International Colloquium on Automata, Languages, and Programming, ICALP 2019, July 9-12, 2019, Patras, Greece, volume 132 of LIPIcs, pages 106:1–106:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPICS.ICALP.2019.106.
- [9] Mikolaj Bojańnczyk and Rafal Stefanski. Single-use automata and transducers for infinite alphabets. In Artur Czumaj, Anuj Dawar, and Emanuela Merelli, editors, 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, July 8-11, 2020, Saarbrücken, Germany (Virtual Conference), volume 168 of LIPIcs, pages 113:1–113:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPICS.ICALP.2020.113.
- [10] Michaël Cadilhac, Olivier Carton, and Charles Paperman. Continuity of functional transducers: A profinite study of rational functions. Log. Methods Comput. Sci., 16(1), 2020. doi:10.23638/LMCS-16(1:24)2020.
- [11] Thomas Colcombet and Christof Löding. Transforming structures by set interpretations. Log. Methods Comput. Sci., 3(2), 2007. doi:10.2168/LMCS-3(2:4)2007.
- [12] Gaëtan Douéneau-Tabot, Emmanuel Filiot, and Paul Gastin. Register transducers are marble transducers. In Javier Esparza and Daniel Král’, editors, 45th International Symposium on Mathematical Foundations of Computer Science, MFCS 2020, August 24-28, 2020, Prague, Czech Republic, volume 170 of LIPIcs, pages 29:1–29:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPICS.MFCS.2020.29.
- [13] Joost Engelfriet and Hendrik Jan Hoogeboom. Two-way finite state transducers and monadic second-order logic. In Jirí Wiedermann, Peter van Emde Boas, and Mogens Nielsen, editors, Automata, Languages and Programming, 26th International Colloquium, ICALP’99, Prague, Czech Republic, July 11-15, 1999, Proceedings, volume 1644 of Lecture Notes in Computer Science, pages 311–320. Springer, 1999. doi:10.1007/3-540-48523-6_28.
- [14] Joost Engelfriet, Hendrik Jan Hoogeboom, and Bart Samwel. XML navigation and transformation by tree-walking automata and transducers with visible and invisible pebbles. Theor. Comput. Sci., 850:40–97, 2021. doi:10.1016/J.TCS.2020.10.030.
- [15] Joost Engelfriet, Hendrik Jan Hoogeboom, and Jan-Pascal van Best. Trips on trees. Acta Cybern., 14(1):51–64, 1999. URL: https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3510.
- [16] Emmanuel Filiot and Pierre-Alain Reynier. Transducers, logic and algebra for functions of finite words. ACM SIGLOG News, 3(3):4–19, 2016. doi:10.1145/2984450.2984453.
- [17] Emmanuel Filiot and Pierre-Alain Reynier. Copyful streaming string transducers. Fundam. Informaticae, 178(1-2):59–76, 2021. doi:10.3233/FI-2021-1998.
- [18] Emmanuel Filiot, Pierre-Alain Reynier, and Nathan Lhote. Lexicographic transductions of finite words. CoRR, abs/2503.01746, 2025. doi:10.48550/arXiv.2503.01746.
- [19] Markus Frick and Martin Grohe. The complexity of first-order and monadic second-order logic revisited. Ann. Pure Appl. Log., 130(1-3):3–31, 2004. doi:10.1016/J.APAL.2004.01.007.
- [20] Paul Gallot, Nathan Lhote, and Lê Thành Dũng Nguyên. The structure of polynomial growth for tree automata/transducers and mso set queries, 2025. doi:10.48550/arXiv.2501.10270.
- [21] Tero Harju and Juhani Karhumäki. Finite transducers and rational transductions. In Jean-Éric Pin, editor, Handbook of Automata Theory, pages 79–111. European Mathematical Society Publishing House, Zürich, Switzerland, 2021. doi:10.4171/AUTOMATA-1/3.
- [22] Tsutomu Kamimura and Giora Slutzki. Parallel and two-way automata on directed ordered acyclic graphs. Inf. Control., 49(1):10–51, 1981. doi:10.1016/S0019-9958(81)90438-1.
- [23] Anca Muscholl and Gabriele Puppis. The many facets of string transducers (invited talk). In Rolf Niedermeier and Christophe Paul, editors, 36th International Symposium on Theoretical Aspects of Computer Science, STACS 2019, March 13-16, 2019, Berlin, Germany, volume 126 of LIPIcs, pages 2:1–2:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPICS.STACS.2019.2.
- [24] Jacques Sakarovitch. Elements of Automata Theory. Cambridge University Press, USA, 2009.
