Available via license: CC BY 4.0
Content may be subject to copyright.
arXiv:2503.01746v1 [cs.FL] 3 Mar 2025
Lexicographic transductions of finite words
Emmanuel Filiot
Universit´
e libre de Bruxelles
Nathan Lhote
Aix-Marseille Universit´
e
Pierre-Alain Reynier
Aix-Marseille Universit´
e
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 Bojanczyk 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 which 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 lack, for now, two desirable proper-
ties that regular and polyregular transductions have. The first
property is being described by an automaton model, which is
closely related to the second property of 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 ´
ar´
any.
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.
Index Terms—transducers, automata, MSO, logical interpre-
tations, automatic structures
I. INTRO DUC TIO N
1) MSOSI and the connection to automatic structures:
MSO set interpretations (MSOSI) were introduced in [CL07],
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 (N,≤). 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 decidable FO theory. More generally, MSOSI have what
we call the FO backward translation property, meaning that
the inverse image of an FO formula 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
looking for interesting structures with a decidable MSO the-
ory. For instance morphic ω-words, as well as two gener-
alizations called k-lexicographic ω-words [B´ar08] and toric
ω-words [BKN+25], have been shown to have a decidable
MSO theory. Morphic ω-words and k-lexicographic ω-words
are particular cases of automatic ω-words1. An automatic ω-
word is an automatic structure with unary relations and a single
binary relation which is a total order isomorphic to (N,≤)(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, which raises the following conjecture:
Conjecture 1. [B´
ar08, Conjecture (1) Section 9] Any auto-
matic ω-word has a decidable MSO theory2.
In [B´ar08, Corollary 5.6], the author even shows that k-
lexicographic ω-words are closed under sequential transduc-
tions. As we show in Proposition III.3 this property is deeply
connected to preserving MSO definable sets by inverse image
(which we call regularity preserving3) and is stronger than
having a decidable MSO theory.
A different setting where one can obtain regularity preserv-
ing transductions, is provided in [BKL19] 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 conjecture4:
Conjecture 2. MSOSI from finite words to finite words are
regularity preserving.
In this article we focus on transductions from finite words
to finite words for two main reasons: it is already quite
challenging and it captures part of the difficulty of ω-words.
1Not to be confused with automatic sequences.
2B´ar´any actually conjectures more strongly that any automatic ω-word has
a so-called canonical presentation.
3This property is sometimes called regular continuity [CCP20].
4One could even venture stating stronger conjectures extending the struc-
tures to trees, ω-words or infinite trees.
Indeed we show in Corollary III.8 that a positive answer to
Conjecture 2 entails that Conjecture 1 holds.
2) 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), ra-
tional (Rat), regular (Reg) and the more recent polyreg-
ular transductions (PolyReg) as well as transductions de-
fined by streaming string transducers (SST), which subsume
Reg but are incomparable to PolyReg. For a recent survey,
see [MP19].
These classes are rather well-known and enjoy nice reg-
ularity properties, including being closed under composition
(except for SST which is still closed under post-composition
by Seq) which entails5being 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 one obtain an automaton model correspond-
ing 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, some-
what natural6, computation models which subsume the well-
behaved classes of PolyReg and SST. It should be regularity
preserving and potentially5have 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.
3) 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 au-
tomatic ω-word has a decidable MSO theory (Corollary III.8).
5In Proposition III.3 we see that the two are closely related.
6As opposed to an artificial model like the union of PolyReg with SST.
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 (Proposi-
tion III.7).
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 [BDK18], [Boj18]: we start with simple functions which
are recognizable transductions whose range contains words
of length at most 1only. Then we close the class under
a single type of operator called maplex which works as
follows: maplex fmaps a word uto the concatenation
f(u1)f(u2)...f(un)where u1,...,unare all the labellings
of uover 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 (ATLex). These two characterizations
are actually syntactically equivalent but quite different in
spirit. We leverage the aforementioned correspondence be-
tween automatic ω-words and automatic transduction, as well
as a result of B´ar´any to show that the nesting of maplex
operators generates a strict hierarchy of transduction classes
(Corollary IV.10).
Thirdly, we introduce an automaton model called nested
marble transducers (NMT). Nested marble transducers
are quite expressive: they generalize marble transduc-
ers [EHvB99], [DFG20] which are known to coincide with
SST, they also naturally generalize PolyReg. Informally, a
level knested 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 k−1nested 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 strong closure
properties of NMT: we 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 4). In the other way, trans-
ductions 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 5).
An important step consists in showing that one can remove
the state-passing mechanism in NMT (Theorem 3). 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
2
state-passing.
4) Outline of the paper: Preliminaries on languages and
transductions are given in Section II, we then detail the
definitions of structures and interpretations, as well as their
connection to automatic structures, in Section III. We present
the class of lexicographic transductions in Section IV and
detail examples in Section V. The model of nested marble
transducers is presented in Section VI, its equivalence with
Lex is proven in Section VII, and its closure properties are
detailed in Section VIII. Proof details can be found in the
Appendix.
II. WO RD LA NGUAGE S AND T RAN SD U CT ION S
We let P(X)the powerset of any set X.
a) Words and languages: Given an alphabet Σ, a Σ-word
u(or just word if Σis clear from the context) is a sequence
of letters from Σ. We denote by ǫthe empty word, and by |u|
the length of a word u. In particular |ǫ|= 0. For all integers
n≥0, we let Σn(resp. Σ≤n) be the set of words of length
n(resp. at most n). We let Pos(u) = {1,...,|u|} be the set
of positions of u, and for all i∈Pos(u),u[i]∈Σis the i-th
letter of u. We write Σ∗for the set of words over Σ, and
Σ+for the set of non-empty words. 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.
b) Convolution: Let Σ1,Σ2be two alphabets, ℓ∈Nand
u1∈Σℓ
1, u2∈Σℓ
2be two words of length ℓ. The convolution
of u1and u2is the word of length ℓover Σ1×Σ2denoted u1⊗
u2, such that for all 1≤i≤ℓ,(u1⊗u2)[i] = (u1[i], u2[i]).
c) Finite automata: A (non-deterministic) finite automa-
ton (NFA) over an alphabet Σis denoted as a tuple A=
(Q, q0, F, ∆) where Qis the set of states, q0the initial state,
F⊆Qthe final states, and ∆⊆Q×Σ×Qthe transition
relation. We write qu
−→Aq′when there exists a run of A
from state qto state q′on u, and denote by L(A) = {u∈Σ∗|
q0
u
−→Aqf∈F}the language recognized by A. When Ais
a deterministic finite automaton (DFA), the transition relation
is denoted by a (partial) function δ:Q×Σ⇀ Q.
d) Word transductions: Aword transduction (or just
transduction for short) over Σ,Γtwo alphabets is a (partial)
function f: Σ∗⇀Γ∗. We denote by dom(f)its domain.
Given two transductions f1, f2: Σ∗⇀Γ∗with disjoint
domains, we let f1+f2be the transduction of domain
dom(f1)∪dom(f2)such that (f1+f2)(u) = fi(u)if
u∈dom(fi). Given f: Σ∗⇀Γ∗,g: Γ∗⇀Λ∗, we write
(g f) : Σ∗⇀Λ∗the composition g◦f. Given h: Λ∗⇀∆∗,
(h g f )stands for (h(g f )). For u∈Σ∗, we also write
(h g f u)for (h g f )(u).
A transduction fhas exponential growth if there exists c∈
Nsuch that for all u∈dom(f),|f(u)| ≤ 2c|u|holds. A
transduction fhas polynomial growth if there exists c, k ∈N
such that for all u∈dom(f),|f(u)| ≤ c|u|kholds.
Example II.1 (Reverse and copy).Let Σbe an alphabet. The
transduction rev : Σ∗→Σ∗takes as input any word u=
σ1. . . σnand outputs its reverse σn. . . σ1, for all σi∈Σ. The
transduction copy takes uand returns uu.
Example II.2 (Square).Let Σbe an alphabet and Σ=
{σ|σ∈Σ}. Given a word u=σ1...σnand a position
i∈Pos(u), we let underi(u) = σ1...σi−1σiσi+1 ...σn.
The transduction square : Σ∗→(Σ ∪Σ)∗is defined
as square(u) = under1(u)...under|u|(u). For example
square(abc) = abcabcabc.
Example II.3 (Map).Let Σbe some alphabet and | 6∈ Σbe
some separator symbol. Let Σ|= Σ ∪ {|}. Let f: Σ∗⇀
Γ∗. The transduction map f: Σ∗
|⇀Σ∗
|takes any input
word of the form u=u1|u2|...|unwhere ui∈Σ∗for all
i∈ {1,...,n}, and returns f(u1)|f(u2)|...|f(un)(if all the
f(ui)are defined, otherwise (map f)(u)is undefined.
e) Sequential and rational transductions: Sequential
transductions are transductions recognized by sequential trans-
ducers. A sequential transducer over some alphabets Σand
Γ(not necessarily disjoint), is a pair T= (A, µ)where
A= (Q, q0, F, δ)is a DFA over Σand µ:dom(δ)→Γ∗
is a total function. We write qu/v
−−→Tq′whenever there
exists a sequence of states q1=q, q2,...,qn+1 =q′such
that q1
u[1]
−−→Aq2. . . qn
u[n]
−−→Aqn+1 where n=|u|, and
v=µ(q1, u[1]) . . . µ(qn, u[n]). The transduction fTrecog-
nized by Tis defined for all u∈L(A)by fT(u) = v
such that q0
u/v
−−→ qf∈F. Note that dom(fT) = L(A).
We denote by Seq the class of sequential transductions. Like
sequential transducers, a (non-deterministic, functional) finite
state transducer7is defined as a pair T= (A, µ)but Acan be
non-deterministic, with the functional restriction: for all words
u∈L(A), the outputs of all the accepting runs over uare all
equal. With this restriction, Trecognizes a transduction fT.
Arational transduction is a transduction fTfor some T, and
we denote by Rat the class of rational transductions [HK21].
f) Regular and polyregular transductions: The class of
regular (resp. polyregular) transductions is defined as the
smallest class of transductions which is closed under compo-
sition of transductions and map, and contains the sequential
transductions, copy and rev (resp. the sequential transductions,
rev and square) [BS20], [Boj18]. We denote by PolyReg the
class of polyregular transductions.
III. MSO SE T INT ERP RETATI ON S,PRO P ERT I ES A ND
LI MI TATION S
1) MSO set interpretations:
a) Signatures, formulas and structures: Arelational sig-
nature (or simply signature) is a set Sof symbols together with
a function arity :S → N.
We consider a set of first-order variables denoted by lower
case letter x, y, z , . . . as well as a set of second-order variables
denoted by upper case letter X , Y, Z . . .. The MSO-formulas
over signature S, denoted by MSO[S]are given by the
following grammar φ::=
∃xφ | ∃Xφ |φ∧φ| ¬φ|X(x)|R(x1,...,xr)
7This class is also called real-time finite state transducers in the literature.
3
where x, x1,...,xrare first-order variables, Xis a second-
order variable and R∈ S with arity(R) = r. We denote by
FO[S]the formulas which don’t use second-order variables.
Arelational structure uover signature Sis a set Ucalled
the universe of the structure, together with, for each symbol
R∈ S of arity r, an interpretation denoted Ruwhich is a
subset of Ur.
b) Regularity preserving: A function from S-structures
to T-structures is called regularity preserving if the inverse
image of an MSO[T]definable set is MSO[S]definable. We
say that a class of functions is regularity preserving if all
functions in the class are.
c) Word structures: The word signature over Σis the
tuple SΣ= ((σ(x))σ∈Σ,≤(x, y)) where σ(x)are unary
predicate symbols and ≤(x, y), usually written x≤y, is
a binary predicate symbol. Any word ucan be naturally
associated with an SΣ-structure ˜u= (U, (σ˜u)σ∈Σ,≤˜u)where
U=Pos(u),σ˜uis a set of positions labeled σ, for all
σ∈Σ, and ≤˜uis the natural (linear) order on Pos(u). We
write uinstead of ˜uif it is clear from the context that uis
an SΣ-structure. A word structure over Σis an SΣ-structure
isomorphic to some ˜u. Note that being a word structure is FO
definable.
d) MSO set interpretations: We define MSO set inter-
pretations as in [CL07].
Definition III.1. An MSO set interpretation (MSOSI)Tfrom
S-structures to T-structures, is given by
•k∈N\ {0}called the dimension,
•a domain formula φdom ∈MSO[S],
•an output universe formula φuniv(X)∈MSO[S],
•for each relation symbol R∈ T of arity ra formula
φR(X1,...,Xr)∈MSO[S]
where X, X1,... are k-tuples of variables.
We now define the semantics of Twhich is a partial
transduction fTfrom S-structures to T-structures. The domain
of fTis the set of structures usuch that u|=φdom. Given
such a uwith universe U, we define its image v=fT(u):
•The universe of vis the set V={P∈ P (U)k|u|=
φuniv (P)},
•for R∈ T of arity r,Rv={(P1,...,Pr)∈Vk|u|=
φR(P1, . . . , Pr)}.
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 III.2. Given an MSOSI from SΣ-structures to SΓ-
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.
e) 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 φuniv , 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 (roughly8speaking) an MSO
interpretation of dimension 1.
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 1. [CL07, Proposition 2.4] MSO set interpretations
are effectively closed under pre-composition by MSOT and
post-composition by FOI.
2) Properties of word-to-word set interpretations:
a) Exponential versus polynomial growth: There is a
dichotomy for the growth of set interpretations defined over
words, deeply connected to the similar dichotomy for the
ambiguity of automata, between exponential growth and poly-
nomial growth. Moreover for polynomial growth transduc-
tions, the level of growth exactly coincides with the minimum
dimension of an MSOSI defining the transduction. The result
can be obtained in the more general case of trees.
Theorem 2. [GLN25, Theorem 1.5], [Boj23, Theorem 2.3]
A set interpretation over words has growth either 2Θ(n), or
Θ(nk)for some k∈N, and this can be computed in PTIM E.
In the latter case9, one can compute an equivalent MSOI of
dimension k.
Quite a lot is known about word-to-word set interpretations
with polynomial growth, which are called polyregular trans-
ductions and enjoy many different characterizations [BKL19,
Theorem 7].
b) 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 III.3. 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 ma-
chines,
•The class of word-to-word MSOSI is closed under post-
composition with polyregular transductions.
3) Automatic transductions: We describe an automata-
based presentation of MSOSI, which we call automatic trans-
ductions. This presentation has two main advantages: firstly it
is more amenable to efficient processing, as it is based on
automata instead of MSO. Secondly it makes the connection
between automatic structures and set interpretations more
obvious.
8Classically, one adds a bounded number of copies of the input to get the
full class of MSOT.
9Note that to get this tight correspondence, we need to allow a bounded
number of copies of the input, see [GLN25, Definition 4.3].
4
Definition III.4. An automatic transduction (AT for short)
from Σ∗to T-structures is described as a tuple T=
(Σ, B, Adom , Auniv,(AR)R∈S )where:
•Bis a finite alphabet describing a work alphabet
•Adom is an automaton over Σrecognizing the domain of
the transduction,
•Auniv is an automaton over Σ×Bdescribing the possible
configurations,
•for each R∈ S of arity r,ARis an automaton over
Σ×Brdescribing tuples of the relation R.
Semantics Given a word u∈Σ∗, the output T-structure v=
fT(u)is defined, whenever u∈L(Adom), as follows:
•its universe is the set V={x∈B∗|u⊗x∈L(Auniv )},
•a predicate symbol R∈ T of arity ris interpreted as:
Rv={(x1,...,xr)∈Vr|u⊗x1⊗...⊗xr∈L(AR)}.
Remark III.5.
•Automatic transductions are essentially identical to
MSOSI, except restricted to input word structures, where
one can leverage the classical equivalence between MSO
and automata.
•Automatic transductions can be naturally generalized to
work over input structures such as ω-words, trees and
infinite trees, giving rise 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 aω.
4) Transduction/structure correspondence: Here we give
a rather natural correspondence between word-to-word auto-
matic transductions and automatic ω-words.
We use definitions inspired from [B´ar08]. We extend the
convolution operation to words of different lengths by adding
a padding symbol to the right of the shortest word until the
lengths match.
Definition III.6. An automatic structure over the signature T
is given by a tuple S= (B , Auniv,(AR)R∈S ),Auniv is an au-
tomaton over alphabet Band for R∈ S of arity r,ARis an au-
tomaton over the alphabet (B∪ { })r. The structure uassoci-
ated with Shas universe U=L(A), the interpretation of R∈
Sis the set Ru={(x1,...,xr)∈Vr|x1⊗ · · · ⊗ xr∈LR}.
An automatic structure which is an ω-word structure over some
alphabet is called an automatic ω-word.
a) Length monotonous: An automatic presentation of an
ω-word is length monotonous if shorter words always appear
before longer words with respect to the linear order. It turns
out that any automatic ω-word can be presented in a length
monotonous way: this is done by adding an extra padding
letter ♯, and padding any word vwith enough symbols so that
it is longer than any word appearing before in the order. The
proof of this is rather simple and left to the reader. In the
following, we shall assume that all automatic presentations of
ω-words are length monotonous.
Given a total transduction over a unary alphabet f:a∗→
Σ∗, we define its product Πf=f(ε)·f(a)·f(aa)···. Note
that Πfmay be a finite word.
Proposition III.7. There is a one-to-one correspondence be-
tween length monotonous automatic presentations of ω-words
and total automatic transductions from finite words over a
unary alphabet to finite words. Moreover, when an automatic
ω-word wcorresponds to a function f, then w= Πf.
Proof. Let S= (Auniv,(Aσ)σ∈Σ, A≤)be a length
monotonous automatic presentation of a word w. Since S
is length monotonous, we only care about the part of A≤
which reads letters over B×B, and we define A′
≤the
automaton obtained by removing transitions which use a
padding symbol.
We define the automatic transduction over {a},T=
(⊤, Auniv,(Aσ)σ∈Σ, A′
≤)realizing a transduction f. By con-
struction, w= Πf.
Conversely, let T= (⊤, Auniv,(Aσ)σ∈Σ, A≤)realize a
total transduction f:{a} → Σ∗. If A≤is over B×B,
we extend it to an automaton A≤in a length monotonous
way to convolutions of words of possibly different lengths.
Again by construction the automatic ω-word wpresented by
S= (Auniv,(Aσ)σ∈Σ, A′
≤)satisfies w= Πf.
The two constructions are indeed inverse of each other.
We can now prove that if Conjecture 2 holds then Conjec-
ture 1 also holds.
Corollary III.8. If word-to-word MSOSI are regularity pre-
serving, then automatic ω-words have a decidable MSO
theory10.
Proof. Assume that word-to-word MSOSI are regularity pre-
serving. Let u∈Σωbe an automatic ω-word and let L⊆Σω
be a regular language. We define f:{a}∗→Σ∗the automatic
transduction given by Proposition III.7.
Let Abe a B ¨uchi automaton recognizing L, let Qbe the
set of states, q0the initial state and F⊆Qbe the set of
accepting states. For p, q ∈Q, we define L1
p,q the set of finite
words which have a run from pto qvisiting at least one final
state and L0
p,q the set of finite words which have a run from
pto qvisiting no final state. We define a formula which starts
with a block of existential quantification over variables Xb
p
with p∈Qand b∈ {0,1}. The idea is that an integer xwill
belong to Xb
pif there is a run of Aover Πi≤xf(ai)which
ends in state pand sees at least bfinal state after having read
Πi<xf(ai). The formula will be a conjunction of four parts:
firstly all the Xb
p’s are pairwise disjoint. Secondly there is a p
and an infinite set of positions xsuch that X1
p(x)holds. The
third part is here to ensure that for the minimal x, if Xb
p(x)
then f(a1)∈Lb
q0,p can reach state pby visiting at least b
final states. It is a conjunction for all p∈Q,b∈ {0,1}of
∀x(Xb
p(x)∧∀y x ≤y)→f(a)∈Lb
q0,p. Here f(a)∈Lb
q0,p is
simply a boolean which can be computed. The last part of the
formula will be the conjunction for all p, q ∈Q,b, c ∈ {0,1}
of ∀x Xb
p(x)∧Xc
q(x+ 1) →f(ax)∈Lc
p,q. The fact that
10One could actually prove the stronger implication that any automatic ω-
word has a canonical presentation, as in [B´ar08].
5
f(ax)∈Lc
p,q is definable in MSO comes from the assumption
that MSOSI are regularity preserving.
We have transferred an MSO property of uto an MSO
property of (N, <), which is decidable.
IV. LEX ICO GRA PH IC TR ANS DUC TIO NS
As we have seen in the latter section, we do not know
whether MSOSI are regularity preserving, and as a conse-
quence of Corollary III.8, proving that it enjoys this property
would prove a long-standing conjecture of the theory of
automatic structures. In this section, we introduce a subclass
of MSOSI transductions which enjoys this property, called
lexicographic transductions.
1) 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
(paragraph IV-2), via a corresponding subclass of automatic
transductions.
Simple transductions: Aregular constant (partial) trans-
duction of type Σ∗⇀Γ∗can be denoted by an expression of
the form L⊲w, where Lis a regular language over Σand wis a
word in Γ∗, such that for all u∈Σ∗,(L⊲w)(u)is defined only
if u∈L, by (L⊲w)(u) = w. A simple transduction11 fis a
finite union of regular constant transductions whose codomain
only contains words of length at most 1. A simple transduction
f: Σ∗⇀Γ∗is denoted by f=Pn
i=1 Li⊲wisuch that
L1,...,Ln⊆Σ∗are pairwise disjoint regular languages, and
w1,...,wn∈Γ≤1.
Lexicographic enumerators: An ordered alphabet is a
pair λ= (B, ≺)such that Bis finite set and ≺is a linear order
over B. The order ≺is extended lexicographically (using the
same notation) to words of same length over B, with most
significant letter to the right: for all nand all u, v ∈Bn,
u≺vif there exists a position i≤nsuch that u[i]≺v[i]
and for all i < j ≤n,u[j] = v[j]. Note that ≺is a total
order over Bn, for all n. We denote succλ:B∗⇀ B∗the
successor function on B∗induced by ≺.
We recall that |is a fixed separator symbol. The λ-
lexicographic enumerator is the function lex-enumλ:
SΣ,Γalphabets Σ∗→((Σ ×B)∗|)∗
w7→ (w⊗u1)|(w⊗u2)|...|(w⊗uk)
where |w|=|u1|=··· =|uk|,u1is minimal for ≺,ukis
maximal for ≺and for all 1≤i < k,ui+1 =succλ(ui).
Note that k=|B||w|.
Example IV.1. Let Σ = {a, b}let λ= (B, ≺)be a finite
order with B={0,1}and 0≺1. For all σ∈Σand b∈B,
we write σ
binstead of (σ, b)and Σ
bto denote the set of pairs
(σ, b)for all σ∈Σ. Then lex-enumλ(abb) =
a
0b
0b
0|a
1b
0b
0|a
0b
1b
0|a
1b
1b
0|a
0b
0b
1|a
1b
0b
1|a
0b
1b
1|a
1b
1b
1
11It is a restriction of the known class of recognizable transduction to output
words of length at most 1.
MapLex combinator: Let λ= (B , ≺)be an ordered
alphabet. We define the function
maplexλ:SΣ,Γalphabets((Σ ×B)∗→Γ∗)→Σ∗→Γ∗
such that for all Σ,Γalphabets, all f: (Σ ×B)∗→Γ∗and
u∈Σ∗,
maplexλf u =f(v1)f(v2)...f(vk)
where lex-enumλ(u) = v1|v2|...|vk. Note that uis in the
domain of maplexλfif and only if v1,...,vkare all in the
domain of f. We write maplex when ≺is clear from the
context.
Definition IV.2 (Lexicographic transductions).Lexicographic
transductions, denoted by Lex, are defined inductively by
Lex0the class of simple transductions and Lexk+1 =
{maplexλf|f∈Lexk, λ ordered alphabet}.
Example IV.3 (Identity and Reverse).Take λ= (B, ≺)and
λ′= (B, ≺′)with B={0,1},0≺1, and 1≺′0. For all
σ∈Σ, let Lσ= ( Σ
0)∗(σ
1)( Σ
0)∗and Lǫ= (Σ×B)∗\(SσLσ).
id =maplexλ(Lǫ⊲ǫ +Pσ∈ΣLσ⊲σ)
rev =maplexλ′(Lǫ⊲ǫ +Pσ∈ΣLσ⊲σ)
This is illustrated below on input abc, with the output of
the simple function below every word of the enumeration.
id a
0b
0c
0
|{z}
ǫ
|a
1b
0c
0
|{z}
a
|a
0b
1c
0
|{z}
b
|a
1b
1c
0
|{z}
ǫ
|a
0b
0c
1
|{z}
c
|a
1b
0c
1
|{z}
ǫ
|a
0b
1c
1
|{z}
ǫ
|a
1b
1c
1
|{z}
ǫ
rev a
1b
1c
1
|{z}
ǫ
|a
0b
1c
1
|{z}
ǫ
|a
1b
0c
1
|{z}
ǫ
|a
0b
0c
1
|{z}
c
|a
1b
1c
0
|{z}
ǫ
|a
0b
1c
0
|{z}
b
|a
1b
0c
0
|{z}
a
|a
0b
0c
0
|{z}
ǫ
Several other examples are given in Section V.
Lemma IV.4. For all f∈Lex, its domain dom(f)is regular.
Proof. Observe that any Lex transduction f: Σ∗⇀Γ∗
is equal to maplexλ1(maplexλ2... (maplexλns)...)for
some n≥0, some ordered alphabets (λi= (Bi,≺i))iand
some simple transduction s: (Σ ×B1× · · · × Bn)∗⇀Γ∗.
Then, fis defined on u∈Σ∗iff for all 1≤i≤nand
all bi∈B|u|
i,s(u⊗b1⊗ · · · ⊗ bn)is defined. Now, observe
that dom(f)is the complement of the Σ-projection of the
complement of dom(s). This entails the result as dom(s)is
regular and regular languages are closed under morphisms (and
complement).
2) Presentation as automatic transductions: We give an al-
ternative presentation in terms of automatic transductions. Let
k≥1be a positive integer, and λ= ((B1,≺1),...,(Bk,≺k))
be a k-tuple of ordered alphabets and let B=B1×···×Bk.
We define the associated k-lexicographic order for words of
the same length over B∗by u≺λvif u=u1⊗ · · · ⊗ uk,
v=v1⊗· · ·⊗vk, and there is i∈ {1,...,k}such that ui≺ivi
and for all j < i,uj=vj.
Definition IV.5. Let λ= ((B1,≺1),...,(Bk,≺k)) be a k-
tuple of ordered alphabets, let B=B1× · · · × Bkand let ≺λ
be the associated k-lexicographic order.
6
Ak-lexicographic automatic transducer over the alphabet
Bis an automatic transducer with work alphabet Bsuch that
the order is exactly ≺λ. A transduction is said k-lexicographic
automatic if it can be defined by a k-lexicographic automatic
transducer. We denote by ATk-Lex the class of k-lexicographic
automatic transductions and by ATLex the union of these, which
we call lexicographic automatic transductions.
The next proposition is rather immediate (Appendix. B-1).
Proposition IV.6 (ATk-Lex =Lexk).For all k≥1, a trans-
duction is k-lexicographic iff it is k-lexicographic automatic.
Now, we make a connection between k-lexicographic au-
tomatic transductions and k-lexicographic automatic ω-words.
As a consequence of the latter proposition and known results
from the literature of automatic words, this connection allows
us to prove that k-lexicographic transductions form a strict
hierarchy (Corollary IV.10).
Definition IV.7. Let λ= ((B1,≺1),...,(Bk,≺k)) be a k-
tuple of ordered alphabets, let B=B1× · · · × Bkand let
≺λbe the associated k-lexicographic order. A k-lexicographic
automatic presentation of a word is an automatic presentation
over the alphabet B1× · · · × Bk. such that the order over B∗
is exactly the length monotonous extension of ≺λ.
Our definition differs slightly from the one of [B´ar08],
where instead of considering a product of kalphabets, the
author considers positions modulo k. There is however a
simple correspondence between the two definitions which is
made clear by the normal form lemma in [B´ar08, Lemma 4.5].
Proposition IV.8. For all k≥1, there is a one-to-one cor-
respondence between k-lexicographic automatic presentations
of ω-words and total k-lexicographic automatic transductions
from finite words over a unary alphabet to finite words.
Moreover, when an automatic ω-word wcorresponds to a
function f, then w= Πf.
Proof. The proof is the same as the proof of Proposition III.7.
The constructions of the order automata (which amounts
to allowing words of different lengths or not) preserve the
property of being k-lexicographic.
As a consequence, we can show that the ATk-Lex form a
strict hierarchy:
Corollary IV.9. For all k≥1,ATk-Lex (ATk+1-Lex .
Proof. This is a consequence of Proposition IV.8 and the
strictness of the hierarchy of k-lexicographic automatic ω-
words given in [B´ar08, Theorem 6.1]
Corollary IV.10. For all k≥1,Lexk(Lexk+1.
Proof. From Corollary IV.9 and Propositions IV.8,IV.6.
V. E X AM PLE S
In this section, we provide a series of examples of lexico-
graphic transductions.
Example V.1 (Morphisms).Let φa:u∈ {a, b}∗→a∗be
the morphism defined by φa(a) = aand φa(b) = ǫ. We have
φa∈Lex1. It suffices to take B={0,1}with 0≺1. Then,
let La= ( Σ
0)∗(a
1)( Σ
0)∗, and Lǫ=La. Then:
φa=maplex (La⊲a +Lǫ⊲ǫ)
More generally, if ψ: Σ∗→Γ∗is an arbitrary morphism, we
show that ψ∈Lex1. 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 M=maxσ∈Σ|ψ(σ)|. If M= 0, then
ψis the constant transduction which outputs ǫ, so ψ∈Lex0.
Otherwise, let λM= (BM, <)with BM={0,1,...,M}
naturally ordered. Let I: Γ →2Σ×Nsuch that for all γ∈Γ,
I(γ)is the set of pairs (σ, i)such that ψ(σ)[i] = γ. Note that
for all γ∈Γ,I(γ)⊆Σ× {1,...,M}. Define Lγas the set
given by the regexp
[
(σ,i)∈I(γ)
(Σ
0)∗(σ
i)( Σ
0)∗
and Lǫthe complement of the union of all Lγ. Then
ψ=maplexλM(Lǫ⊲ǫ +X
γ∈Γ
Lγ⊲γ).
Using similar ideas, the latter example can be generalized
to sequential transductions (see Appendix B-2).
Lemma V.2. Seq ⊆Lex1.
Example V.3 (Domain restriction).Let k≥0. Given f:
Σ∗→Γ∗a transduction in Lexkand L⊆Σ∗a regular
language, the transduction frestricted to L, written f|L:u7→
f(u)if u∈dom(f)∩Lis in Lexk. We show this inductively
on k: it is clear for f∈Lex0. Assume f=maplexλgwith
λ= (B, ≺)and let πΣ: (Σ ×B)∗→Σ∗be the natural
projection morphism. Then f|L=maplexλg|π−1
Σ(L), which
proves that Lexkis closed under domain restriction.
Example V.4 (List of prefixes).Let pref : Σ∗→Σ∗such that
pref(u) = v1v2...vkwhere each v1,...,vkare successive
prefixes of uof decreasing length. For example, pref(abcd) =
abcd.abc.ab.a. We show that pref ∈Lex1. We take λ= (B, ≺
)with B={0,1}with 0≺1. Consider a fixed word 1jfor
some j, and some i≥0. Let Wi,j be the set of words of
length i+jin the language 1∗0+1j. We have |Wi,j|=i
and all the words in Wi,j are lexicographically ordered as
0i1j≺10i−11j... ≺1i−101j. Moreover, lexicographically,
all words in Wi,j are smaller than those in Wi,j +1. From this
observation, we define the following simple transduction: if the
B-annotation of the input word uis in 1∗0+1∗, then the simple
transduction produces the label of ualigned with the leftmost
0, otherwise it outputs ǫ. E.g., suppose the input word is abc.
The lexicographic enumeration together with the production
(above the arrows) is:
000 a
−→ 100 b
−→ 010 ǫ
−→ 110 c
−→ 001 a
−→ 101 b
−→ 011 a
−→ 111 ǫ
−→
7
More generally, let Lσ= ( Σ
1)∗(σ
0)( Σ
0)∗(Σ
1)∗and Lǫthe
complement of SσLσ. Then
pref = (maplexλ(Lǫ⊲ǫ +X
σ∈Σ
(Lσ⊲σ +Lǫ⊲ǫ))
Now, consider the transduction pref#which also adds
a separator between prefixes. For example pref#(abc) =
abc#ab#c#. To account for this separator, we take λ′=
({0,1,2}, <)with the natural order. Note that the lexico-
graphic successor of any annotation of the form 2i01jis the
annotation in 0i1j+1 . Also note that for all n, there are exactly
nannotations of length nin 2∗01∗. The simple transduction
we now define produces the separator #on those annotations.
On annotations which contains only 0and 1, it behaves as
the simple transduction of pref. On all other annotations, it
outputs ǫ. Formally, let L#= ( Σ
2)∗(Σ
0)( Σ
1)∗, and for all σ,
Lσis defined as before, and finally Lǫis the complement of
the union of all those languages. Then:
pref#= (maplexλ′(L#⊲# + X
σ∈Σ
Lσ⊲σ +Lǫ⊲ǫ)
To conclude, we have shown that pref,pref#∈Lex1.
Example V.5 (Subwords).Let sub : Σ∗→Σ∗be the
transduction which enumerates all the subwords of a word in
lexicographic order (with rightmost significant bit). For exam-
ple sub(abc) = a.b.ab.c.ac.bc.abc. We show that sub ∈Lex2.
We take λ= (B, <), with B={0,1}and define the following
morphism del0: (Σ ×B)∗→Σ∗by del0(σ, 0) = ǫand
del0(σ, 1) = σ.
sub =maplexλdel0
From Example V.1, morphisms are in Lex1, so sub ∈Lex2.
Example V.6 (Square).The transduction square has been
defined in Ex. II.2. We show that square ∈Lex2. Let λ=
(B, <)with B={0,1}and let f: (Σ ×B)∗→(Σ ∪Σ)∗
such that for all u∈Σ∗of length n, for all 1≤i≤n,f(u⊗
(0i−110n−i)) = underi(u), and for b6∈ 0∗10∗,f(u⊗b) = ǫ.
It holds that square =maplexλf, because 0i−110n−i<
0j−110n−jfor all i < j. It remains to show that f∈Lex1.
It is because f=maplexλgfor g: (Σ ×B2)∗→Σ∗the
following simple transduction: for all u⊗b1⊗b2∈(Σ ×B2)∗,
if b16∈ 0∗10∗or b26∈ 0∗10∗,g(u⊗b1⊗b2) = ǫ, otherwise
let ibe the unique position at which 1occurs in b1and j
the unique position at which a 1occurs in b2. If i=j, then
g(u⊗b1⊗b2) = u[j], otherwise g(u⊗b1⊗b2) = u[j]. Since
those properties are regular, gis a simple transduction. It is
illustrated on Fig. 1.
VI. NE S TED M ARBLE T R AN SDU CER S
We introduce in this section a transducer model, called
nested marble transducers, and show in Section VII that the
class of transductions it recognizes is exactly the class of lexi-
cographic transductions. Nested marble transducers generalize
marble transducers [EHvB99], [DFG20]. A marble transducer
belongs to the family of transducers with an unbounded num-
ber 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 k≥1behaves like a marble transducer
which can call, when reading the leftmarker ⊢, a nested marble
transducer of level k−1. A nested marble transducer of level
0is 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 VI.1 (Simple transducers).Let Σ,Γbe finite sets
(not necessarily disjoint). A (Σ,Γ)-simple transducer is a pair
T= (A, µ)where A= (Q, q0, F, δ :Q×(Σ ∪ {⊢,⊣})⇀ Q)
is a DFA and µ:F→Γ≤1is a total function.
We define two semantics for T, an operational semantics
fop
T:Q×Σ∗⇀Γ∗×Fwhich 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 fop
Tis not defined. Formally, fop
T(q, u)
is defined for all usuch that q⊢u⊣
−−→Aqffor some qf∈F,
by fop
T(q, u) = (µ(qf), qf).
From the operational semantics, we also define the trans-
duction fT: Σ∗⇀Γ∗recognized by Tas the transduction
which applies the operational semantics from the initial state,
and projects away the final state, i.e. fT(u) = π1(fop
T(q0, u)),
where π1is the projection on the first component.
Definition VI.2 (Nested marble transducers from Σto Γ).A
(0,Σ,Γ)-nested marble transducer is a (Σ,Γ)-simple trans-
ducer. For k≥1, a (k, Σ,Γ)-nested marble transducer is a
tuple T= (Σ,Γ, C, c0, QT, q0, FT, δ, δcall, δr, µ, T ′)where:
•Cis a finite set of (marble) colors, c0is an initial color;
•QTis a finite set of states, q0is an initial state, and FT
a set of accepting states;
•T′is a (k−1,Σ×C, Γ)-nested marble transducer with
set of states QT′and set of accepting states FT′;
•δ:QT×(Σ∪{⊣})×C→(C∪{⊥})×QTis a transition
function;
•δcall :QT×C→QT′is a call function;
•δret :QT×C×FT′→QTis a return function;
•µ:dom(δ)→Γ∗is an output function.
We use (k, Σ,Γ)-NMT (or just k-NMT if Σ,Γare clear
from the context) as a shortcut for (k, Σ,Γ)-nested marble
transducer. T′is the assistant NMT and kthe level of T.
Finally, we often say marble instead of marble colour.
We now define the semantics informally. The reading head
of Tis initially placed on the rightmost position labeled ⊣,
marked with a marble of color c0, in state q0. Transitions work
as follows: suppose the current state is qand the reading head
is on some position ilabeled by σ∈Σ∪ {⊣,⊢} and by
some marble of color c∈C. Whatever transition in δcan be
applied, some output word is produced by Taccording to µ.
Then there are three cases:
8
a
0
0
b
0
0
|{z}
ǫ
|a
0
1
b
0
0
|{z}
ǫ
|a
0
0
b
0
1
|{z}
ǫ
|a
0
1
b
0
1
|{z}
ǫ
|a
1
0
b
0
0
|{z}
ǫ
|a
1
1
b
0
0
|{z}
a
|a
1
0
b
0
1
|{z}
b
|a
1
1
b
0
1
|{z}
ǫ
|a
0
0
b
1
0
|{z}
ǫ
|a
0
1
b
1
0
|{z}
a
|a
0
0
b
1
1
|{z}
b
|a
0
1
b
1
1
|{z}
ǫ
|a
1
0
b
1
0
|{z}
ǫ
|a
1
1
b
1
0
|{z}
ǫ
|a
1
0
b
1
1
|{z}
ǫ
|a
1
1
b
1
1
|{z}
ǫ
Fig. 1: Equality square = (maplexλmaplexλg)illustrated on input ab, with the results of applying gunderneath.
1) if σ∈Σ∪ {⊣} and δ(q, σ, c) = (c′, q′)where c′∈C,
then the reading head moves to position (i−1) in state q′
and a marble of color c′is placed (on position i−1);
2) if σ∈Σand δ(q, σ, c) = (⊥, q′), then Tlifts the current
marble and moves its reading head to position i+ 1 in
state q′;
3) if σ=⊢then Tcalls T′initialized with state δcall(q, c),
on the input word annotated with marbles. When T′
finishes its computation in some accepting state q′,T
lifts marble c, moves its reading head to position 1and
continues its computation from state δret(q, c, q′).
The (operational) semantics of Tis a function fop
T:
QT×Σ∗→Γ∗×FT, that we define inductively. The case
k= 0 has been defined after Definition VI.1. If k≥1
and T= (Σ,Γ, C, c0, QT, q0, FT, δ, δcall, δret , µ, T ′)then we
assume fop
T′:QT′×(Σ ×C)∗→Γ∗×FT′to be defined
inductively. Let us now define fop
T. A configuration of Tover a
word u∈Σ∗is a triple (q, i, v )such that qis the current state,
i∈Pos(u)∪{0, n +1}is the current position (where n=|u|),
and v∈C∗is an annotation of the suffix (⊢u⊣)[i:n+1]. We
define a labeled successor relation (q , i, cv)w
−→T(q′, i′, v′),
between any two configurations where c∈C, labeled by
w∈Γ∗, whenever one of the following cases hold:
1) 1≤i≤n+ 1,δ(q, c) = (c′, q ′),i′=i−1,v′=c′cv and
w=µ(q, c);
2) 1≤i≤n,δ(q, c) = (⊥, q′),i′=i+ 1,v′=vand
w=µ(q, c);
3) i= 0,fop
T′(δcall(q, c),(⊢u⊣)⊗cv) = (w, p),q′=
δret(q, c, p),i′= 1 and v′=v.
The function fop
T:QT×Σ∗⇀Γ∗×FTrecognized by Tis
defined, for all q∈QTand all u∈Σ∗such that there exists
a sequence of configurations over u:
ν0= (q, n + 1, c0)w1
−−→Tν1
w2
−−→Tν3...νk−1
wk
−−→Tνk
where the state qfof νkis accepting (i.e. in F) and the states
of configurations νi,i < k, are non-accepting, by fop
T(q, u) =
(w1...wk, qf).
The transduction fT: Σ∗⇀Γ∗recognized by Tis defined
as the projection of fop
T(q0, u)on Σand Γ,i.e. if fop
T(q0, u) =
(v, qf)then fT(u) = v. We denote by NMT the class of
transductions recognizable by some (k , Σ,Γ)−NMT. 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 NMT of lower
level it calls. We define the number of (resp. local number of)
states/marbles/transitions similarly.
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 δcall and
δret to adapt a classical product construction of automata.
Lemma VI.3 (Seq ◦NMT ⊆NMT).For all k≥0, all
(k, Σ,Γ)-NMT Tand all sequential transducer Sover Γ,Λ,
one can construct, in polynomial time, a (max(k, 1),Σ,Λ)-
NMT T′such that fT′=fS◦fT.
1) 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 kto level
k−1through the function δcall, and state information can
be passed from level k−1to level kvia the function δret .
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 k-NMT, however at the cost of increasing the size
by a tower of exponentials of height k. While state-passing
was useful to prove the closure under post-composition with
sequential transductions (Lemma VI.3), it will be more conve-
nient to consider state-passing free nested marble transducers
in the sequel, in particular to prove that NMT recognize
lexicographic transductions (Section VII).
Definition VI.4. Astate-passing free (k, Σ,Γ)-nested marble
transducer ((k, Σ,Γ)-NMTspf for short), is either a simple
transducer if k= 0, or, if k > 0, a (k, Σ,Γ)-NMT T=
(Σ,Γ, C, c0, QT, q0, F, δ, δcall, δret , µ, T ′)such that
1) T′is a (k−1,Σ×C, Γ)-NMTspf with set of states QT′
and initial state q′
0
2) δcall(q, c) = q′
0for all q∈QTand c∈C
3) δret(q, c, q′) = qfor all q∈QT, c ∈Cand q′∈QT′
4) calls to the assistant transducer T′always accept.
Since the functions δcall and δret play no role, we often omit
them in the tuple denoting T.
Theorem 3 (State-passing removal).For all k-NMT T, there
exists an equivalent k-NMTspf T′whose size is k−EXP in
that of T. This non-elementary blow-up is unavoidable.
Before proving this result, we show a property on domains
of NMT. A nested marble automaton Aof level kis a nested
marble transducer Tof level kwhose output function µis the
constant function which always returns ǫ. The language of A
is defined as L(A) = dom(fT).
Lemma VI.5. A language is recognizable by a nested marble
automaton of level kand nstates iff it is regular iff it is
recognizable by a finite automaton of size in k-EXP(n). This
non-elementary blow-up is unavoidable.
9
Proof sketch. It is clear that any regular language is the
domain of some simple transduction. Conversely, let Abe a
nested marble automaton of level k. If k= 0, it is obvious.
If k≥1, let A= (Σ, C, c0, QA, q0, F, δ, δcall, δret, A′)where
A′has level k−1(in the tuple, we have omitted the output
alphabet and function, since they play no role). By induction
hypothesis, for all pairs (qc, qr)of states of A′, the language
of words accepted by A′by a run starting in qcand ending in
qris regular, and can be described by some finite automaton
Dqc,qrof size in (k−1)-EXP(n).
We turn Ainto a marble automaton B(of level 1) such that
L(B) = L(A). The marbles of Bare enriched with informa-
tion on the states of automata Dqc,qr, for all pairs (qc, qr),
ensuring that Bknows the state of all the automata Dqc,qr
after reading the current suffix. Thanks to this information, B
can simulate Aand whenever Acalls A′with some initial
state qc, instead, Bknows, if it exists, the state qrof A′such
that the current marked input is accepted by A′
qc,qr. If such
a state exists, then it is unique as A′is deterministic, and B
can bypass calling A′and directly apply its return transition.
If such a state does not exist, Bstops.
The result follows as marble automata are known to recog-
nize 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. [EHvB99], [DFG20],
as well as Theorem 5.4 of [KS81] for a detailed construction),
yielding a tower of k-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 r, 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 r[FG04]. Details can be found in Appendix C-2.
Corollary VI.6. Transductions recognized by nested marble
transducers have regular domains.
We are now ready to sketch the proof of Theorem 3 (see
Appendix C-3 for details).
Proof sketch of Theorem 3. There are two kinds of state-
passing, through functions δcall and δret. We deal with them
separately. First, removal of δcall can be done by enriching
marbles with the current state, so as to pass this information
to the assistant transducer. Removal of δret is more involved,
but can be done by induction using a technique similar to the
one used to prove Lemma VI.5. 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 VI.5. Hence, one can enrich the marbles so as to
precompute the final state reached by the assistant transducer,
and in turn simulate the function δret. 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 Sis recognizable by a finite automaton of exponential
size. Indeed, the calls to assistant transducers always terminate,
so the domain of Sdoes 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 S. Thus, the existence of an elementary
construction for state-passing removal would contradict the
non-elementary blow-up stated in Lemma VI.5.
VII. NE STE D MA RBL E TRA NS DUC ERS C APT URE T HE
CL AS S OF LE X IC OGR AP H IC T R AN SDU CTI ONS
In this section, we prove (Theorems 4 and 5) that a
transduction is recognizable by a nested marble transducer of
level kiff it is k-lexicographic.
1) Lexicographic transductions are recognized by nested
marble transducers: Consider some transduction f∈LEXk.
Then f=maplexλ1(maplexλ2...maplexλks)...)for some
λi= (Bi,≺i)and sa simple transduction. We call B1,...,Bk
the ordered alphabets of fand sthe simple transduction of f.
Given an ordered alphabet (B , ≺), one can enumerate the
annotations of a word according to the lexicographic extension
using a marble automaton. By induction, we show:
Theorem 4 (Lex ⊆NMT).Any transduction f∈Lexkis
recognizable by some NMT Tfof level k. If B1,...,Bkare
the ordered alphabets of fand sits simple transduction,
represented by a sequential transducer with mstates, then
Tfhas O(k+m)states and Pk
i=1 |Bi|marbles.
2) Nested marble transducers recognize Lex transductions:
Conversely, we prove that the transductions recognized by
NMTspf are lexicographic.
Theorem 5 (NMTspf ⊆Lex).Any transduction frecogniz-
able by some NMTspf Tof level kis k-lexicographic.
Proof sketch. The proof is rather involved. We provide high
level arguments, but full details can be found in Appendix D-2.
The result is shown by induction on k. It is trivial for k= 0.
For k > 0, the main idea is to see the sequence of succes-
sive configurations of Ton some input as a lexicographic
enumeration. This is possible due to the stack discipline of
marbles. In particular, by extending the marble alphabet with
sufficient information, it is possible to define a total order on
marbles such that the sequence of successive configurations of
T, extended with this information, forms a lexicographically
increasing chain.
More precisely, since lexicographic functions only produce
their output at the bottom level,i.e. at the level of simple
functions, we first turn Tinto an equivalent bottom producing
transducer, where only its simple transducer is allowed to pro-
duce outputs. Then, we observe that the behaviour of a nested
marble transducer is inherently lexicographic. To see this, let
⊢u⊣be some input word such that u∈dom(f). Consider
a configuration of Twhere the reading head is on ⊢,i.e. a
configuration of the form ν= (q, 0, v)∈Q×Pos(⊢u⊣)×C∗,
reachable from the initial configuration. For any input position
i, denote by lastν(i)the last state in which Twas at position
ibefore reaching ν.
10
Now, consider two configurations ν1= (q1,0, v1), ν2=
(q2,0, v2)on ⊢u⊣reachable from the initial configuration. It
can be proved that ν1→∗
Tν2iff there exists a position i
such that (1) for all positions j≥i,lastν1(j) = lastν2(j)
and v1[j] = v2[j], and (2) the pair (lastν1,lastν2)is a right-
to-right traversal of Tfor position iand marble c=v1[i],
i.e. a pair of states (p1, p2)such that for some α,Tcan
go from configuration (p1, i, cα)to configuration (p2, i, cα)
without visiting any position to the right of i(in particular,
being a right-to-right traversal does not depend on α). This is
illustrated in Fig. 2 in Appendix.
Based on this observation, fis expressed as maplexλf′
with λ= (B, ≺B)where B=C×Q×2Q×Qand f′checks
that its input, of the form c0c1· · · ⊗ p0p1· · · ⊗ X0X1..., is
valid, in the sense that (p0,0, c0c1...)is a configuration νof
Treachable from the initial configuration, pi=lastν(i)for all
i, and Xiis the set of right-to-right traversals at position i. It
is proved that valid inputs form a regular language. If its input
is valid, f′outputs fR(⊢u⊣ ⊗ c0c1. . . ), for Rthe assistant
transducer of T, otherwise f′outputs ǫ.f′is shown to be
lexicographic by induction hypothesis. Finally, ≺Bis defined
by (c1, q1, X1)≺B(c2, q2, X2)if c1=c2and X1=X2and
(q1, q2)∈X1, otherwise the order is arbitrary.
The following theorem summarizes the characterizations of
lexicographic transductions proved so far:
Theorem 6 (Characterizations of lexicographic transductions).
Let f: Σ∗⇀Γ∗be a transduction and k≥1. The following
statements are equivalent:
(1) fis k-lexicographic.
(2) fis k-lexicographic automatic.
(3) fis recognizable by a k-nested marble transducer.
(4) fis recognizable by a state-passing free k-nested marble
transducer.
Proof. (2) Prop. IV.6
←−−−−→ (1) Thm 4
−−−→ (3) Thm. 3
−−−−→ (4) Thm. 5
−−−−→ (1).
VIII. EXPR ES S IV ENE SS AN D CLO SUR E PROP ERTI ES OF
LE XIC OG RAP HIC T RA NSD UCT ION S
In this section, we prove that Lex contains all the polyreg-
ular transductions [Boj18], and all the transductions recogniz-
able by (copyful) streaming string transducers [FR21], [AC10].
We also show that Lex is closed by postcomposition under
any polyregular transduction, and closed by precomposition
under any rational transduction. We start by showing that
lexicographic transductions preserve regular languages under
inverse image.
Proposition VIII.1. Transductions in Lex are regularity pre-
serving.
Proof. It is an immediate corollary of the inclusion Lex ⊆
NMT (Theorem 6), that NMT are closed by postcomposition
by a sequential transduction (Lemma VI.3), and that NMT
have regular domains (Corollary VI.6).
We show that Lex subsumes both SST and PolyReg. More
precisely that any transduction recognizable by a (copyful)
streaming string transducer (SST) is 1-lexicographic. We do
not give the definition of SST and refer the reader to [DFG20]
for more details. We also show that NMT of level ksubsume
k-pebble transducers. Again we don’t give precise definitions
of pebble transducers and refer the reader to [Boj18].
Theorem 7 (SST and PolyReg in Lex).The following hold:
•SST =Lex1,
•A transduction definable by a k-pebble transducer is in
Lexk. In particular PolyReg ⊆Lex
Proof. It is already known that marble transducers (i.e. nested
marble transducers of level 1) capture exactly the class of
SST-recognizable transductions [DFG20]. The result then
follows from Theorem 6.
A single pebble can be simulated by one level of marbles,
with colors {0,1}with the restriction that at most one marble
can have color 1per level.
We now prove that the class of lexicographic transductions
is closed under postcomposition by a polyregular transduction.
Theorem 8. PolyReg ◦Lex ⊆Lex
Proof. Any polyregular transduction can be expressed as a
composition of sequential transductions, square,map and
rev [Boj18]. We show that Lex is closed by postcomposition
by these transductions, which yields the result. For sequential
transductions, it has been shown in Lemma VI.3. It remains
to show closure under square,map and rev.
Closure under map Let f: Σ∗→Γ∗be a k-lexicographic
transduction. We show that the transduction map f: Σ∗
|→Σ∗
|
(where map is defined in Ex. II.3) is k-lexicographic. Suppose
that fis given as an NMTspf Tfof level k. We sketch the
construction of an NMTspf Tof level k+1 recognizing map f.
The transducer Tonly needs to mark chunks of the form
|ui|,⊢ui|or |ui⊣, for increasing values of i. It can do so
by using three marbles, ⊥,⊲and ⊳:⊲is used to mark the
left separator of the chunk (either |or ⊢), ⊳is used to mark
the right separator (either |or ⊣) and ⊥is used to mark any
other position. It is not difficult to construct Tsuch that it
enumerates all the markings of chunks of its inputs in order
from left to right. Once a chunk has been correctly marked by
T,Tmoves to the initial position of the whole input word,
and call a modified version of Tf, which we call T′
f. The
transducer T′
fbehaves as Tfbut on the portion of its input in
between the position marked ⊲and ⊳. Accordingly, transitions
of Tfare modified such that ⊲is interpreted as ⊢, and ⊳as ⊣.
The subtransducer of Tf(and recursively the subtransducer of
its subtransducer), also has to be modified to be simulated only
on the marked chunk. When T′
freaches an accepting state,
the control goes back to Twhich then marks the next chunk.
With a slightly more technical construction (but similar), it
is possible to both combine Tand T′
fat the same level, so
that map fcan be shown to be k-lexicographic instead of
(k+ 1)-lexicographic.
11
Closure under rev We prove by induction on nthat for
all k≥0, if f∈Lexk, then rev f∈Lexk. For k= 0,
it is easy to see that simple transductions are closed under
reverse since words of length at most one are their own reverse.
If k > 0, there exist λ= (B , ≺)an ordered alphabet and
(g: (Σ ×B)∗⇀Γ∗)∈Lexk−1such that f=maplexλg.
Let λ−1= (B, ≺−1)where x≺−1
Byiff y≺Bx. We
prove that rev f=maplexλ−1(rev g). First, the lexicographic
extension of ≺−1is precisely the reverse order of ≺: for u, v ∈
Bn, if u≺vthen there is i≤nsuch that u[i]≺v[i]and
u[j]≺v[j]for all i < j ≤n. This means hat v≺−1u. Then,
take an input word u∈Σ∗of length n, and let v1,...,vk∈
B∗of length n, we have
v1≺−1
Bv2...vk−1≺−1
Bvkiff vk≺Bvk−1...v2≺Bv1
Suppose now that v1,...,vkis the lexicographic enumera-
tion of all B-words of length naccording to ≺−1
B, then:
rev f u =rev (maplexλg)u
=rev(g(vk)...g(v1))
= (rev g v1)(rev g v2)...(rev g vk)
=maplexλ−1(rev g)u
Closure under square We refer the reader to Example V.6
for a definition of the transduction square. Let f∈Lex. If
fis simple, then it is immediate that (square f)∈Seq
and the result follows from Lemma V.2. Otherwise, assume
f∈Lexkfor k > 0, we show that (square f)∈Lex2k.
Then f=maplexλ1maplexλ2...maplexλkswhere λi=
(Bi,≺i), for 1≤i≤k, are ordered alphabets and s: (Σ ×
B1×· · ·×Bk)∗⇀Σ≤1is simple. Now, define the transduction
s: (Σ ×(Πk
i=1Bi)×(Πk
i=1Bi))∗⇀(Σ ∪Σ)≤1such that for
all u∈Σ∗and all b, c ∈(B1× · · · × Bk)∗,
s(u⊗b⊗c) =
ǫif s(u⊗b) = ǫ, else
s(u⊗c)if b6=c
s(u⊗c)if b=c
where ǫ=ǫ. It is not difficult to see that sis simple. Now,
note that the number of times s(u⊗b)6=ǫholds is exactly
|f(u)|. Moreover, whenever s(u⊗b)6=ǫ, the enumeration of
all the cproduces f(u), where the letter produced when c=b
is underlined. Therefore,
square f= (maplexλ1... maplexλk)2s
where .2here has to be understood as a copy, e.g. (α β)2=
α β α β for any function α, β.
Finally, we show that lexicographic transductions are closed
by pre-composition under any rational transduction.
Theorem 9 (Lex ◦Rat ⊆Lex).Let k≥1. For any
rational transduction g: Γ∗⇀Λ∗and any k-lexicographic
transduction f: Λ∗⇀Γ∗,f◦gis k-lexicographic.
Proof. A rational transduction can be decomposed as a letter-
to-letter rational transduction, followed by a morphism. Exam-
ple V.1 shows that morphisms are lexicographic. Similar ideas
apply inductively to show that Lex is closed by precomposition
under morphisms and letter-to-letter rational transductions. See
Appendix E-1.
IX. DI SCU SSI ON
We have introduced the class of lexicographic transductions,
a subclass of MSOSI. We have given three different character-
izations: in terms of closure of simple functions by the maplex
operator, as lexicographic automatic transductions which can
be seen as a syntactic restriction of MSOSI, and finally as
nested marble transducers.
Thanks to these characterizations we have shown that this
class subsumes 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.
1) Open questions on MSOSI:We leave open whether
MSOSI is regularity preserving. A way to attack the problem
is trying 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 decid-
able MSO theory, which has been open for almost 20 years.
Since the inverse image of an FO definable language
by an MSOSI is regular, it means in the case of words
that the inverse image of any language recognized by an
aperiodic monoid is regular, thanks to the famous result
of Sch ¨utzenberger [Sch65]. Using a decomposition result of
Krohn-Rhodes [KR65] this means that to show that MSOSI
over words are regularity preserving one only needs to show
that the inverse image of language recognized by a group
(even a simple group) is regular. Moreover, it can be shown
[Gr¨a20, Theorem 3.2] that MSOSI over words satisfy the
backward translation property for first-order logic with modulo
quantifiers, which can say for instance there is an even number
of positions xsuch that φ(x)holds. This logic corresponds to
languages recognized by solvable monoids, that is monoids
containing only solvable groups. Hence, to show that word-
to-word MSOSI are not regularity preserving, one could start
by considering languages recognized by A5the smallest non-
solvable group, which is a subgroup of the permutation group
of 5elements S5.
2) Open questions on Lex:We have shown that Lex is a
rather well-behaved class, however some interesting questions
remain open. We have not shown that MSOSI strictly sub-
sumes Lex, although we suspect it does. For instance we have
not been able to show that Lex is closed under pre-composition
with Reg, and we believe that it is not.
The equivalence problem is central to transducer theory,
however equivalence of PolyReg transductions is not known
to be decidable, and since PolyReg is subsumed by Lex it is
also the case for the latter.
One can decide whether a Lex transduction is in PolyReg,
however we don’t know whether it is decidable if a Lex
transduction is in Lex1, and more generally compute on which
level of the hierarchy it sits.
3) 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
12
three possible extensions of Lex, in increasing expressiveness,
all of which turn out to be included in MSOSI.
The class Lex ◦Reg may be an interesting class in itself
and the first level Lex1◦Reg 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 Lex ◦Reg 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 [EHS21] 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. 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 the version with state-passing
is too expressive since it can recognize non-regular languages.
REF ERE NC E S
[AC10] Rajeev Alur and Pavol Cern´y. 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¨ur Informatik,
2010.
[B´ar08] Vince B ´ar´any. A hierarchy of automatic $\omega$-words having
a decidable MSO theory. RAIRO Theor. Informatics Appl.,
42(3):417–450, 2008.
[BDK18] Mikolaj Bojanczyk, Laure Daviaud, and Shankara Narayanan
Krishna. Regular and first-order list functions. In Anuj Dawar and
Erich Gr¨adel, 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.
[Ber79] Jean Berstel. Transductions and context-free languages, vol-
ume 38 of Teubner Studienb¨ucher : Informatik. Teubner, 1979.
[BKL19] Mikolaj Bojanczyk, 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¨ur Informatik, 2019.
[BKN+25] Val ´erie Berth ´e, Toghrul Karimov, Joris Nieuwveld, Jo¨el Ouak-
nine, Mihir Vahanwala, and James Worrell. The monadic theory
of toric words. Theor. Comput. Sci., 1025:114959, 2025.
[Boj18] Mikolaj Bojanczyk. Polyregular functions. CoRR,
abs/1810.08760, 2018.
[Boj23] Mikolaj Bojanczyk. 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.
[BS20] Mikolaj Bojanczyk 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¨ucken, Germany (Virtual Conference), volume
168 of LIPIcs, pages 113:1–113:14. Schloss Dagstuhl - Leibniz-
Zentrum f¨ur Informatik, 2020.
[CCP20] Micha¨el Cadilhac, Olivier Carton, and Charles Paperman. Con-
tinuity of functional transducers: A profinite study of rational
functions. Log. Methods Comput. Sci., 16(1), 2020.
[CL07] Thomas Colcombet and Christof L¨oding. Transforming structures
by set interpretations. Log. Methods Comput. Sci., 3(2), 2007.
[DFG20] Ga¨etan Dou ´eneau-Tabot, Emmanuel Filiot, and Paul Gastin.
Register transducers are marble transducers. In Javier Esparza
and Daniel Kr´al’, 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¨ur Informatik, 2020.
[EHS21] 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.
[EHvB99] Joost Engelfriet, Hendrik Jan Hoogeboom, and Jan-Pascal van
Best. Trips on trees. Acta Cybern., 14(1):51–64, 1999.
[FG04] 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.
[FR21] Emmanuel Filiot and Pierre-Alain Reynier. Copyful streaming
string transducers. Fundam. Informaticae, 178(1-2):59–76, 2021.
[GLN25] Paul Gallot, Nathan Lhote, and Lˆe Th`anh D ˜ung Nguyˆen. The
structure of polynomial growth for tree automata/transducers and
mso set queries, 2025.
[Gr¨a20] Erich Gr¨adel. Automatic structures: Twenty years later. In Holger
Hermanns, Lijun Zhang, Naoki Kobayashi, and Dale Miller,
editors, LICS ’20: 35th Annual ACM/IEEE Symposium on Logic
in Computer Science, Saarbr¨ucken, Germany, July 8-11, 2020,
pages 21–34. ACM, 2020.
[HK21] Tero Harju and Juhani Karhum¨aki. Finite transducers and
rational transductions. In Jean- ´
Eric Pin, editor, Handbook of
Automata Theory, pages 79–111. European Mathematical Society
Publishing House, Z¨urich, Switzerland, 2021.
[KR65] Kenneth Krohn and John Rhodes. Algebraic theory of machines.
i. prime decomposition theorem for finite semigroups and ma-
chines. Transactions of the American Mathematical Society,
116:450–464, 1965.
[KS81] Tsutomu Kamimura and Giora Slutzki. Parallel and two-way
automata on directed ordered acyclic graphs. Inf. Control.,
49(1):10–51, 1981.
[MP19] 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 As-
pects 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¨ur Informatik, 2019.
[Sch65] Marcel Paul Sch¨utzenberger. On finite monoids having only
trivial subgroups. Inf. Control., 8(2):190–194, 1965.
13
APP END IX A
OMITT E D PROO FS OF SEC TIO N III
1) Proof of Proposition III.3:
Proposition III.3. 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 ma-
chines,
•The class of word-to-word MSOSI is closed under post-
composition with polyregular transductions.
Proof sketch. (2)⇒(1) Given a transduction computed by
an MSOSI, and a regular language L, take a deterministic
automaton recognizing it, and let gbe computed by the Mealy
machine which labels every letter by the target state of the tran-
sition. Let L′denote the language of annotated words whose
last letter is annotated by a final state. Then g◦f(u)∈L′
if and only if f(u)∈L. Since L′is first-order definable and
MSOSI are closed under FOI, then (g◦f)−1(L′) = f−1(L)is
regular. (1)⇒(2) Let f: Σ∗⇀Γ∗be defined by an MSOSI
of dimension k. Let ube a word and let P⊆Pos(u), we can
naturally associate a word v∈ {0,1}|u|representing the set P.
For P1,...,Pk⊆Pos(u), we use the notation u(P1,...,Pk)
for the word u⊗v1⊗...vkwhere Piis represented by vi.
We can define an MSOSI realizing fprefix : Σ × {0,1}k⇀
Γ∗, which maps u(P)to the prefix of f(u)restricted to the
k-tuples of subsets coming strictly before P.
let us consider a Mealy machine computing a transduction
g: Γ∗→Λ∗and let Lpthe set of words usuch that ureaches
state pin the Mealy machine, which is regular. Then by as-
sumption f−1
prefix(Lp)is a regular language. Thus we can define
a formula ψp(X1,...,Xk)such that u|=ψp(P1,...,Pk)if
and only if u(P)∈f−1
prefix(Lp).
If we have φγ(X1,...,Xk)defining the positions of f(u)
labeled by γ, then we define the positions of g◦f(u)labeled
by αby a disjunction for all states pwith a transition pγ|α
−−→ q:
_
pγ|α
−−→q
ψp(X1,...,Xk)∧φγ(X1,...,Xk)
(3)⇒(2) Mealy machines compute particular cases of polyreg-
ular transductions.
(2)⇒(3) For this direction we rely on several decomposition
results. The first, from [BKL19, Lemma 9] says that any
polyregular transduction can be obtained as the composition
of a first-order interpretation and a rational letter-to-letter
transduction. Secondly, rational transductions are known to
be compositions of sequential and co-sequential transductions
[Ber79]. Moreover, a co-sequential function is the composition
of the form rev ◦f◦rev with fsequential, and rev is an
FOI.
APP END IX B
OMITT E D PROO FS OF SE CT I ON I V AND SE CT ION V
1) Proof of Proposition IV.6:
Proposition IV.6 (ATk-Lex =Lexk).For all k≥1, a trans-
duction is k-lexicographic iff it is k-lexicographic automatic.
Proof. Let f: Σ∗⇀Γ∗. Suppose that f=
maplexλ1maplexλ2... maplexλksfor some simple func-
tion sof the form Lǫ⊲ǫ +Pγ∈ΓLγ⊲γ. Then Adom is defined
as any automaton recognizing dom(f), which is regular by
Lemma IV.4. Auniv is any automaton recognizing dom(s),
which is also regular. Finally, for all γ∈Γ,Aγis any
automaton recognizing Lγ.
Conversely, given Adom ,Auniv and Aγfor all γ∈Γ
defining f, we define a simple function ssuch that f=
maplexλ1maplexλ2... maplexλks. Define Lǫthe (regular)
set of words (u⊗b1· · · ⊗ bk)∈(Σ ×B1× · · · × Bk)∗
such that u∈L(Adom). Then, s=Lǫ\(Sγ∈ΓL(Aγ)⊲ǫ +
Pγ∈ΓL(Aγ)⊲γ.
2) Proof of Lemma V.2:
Lemma V.2. Seq ⊆Lex1.
Proof. Let T= (A, µ)a sequential transducer recognizing
a transduction f: Σ∗⇀Γ∗, where A= (Σ, Q, q0, F , δ).
We define an ordered alphabet λ= (B, ≺)and a simple
transduction s: (Σ ×B)∗⇀Γ≤1such that f=maplexλs.
Let M=max(q,σ)∈Q×Σ|µ(q, σ)|be the length of the longest
word occurring on the transitions of T.
We take B=Q× {⊥,1,...,M}. Intuitively, the Q-
component is used to annotate the input word uwith the run of
T, if u∈dom(f), and exactly one position is annotated with
some integer j6=⊥, meant to identify the j-th letter of the out-
put word produced by µ. Since not all annotations satisfy these
constraints, we define the set of valid annotated words as the
set Vof words v= (σ1,(q1, b1)) ...(σn,(qn, bn)) ∈(Σ×B)∗
such that σ1...σn∈dom(f),q0q1. . . qnis the accepting run
of Aon σ1...σn, and, there is a unique isuch that bi6=⊥,
and in that case, bi∈ {1,...,|µ(qi−1, σi)|}.Vis easily seen
to be regular. If v∈V, then we let s(v) = µ(qi−1, σi)[bi]. If
v6∈ Vbut σ1. . . σn∈dom(f), then we let s(v) = ǫ. In all
other cases, s(v)is undefined. The transduction sis simple.
It remains to order Bso that the lexicographic enumeration
of valid annotations coincides with the sequential productions
of outputs by T. To do so, we let (q1, b1)≺(q2, b2)if
b1< b2(with ⊥being smaller than any integer), and if
b1=b2,q1<Qq2for some arbitrary order <Qover Q.
For example, for a sequential transducer with a single state q
(both initial and final) over Σ = Γ = {a}, a loop on state q
with µ(q, a) = aa, the valid annotations of the input word aa
are lexicographically enumerated as follows:
(q0
1)( q0
⊥)≺(q0
2)( q0
⊥)≺(q0
⊥)( q0
1)≺(q0
⊥)( q0
2)
APP END IX C
OMITT E D PROO FS OF SE CT I ON V I
1) Proof of Lemma VI.3 :
14
Lemma VI.3 (Seq ◦NMT ⊆NMT).For all k≥0, all
(k, Σ,Γ)-NMT Tand all sequential transducer Sover Γ,Λ,
one can construct, in polynomial time, a (max(k, 1),Σ,Λ)-
NMT T′such that fT′=fS◦fT.
Proof. If k= 0,Tis a simple transducer defined as a
DFA with outputs on accepting states. Equivalently, Tcan
be seen as a sequential transducer which produces the empty
word all the time, and produces a (possibly) non-empty word
when reading the rightmarker ⊣. Then, it is well-known that
sequential transducers are closed under composition, and the
result follows by Lemma V.2.
If k > 0, the composition is realized by a product construc-
tion between Tand Sthat we denote T⊗S. States of T⊗S
are therefore pairs of states of Tand S:QT⊗S=QT×QS.
Whenever Tapplies its output function µon some state qand
marble c, producing a word µ(q, c)∈Γ∗and moving to some
state q′, in the product construction, from a pair of states (q, s),
if sµ(q,c)/w
−−−−−→Ss′, then T⊗Sproduces wand moves to state
(q′, s′). Now, suppose Treads the leftmarker ⊢in some state q
and marble c, and calls a (k−1)−NMT Rinitialized with state
p=δcall(q, c). In the product, if T⊗Sis in state (q, s)with
marble c, then it calls R⊗S, whose construction is obtained
inductively, initialized with state (p, s). When R⊗Sreturns in
some state (p′, s′), then T⊗Scontinues its computation from
state (δret(q, c, p′), s′). The construction ensures the following
invariant: for all q∈QT, all s∈QS, all u∈Σ∗, all v∈Γ∗
and all w∈Λ∗, the following holds:
(fop
T(q, u) = (v, q′)∧fop
S(s, v) = (w, s′))
⇒fop
T⊗S((q, s), u) = (w, (q′, s′)).
2) Proof of Lemma VI.5:
Lemma VI.5. A language is recognizable by a nested marble
automaton of level kand nstates iff it is regular iff it is
recognizable by a finite automaton of size in k-EXP(n). This
non-elementary blow-up is unavoidable.
Proof. It is clear that any regular language is the domain of
some simple transduction. Conversely, let Abe a nested marble
automaton of level k. If k= 0, it is obvious. If k= 1, then
Ais a marble automaton, and 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. [EHvB99],
[DFG20], as well as Theorem 5.4 of [KS81] for a detailed
construction).
If k > 1, let A= (Σ, C, c0, QA, q0, F, δ, δcall, δret , A′)where
A′has level k−1(in the tuple, we have omitted the output
alphabet and function, since they play no role). For all states
qc, qrof A′, we let A′
qc,qrbe the automaton A′where qcis
initial, and qris the only final state. By induction hypothesis,
L(A′
qc,qr)is regular for all pairs (qc, qr), recognizable by some
finite automaton Dqc,qr, which we assume to be backward
deterministic (i.e. there is a single accepting state, and for
any state qand any symbol a, there is at most one incoming
transition to qreading a). We turn Ainto a marble automaton
B(of level 1) such that L(B) = L(A). Since Aprocesses its
input from right to left, we use the backward-determinism of
the automata Dqc,qrand extra marbles such that at any point
on the input, Bknows the state of all the automata Dqc,qr
after reading the current suffix from right to left. Thanks to
this information, Bcan simulate Aand whenever Acalls A′
with some initial state qc, instead, Bknows, if it exists, the
state qrof A′such that the current marked input is accepted
by A′
qc,qr. If such a state exists, then it is unique as A′
is deterministic, and Bcan bypass calling A′and directly
apply its return transition. If such a state does not exist, B
stops. It is easy to construct Bsuch that it can compute
this information, by marking the input with all the states of
all automata Dqc,qrreached on the current suffix from right
to left, and by using backward-determinism to compute such
tuples deterministically from right to left. The construction is
exponential, and yields a tower of k-exponential inductively.
We construct Bsuch that it satisfies the following invariant:
for all configuration ν= (q, i, (c, Ψ)v)of B, on some input
word u=σ0σ1. . . σn, where q∈QA, if νis the j-th
configuration reachable from the initial configuration, then
(i) (q, i, cπC(v)) is the j-th configuration of Aon ureach-
able from the initial configuration, and
(ii)for all pairs (qc, qr)∈Q2
A′,Ψ(qc, qr)is the state
of Dqc,qrafter reading the word (σiσi+1 . . . σn)⊗
(cπC(v)).
It is easy for Bto maintain this invariant: Bsimulates Aand
in any state q∈QAand input symbol σ, if Areads a marble
c(as well as σ), drops a marble c′(and so moves left) and
transitions to some state q′, then if Breads marble (c, Ψ) in
state q, it moves to state q′and drops marble (c′,Ψ′)where
for all (qc, qr)∈Q2
A′,δDqc,qr(Ψ′(qc, qr), σ) = Ψ(qc, qr)(this
state is unique as Dqc,qris backward-deterministic). If Alifts
a pebble and moves to state q′, so does B.
Knowing the state of automata Dqc,qris important to bypass
the calls to A′. Indeed, suppose that Breads ⊢in some state
q∈QA, reading some pebble (c, Ψ). Then, B, instead of
calling A′with initial state qc=δcall(q , c), checks whether
there exists some state qrsuch that Ψ(qc, qr)is accepting for
Dqc,qr, in which case Blifts the current pebble and moves
to state δret(q, c, qr)∈QA. If no such state qrexists, then B
stops. By construction, we have L(B) = L(A), which suffices
to conclude as Bis of level 1.
Finally, we briefly justify why the non-elementary blowup
is unavoidable, by showing how to convert an FO-sentence in
prenex normal form, in exponential time, and more generally
an FO-formula φ(x1,...,xn)with n-free first-order variables
in prenex normal form into an equivalent nested marble
automaton Aφover alphabet Σ× {0,1}n. The non-elementary
blowup to convert FO-formulas into DFA is known to be
unavoidable for formulas in prenex normal form [FG04].
Quantifier-free formulas can be converted into DFA (and a
fortiori into nested marble automata) in exponential time. We
now explain how to treat quantifiers.
15
For a formula φ=∀xψ(x1,...,xn, x), if Aψis a nested
marble automaton of level k, then Aφis a nested marble
automaton of level k+ 1 which, for all input position x, from
right to left, marks xwith some marble 1and the other with
marble 0, moves towards ⊢, call Aψ. If Aψreturns a non-
accepting state, then Aφstops and rejects. If Aψreturns an
accepting state, then Aφmoves back to position x(which
is the only one marked 1), lifts 1, and repeats the same
process with position x−1, and so on until xis the first
input position. For existential quantifiers, while standard logic-
to-automata constructions use closure under morphisms of
automata (which yields non-determinism), they can also be
dealt with directly using marbles. The way to proceed is the
same as for universal quantifiers, except that the nested pebble
automaton Aφstops and accepts as soon as a position xhas
been found. State-passing, and in particular here getting the
state of the assistant automaton back to the top-level, is crucial.
Indeed, in the case of existential quantifiers, the return state
of the assistant automaton Aψindicates to Aφwhether it must
continue looking for some xor stop.
3) Proof of Theorem 3 (formal details):
Theorem 3 (State-passing removal).For all k-NMT T, there
exists an equivalent k-NMTspf T′whose size is k−EXP in
that of T. This non-elementary blow-up is unavoidable.
Proof. There are two kinds of state-passing, through functions
δcall and δret. We deal with them separately.
a) Removal of function δcall :This function allows to pass
information from level kto level k−1. More precisely, being
on the left end-marker in state q, with marble c, the transducer
of level kaims at calling the assistant transducer in state
δcall(q, c). As the assistant transducer has access to marbles
of level k, we can use them to pass information. Then, the
assistant transducer can go through the input word to recover
values of qand cto recompute δcall (q, c). Formally, if Thas set
of states Qand set of marbles C, we will use C×Qas new
set of marbles, and modify the transitions of Taccordingly
to ensure that in every reachable configuration (q, i, (c, p).v),
we have q=p. Additionally, the assistant transducer T′is
modified as follows: it always starts in the same initial state
and goes to the left end-marker. It reads the marble (c, q)of
level k(which is part of its input word), goes back to the right
end-marker, and starts its computation from state δcall (q, c).
Regarding complexity, the modifications we described re-
quire the addition of only a constant number of states. The
alphabets of marbles are also modified, the overall complexity
being polynomial.
b) Removal of function δret :This function allows to pass
information from level k−1to level k. This removal is more
involved, and will induce a tower of exponential in terms of
complexity.
Intuitively, we will use Lemma VI.5 to precompute the final
state reached by the assistant transducer. More precisely, we
proceed by induction on k. If k= 0, then the result is trivial
as the two classes are syntactically the same in this case.
Assume the result holds for k, and let us prove it holds for
k+ 1. Let T= (Q, C, ..., T ′)be a (k+1)-NMT Twith n
states, with T′ak-NMT. We sketch how to build an equivalent
(k+1)-NMTspf ˜
T. By induction hypothesis, there exists a k-
NMTspf ˜
T′equivalent with T′. In addition, the domain of T′
is accepted by a knested marble automaton hence, thanks to
Lemma VI.5, is a regular language. More precisely, for each
final state q′
f, the language of words accepted by T′with a
run ending in state q′
fis regular. As we did in the proof of
Lemma VI.5, we consider a backward deterministic automaton
accepting it, and modify the set of marbles of Tto store states
of these automata. Hence, when doing its call transition in
state qand over marble c,˜
Tcan determine the final state
q′
freached by T′. It then calls ˜
T′and directly moves to the
right state δret(q, c, q′
f). In addition, if no such state q′
fexists,
then it stops. Hence, calls to the assistant transducer always
terminate.
Last, we justify the fact that the non-elementary blow-up
is unavoidable. It is because the domain of any state-passing
free NMT Sis recognizable by a finite automata of exponential
size. Indeed, the calls to assistant transducers always terminate,
so the domain of Sdoes 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 S. Thus, the existence of an elementary
construction for state-passing removal would contradict the
non-elementary blow-up stated in Lemma VI.5.
APP END IX D
OMITT E D PROO FS OF SEC TI ON VI I
1) Proof of Theorem 4:
Theorem 4 (Lex ⊆NMT).Any transduction f∈Lexkis
recognizable by some NMT Tfof level k. If B1,...,Bkare
the ordered alphabets of fand sits simple transduction,
represented by a sequential transducer with mstates, then
Tfhas O(k+m)states and Pk
i=1 |Bi|marbles.
Proof. The proof goes by induction on k. It is immediate for
k= 0. Now, let f: Σ∗⇀Γ∗such that f=maplexλg,
with λ= (B, ≺B), for some g: (Σ ×B)∗→Γ∗in Lexk. By
induction hypothesis, there exists an NMT of level k Tgwhich
recognizes g. To obtain an NMT Tfrecognizing f,Tfneeds
to enumerate all the possible annotations of its input according
to ≺B, using Bas its set of marbles. Whenever a complete
annotation of its input is obtained, it calls Tgrecursively.
We now explain how Tfrealizes the enumeration. Initially,
it annotates from right to left the whole input with marbles
b0, where b0is the ≺B-minimal element. Now, suppose that
Tfhas annotated the whole input (in Σ) of length ℓwith
some b1...bℓ∈B∗. To obtain the successor annotation, it
reads the marbles b1b2... from left to right, and looks for the
first position isuch that biis not the ≺B-maximal element. It
replaces biby succλ(bi)and, going from right to left, replaces
any bj, j < i, by b0, until it reaches the leftmarker ⊢. Only a
constant number of states is needed.
16
With a slightly more complicated proof, we can show that it
is possible to convert any lexicographic transduction directly
into a state-passing free NMT. Indeed, in the latter proof,
no states need to be passed to the assistant transducer Tg.
State-passing freeness also asks that any call to the assistant
transducer Tgsucceeds. This is the case whenever Tgis called
on annotated words (⊢u⊣)⊗bsuch that u∈dom(f), which
is regular by Lemma IV.4. Hence, Tffirst needs to check that
its input is in dom(f), to ensure that it is indeed state-passing
free.
2) Proof of Theorem 5 (formal details):
Theorem 5 (NMTspf ⊆Lex).Any transduction frecogniz-
able by some NMTspf Tof level kis k-lexicographic.
3) Bottom producing nested marble transducers: As a
preprocessing step, we prove that NMTspf can be restricted to
produce outputs only at the deepest recursive call. An NMT
is called bottom producing if it is either of level 0, or of level
k > 0with a constant output function µproducing ǫand a
bottom producing assistant NMT.
Lemma D.1. Any NMTspf Tof level kcan be converted in
PTIM E into an equivalent bottom producing NMTspf T′of
level k.
Proof. Whenever Tproduces some output word w∈Γ∗,
instead T′writes it on the input (as a marble), moves to
⊢, and calls a modified assistant transducer which first scans
its input looking for some marble in Γ∗, which it outputs,
otherwise behaves as the initial assistant transducer. The
modified assistant transducer is then made bottom producing
inductively.
Formally, the proof goes by induction on k.
If k= 0, it is already bottom producing. Let
T= (Σ,Γ, C, c0, Q, q0, F, δ, µ, R)be an NMTspf of
level k. We modify Tinto an equivalent NMTspf
T′= (Σ,Γ, C′, c′
0, Q′, q′
0, F ′, δ′, µ′, R′)such that µ′is
the constant function returning ǫand R′is of level k−1.
By induction hypothesis, R′can be turned into a equivalent
bottom producing NMTspf of level k−1, yielding the result.
Let us sketch the construction of T′. Whenever Tapplies
some transition t∈δsuch that w:= µ(t)6=ǫ, instead, T′
drops a marble wand moves to the leftmarker ⊢, dropping a
dummy marble ⊥and looping in state ←−
t(this state indicates
that T′must move left and keeps in memory the transition t
which should have been applied). Once on the leftmarker, T′
calls the assistant transducer R′, which works as follows: it
scans until it sees, on its input, a letter of the form (σ, w)∈
Σ×Γ∗, in which case it produces wand moves to an accepting
state (thus returning to T′). If it sees only input symbols in
Σ×C, it returns to its initial position and behaves as R. When
R′returns, T′is still in state ←−
ton ⊢.T′then moves right,
looping in state −→
tuntil it sees the marble w, in which case
it applies transition t, as Tinitially intended. The new set of
states is therefore Q′=Q∪←−
δ∪−→
δ, and the new set of marbles
is C′=C∪codom(µ)∪ ⊥.
4) Proof of Theorem 5:
Proof. Let f: Σ∗⇀Γ∗be recognizable by some NMTspf
Tof level k. We show that f∈Lexk. The proof goes by
induction on k. It is immediate for k= 0. We prove the
induction step.
Assumptions Let T= (Σ,Γ, C, c0, Q, q0, F, δ, R)be an
NMTspf of level k. To simplify the proof, we make a few
assumptions on T, which are without loss of generality. First,
we assume Tto be bottom producing thanks to Lemma D.1
(that is why the output function µis not mentioned in the
tuple above).
We also assume that T, whenever it processes an input word,
always start by initially doing a full right-to-left pass marking
the input with c0, and then comes back to the rightmarker ⊣. If
that is not the case, then Tcan easily be modified by adding a
loop on state q0which always drops marble c0until ⊢is read,
then coming back to ⊣. The subtransducer Ris also modified
in such a way that it does not produce anything on the first
initial marking in c∗
0. This assumption will be useful when
ordering configurations, so that initial markings will always
be of the latter form.
Useful notions: full configurations and right-to-right traver-
sals Since Tis bottom-producing, only configurations whose
reading head is placed on ⊢must be considered in the
enumeration. A full configuration of Ton some word ⊢u⊣
is a configuration whose reading head is placed on ⊢,i.e. a
triple (q, i, v)such that i= 0. We denote by Cf
T(u)the set
of full configurations on input ⊢u⊣reachable from the initial
configuration.
We now define the notion of right-to-right traversals, which
is standard in the theory of two-way machines. Given a word
⊢u⊣, a position iand a marble c, we say that a pair of states
(q1, q2)is a right-to-right traversal (RR for short) at position
imarked c, if, informally, Tcan go from a configuration
(q1, i, cv)for some vto the configuration (q2, i, cv)without
visiting any position to the right of i. Formally, there must
exist a sequence of configurations
(q1, i, cv)→T(p1, i1, v1cv)→T(p2, i2, v2cv)→T...
→T(pm, im, vmcv)→T(q2, i, cv)
such that ij≤ifor all 1≤j≤m. In particular, vcould
be substituted by any word v′of same length in the sequence
above. We denote by RRT(u, i)∈(C→2Q2)the function
which associates with any c∈C, the set RRT(u, i)(c)(just
denoted RRT(u, i, c)), of RR traversals at position imarked
c. Note that for all c, q , it holds that, (q, q)∈RRT(u, i, c).
Main argument The main idea of the proof is to define an
ordered alphabet λ= (B , ≺)where the set Bis of the form
C×B′for some B′, and for all u∈dom(f)an injective
mapping Φu:Cf
T(u)→B∗such that the following properties
hold:
1) for all ν= (q, 0, v)∈Cf
T(u),|Φu(ν)|=|u|+ 2 and
πC(Φu(ν)) = v.
2) for all ν1, ν2∈Cf
T(u),ν1→∗
Tν2iff Φu(ν1)≺Φu(ν2)
17
⊢ ⊣
input ui
configuration ν1
configuration ν2
right-to-right
traversal
Tis in state lastν1(i)
Tis in state lastν2(i)
Fig. 2: Moves of Tillustrated, with ν1→∗
Tν2
3) {(⊢u⊣)⊗Φu(ν)|u∈dom(f)∧ν∈Cf
T(u)}is regular.
Property (1) ensures that the Φu(ν)preserves the sequence
of marbles of ν. Property (2) ensures that the sequence of
successive configurations of Ton ⊢u⊣can be embedded,
modulo Φu, in the lexicographic enumeration of B|u|+2. How-
ever, some words in B|u|+2 may not correspond to any full
configuration. Property (3) ensures that this can be controlled
with a finite automaton. If those properties are guaranteed,
then it suffices to modify Rinto an NMTspf R′of same level
which, when reading a word in (⊢u⊣)⊗b, where u∈Σ∗and
b∈B∗, proceeds as follows:
1) R′first checks whether u∈dom(f)and b= Φu(ν)for
some νa full configuration. By property (3), this can
be done by a finite automaton A, which is simulated as
follows: R′first moves to ⊢, then simulates Afrom left
to right, ending up in ⊣in some state q.
2) if qis an accepting state of A, then R′simulates Ron
the C-projection of b, otherwise it does nothing (thus
producing ǫ).
By induction hypothesis, R′recognizes a transduction f′∈
Lexk−1, and as an immediate consequence of (1) and (2), we
get f=maplexλf′, which proves the result.
It remains to define λ= (B, ≺)and Φu, and prove that
they satisfy properties (1) −(3).
a) Definition of λ= (B, ≺)and Φu:Let u∈dom(f).
First, given a full configuration ν∈Cf
T(u), a position i∈
{0,...,|u|+1}, and a state q∈Q, we say that that qis the last
visited state for νat position i, denoted last(ν, i) = q, if, in-
formally, qis the last state in which Twas at position i, before
reaching configuration ν. Formally, by definition of Cf
T(u),ν
is reachable from the initial configuration, hence there exists
a finite sequence ν0= (q0,|u|+ 1, c0)→T(q1, i1, v1)→T
· · · →T(qℓ, iℓ=i, vℓ)→T· · · →T(qm, im= 0, vm) = ν
such that ν0is the initial configuration and ℓis such that ij< i
for all ℓ < j ≤m. We let last(ν, i) = qℓ.
The set of marbles Bis defined as B=C×Q×2Q×Q,
where the second component is aimed to be the last states
and the third component the set of RR-traversals. Tuples
(c1, p1, X1)and (c2, p2, X2)such that c16=c2or X16=X2
are arbitrarily ordered (the choice of ordering does not matter).
Otherwise, we let (c, p1, X )≺(c, p2, X)if p16=p2and
(p1, p2)∈X.
We now define Φu(for u∈dom(f)). Let ν= (q, 0, v)∈
Cf
T(u)be a full configuration of Ton ⊢u⊣. By definition of
Cf
T(u),νis reachable from the initial configuration, hence
there exists a sequence of configurations ν0→Tν1→
· · · → νreaching νfrom the initial configuration ν0. We
define Φu(ν)as v⊗rwhere for all 0≤i≤ |u|+ 1,
r[i] = (last(ν, i),RR(u, i, v[i])).
Proof of the properties of ΦuGiven α=
(c1, q1, X1)...(cn, qn, Xn)∈B∗, we let πC(α) = c1...cn,
πQ(α) = q1...qnand πRR(α) = X1. . . Xn. First, injectivity
of Φuand property (1) are immediate by definition.
Let us show property (2), which is the most interesting.
Let ν1= (q1,0, v1)and ν2= (q2,0, v2). From right to
left, suppose that Φu(ν1)≺Φu(ν2). Then, either they are
equal and so are ν1and ν2because Φuis injective, or they
are different. In the latter case they can be decomposed into
Φu(ν1) = w′
1(c1, p1, X1)wand Φu(ν2) = w′
2(c2, p2, X2)w
for some w′
1, w′
2, w ∈B∗,p1, p2∈Q,c1, c2∈Csuch that
(c1, p1, X1)6= (c2, p2, X2). Let i=|w′
2|=|w′
1|.
We first show that necessarily, c1=c2. Let us assume that
c16=c2. We derive a contradiction. Indeed, by definition of
marble transducers, the only way to modify a marble at some
position iis to lift the current marble, move right and eventu-
ally return to position iand drop another marble. This cannot
be done while having the same suffix w. Less informally, if
18
we denote by ρ1the configuration (p1, i, c1πC(w)) and by
ρ2the configuration (p2, i, c2πC(w)), then either ρ1→∗
Tρ2
or ρ2→∗
Tρ1. Assume that ρ1→∗
Tρ2, the other case being
symmetric. In the sequence of configurations to go from ρ1
to ρ2, there is necessarily a configuration whose reading head
is to the right of i,i.e. there exists ρ3= (p3, j, v′)such that
j > i and v′is a suffix of πC(w)such that ρ1→∗
Tρ3→∗
Tρ2.
Assume that jis the largest integer such that such a configu-
ration ρ3exists. It implies that p3=last(ν2, j ). Since v′is a
suffix of πC(w), we also get that p3=last(ν1, j ). Therefore,
there is a cycle ρ3→∗
Tρ1→∗
Tρ3, contradicting u∈dom(f).
Therefore, c1=c2. As the definition of X1and X2
only depends on the input word, the position and the marble
c1=c2, we get X1=X2. Since (c1, p1, X1)6= (c2, p2, X2),
we then have p16=p2. Moreover, c1πC(w) = c2πC(w). Let
vdenote this word. Hence we get v1=v′
1vand v2=v′
2v
for some v′
1, v′
2∈C∗. By definition of Φu,(p1, p2)∈
RR(u, i, c1=c2), we have (p1, i, v)→∗
T(p2, i, v). Moreover,
since p2=last(ν2, i), we also get (p2, i, v)→∗
Tν2. Similarly,
since p1=last(ν1, i), we have (p1, i, v)→∗
Tν1. Therefore,
since Tis deterministic, either ν1→∗
Tν2or ν2→∗
Tν1hold.
Suppose that ν2→∗
Tν1, we show a contradiction. In that
case, we have (p1, i, v)→∗
Tν2→∗
Tν1. Since p16=p2, the
sequence of configurations from ν2to ν1has to visit again
input position iin state p1, and hence ν2→T(p1, i, v).
Therefore, there is a cycle from (p1, i, v)to itself, which
contradicts that u∈dom(f). Hence ν1→∗
Tν2.
From left to right, suppose that ν1→∗
Tν2and ν16=ν2. Let
w1= Φu(ν1)and w2= Φu(ν2). Let wbe the longest common
suffix of w1and w2. Suppose that |w|=|w1|=|w2|. Since
q1=last(ν1,0) and q2=last(ν2,0), by definition of Φu, the
first letter of w1has q1as 2nd component, and the first letter
of w2has q2as 2nd component, from which we get q1=q2,
which contradicts ν16=ν2.
Therefore |w|<|w1|=|w2|. Hence w1and w2can be
decomposed into w′
1(c1, p1, X1)wand w′
2(c2, p2, X2)wwhere
(c1, p1, X1)6= (c2, p2, X2). Using the same argument as in the
right-to-left direction, we can show that necessarily, c1=c2
and therefore, X1=X2and p16=p2. Let c=c1=c2and
X=X1=X2. It remains to show that (p1, p2)∈X=
RR(u, i, c). Let x= 1,2. By definition of px=last(νx, i),
it holds that (px, i, cπC(w)) →∗
Tνxfollowing a sequence of
configurations which never visit positions strictly larger than
i. Therefore, since ν1→∗
Tν2, either ν1→∗
T(p2, i, cπC(w))
or (p2, i, cπC(w)) →∗
Tν1. We consider the two cases:
1) ν1→∗
T(p2, i, cπC(w)): the sequence of configurations
from ν1to (p2, i, cπC(w)) cannot visit positions at the
right of i, because wis the longest common suffix of both
w1and w2, so moving right iwould imply modifying
that suffix. Therefore, we get (p1, i, cπC(w)) →∗
Tν1→∗
T
(p2, i, cπC(w)), moreover by sequences which never visit
positions at the right of i. It witnesses that (p1, p2)∈
RR(u, i, c).
2) (p2, i, cπC(w)) →∗
Tν1: we show that this case is impos-
sible. Indeed, p2=last(ν2, i), hence (p2, i, cπC(w)) →∗
T
ν2be a sequence which never visits positions iagain. In
this sequence, there is necessarily ν1, because ν1→∗
Tν2.
It imples that Tcan go from ν1to ν2be a sequence of
configurations which never visit position i. This contra-
dicts that wis the longest suffix.
It remains to prove Property (3). It is possible to con-
struct a finite automaton which, given a word of the form
(⊢u⊣)⊗b, checks whether u∈dom(f)and whether there
exists ν∈Cf
T(u)such that b= Φu(ν). We do not give the
full details of this proof, but rather convey some intuitions.
Checking whether u∈dom(f)is doable by a finite automaton
as NMT have regular domains, by Corollary VI.6. Now, given
b∈(C×Q×2Q×Q)∗, the automaton has to check whether
πC(b)is a reachable annotation of the input ⊢u⊣. It is not
difficult to see that it can be done with a nested pebble automa-
ton which simulates Tuntil it sees πC(b)(checking equality
can be done using a linear pass over the input). The result
follows as nested pebble automata recognize regular languages
by Lemma VI.5. Now, let b= (c1, q1, X1)...(cn, qn, Xn).
The finite automaton also has to check that (1) qi=last(ν, i)
and (2) that Xi=RRT(u, i, ci), for all 1≤i≤n. This
can be done by a nested pebble automaton which first poses
a pebble on position i, and then checks the two properties
above using a assistant nested pebble automaton. For property
(1), this can be done using a nested pebble automaton which
simulates T. For property (2), the right-to-right traversals can
be computed using a nested marble automaton which, again,
simulates T. In more details, this nested pebble automaton
marks the current input position iwith some special marble,
and picks some pair (q1, q2)∈Xi. It then simulates Tfrom
position i, pebble ciand state q1, until it reaches some q2as
the same position. The special marble is used to check that no
positions strictly greater than iare visited. If no q2is seen, the
simulation will either stop (in a non-accepting state) or loop
foreover. The nested pebble automaton does this check for all
pairs (q1, q2)∈Xi. It also needs to check that Xiis complete,
by also considering all pairs in Q2\Xi, and checking that none
of them is a traversal. This can be done similarly. Once Xihas
been correctly verified to be equal to RR(u, i, ci), the special
marble is moved to the next position (to the left). Overall,
regularity follows from Lemma VI.5 again.
APP END IX E
OMITT E D PROO FS OF SEC TI ON VI II
1) Proof of Theorem 9:
Theorem 9 (Lex ◦Rat ⊆Lex).Let k≥1. For any
rational transduction g: Γ∗⇀Λ∗and any k-lexicographic
transduction f: Λ∗⇀Γ∗,f◦gis k-lexicographic.
We first need the following intermediate lemma:
Lemma E.1. Let f, g : Σ∗→Γ∗be two lexicographic
transductions of level kfand kgrespectively, such that
dom(f)∩dom(g) = ∅. Then f+gis lexicographic of level
max(kf, kg).
Proof. The proof is done by induction on the levels. We only
show the induction step. Suppose that f=maplex(B1,≺1)f′
19
and g=maplex(B2,≺2)g′for some B1, B2disjoint and f′, g′
lexicographic. Then, let λ= (B, ≺)with B=B1∪B2ordered
by b≺cif b, c ∈B1and b≺1c, or b, c ∈B2and b≺2c,
or b⊳cwhere ⊳is an arbitrary linear order of (B1×B2)∪
(B2×B1). Then, f+g=maplexλ(f′|(Σ×B1)∗+g′|(Σ×B2)∗+
C⊲ǫ)where C= ((dom(f)∪dom(g)) ⊗B∗)\((Σ ×B1)∗∪
(Σ ×B2)∗). We can conclude by induction hypothesis and
the fact that k-lexicographic transductions are closed under
regular domain restriction, for any fixed k.
Proof of Theorem 9. Any rational transduction gcan be de-
composed as g=h◦ewhere his a morphism and eis a letter-
to-letter rational transduction, in the sense that any transition
outputs exactly one letter. This is easily seen: if gis defined
as a finite transducer, eoutputs the sequence of transitions,
and hcomputes locally every output of the transitions. So, it
suffices to show that Lex is closed under pre-composition by
a morphism, and by a letter-to-letter rational transduction.
Closure under morphism Let ψ: Γ →Λ∗be a morphism.
We show that f◦ψ∈Lex. We do it by induction on the level
kof f. If fis simple, then f◦ψis also simple. Otherwise,
f=maplexλf′for some λ= (B, ≺)and f′. We extend
λinto λ′= (B′,≺′)with B′= (Λ ×B)≤M, where M=
maxγ∈Γ|ψ(γ)|, and order it as follows: for all v1⊗b1, v2⊗
b2∈B′,v1⊗b1≺′v2⊗b2if v1=v2and b1≺b2, or
v1≺Λv2for ≺Λan arbitrary linear order. Then, let Lbe the
set of words in (Γ ×(Λ ×B)≤M)∗, of the form (γ1, v1⊗
b1)...(γn, vn⊗bn)such that vi=ψ(γi)for all i= 1,...,n.
Define f′′ the transduction which takes any word in Land
returns f′((v1. . . vn)⊗(b1. . . bn)), otherwise it returns ǫ. By
definition of f′′ and ≺B′, we have:
f◦ψ=maplexλ′f′′
We conclude by proving that f′′ ∈Lex. It is a consequence
of the fact that (1) f′′ = (f′◦π)|L+C⊲ǫ, where C=
(Γ×(Λ×B)≤M)∗\Land πis the morphism which maps any
pair (γ, v ⊗b)∈Γ×(Λ×B)≤Mto v⊗b,(2) the induction hy-
pothesis, which implies that (f′◦π)∈Lex,(3) lexicographic
transductions are closed under regular domain restriction (see
Example V.3) and (4) lexicographic transductions are closed
under sum by Lemma E.1. This does not change the level.
Closure under letter-to-letter rational transductions Let gbe
a letter-to-letter rational transduction, given by a finite trans-
ducer (A, µ), where Ais a non-deterministic finite automaton
with set of transitions ∆, and µ: ∆ →Λis a morphism.
We show that (f◦g)∈Lex. Without loss of generality, we
assume that f=maplexλf′for some λ= (B, ≺), f ′and
f′: (Λ ×B)∗→Γ∗lexicographic. Then, Bis extended into
B′=B×∆, ordered as (b1, δ1)≺′(b2, δ2)if b1≺b2or
b1=b2and δ1≺∆δ2for ≺∆an arbitrary order.
Let L⊆(Γ ×B′)∗be the set of words
(γ1, b1, δ1)...(γn, bn, δn)such that δ1...δnis an
accepting run of Aon γ1. . . γn. Clearly, Lis regular.
Then, f◦g=maplexB′(f′◦µ◦π∆)|Lwhere π∆is the
∆-projection morphism. The result follows as lexicographic
transductions are closed under morphism and regular domain
restriction. This does not change the level.
20