The monoid of queue actions
Martin Huschenbett1 , Dietrich Kuske1 , and Georg Zetzsche2
1
TU Ilmenau, Institut für Theoretische Informatik
2
TU Kaiserslautern, Fachbereich Informatik
Abstract. We model the behavior of a fifo-queue as a monoid of transformations
that are induced by sequences of writing and reading. We describe this monoid
by means of a confluent and terminating semi-Thue system and study some of
its basic algebraic properties such as conjugacy. Moreover, we show that while
several properties concerning its rational subsets are undecidable, their uniform
membership problem is NL-complete. Furthermore, we present an algebraic characterization of this monoid’s recognizable subsets. Finally, we prove that it is not
Thurston-automatic.
1 Introduction
Basic computing models differ in their storage mechanisms: there are finite memory mechanisms, counters, blind counters, partially blind counters, pushdowns, Turing
tapes, queues and combinations of these mechanisms. Every storage mechanism naturally comes with a set of basic actions like reading a symbol from or writing a symbol
to the pushdown. As a result, sequences of basic actions transform the storage. The set
of transformations induced by sequences of basic actions then forms a monoid. As a
consequence, fundamental properties of a storage mechanism are mirrored by algebraic
properties of the induced monoid. For example, the monoid induced by a deterministic
finite automaton is finite, a single blind counter induces the integers with addition, and
pushdowns induce polycyclic monoids [10]. In this paper, we are interested in a queue
as a storage mechanism. In particular, we investigate the monoid Q induced by a single
queue.
The basic actions on a queue are writing the symbol a into the queue and reading the
symbol a from the queue (for each symbol a from the alphabet of the queue). Since a
can only be read from a queue if it is the first entry in the queue, these actions are partial.
Hence, for every sequence of basic actions, there is a queue of shortest length that can
be transformed by the sequence without error (i.e., without attempting to read a from a
queue that does not start with a). Our first main result (Theorem 4.1) in section 4 provides us with a normal form for transformations induced by sequences of basic actions:
The transformation induced by a sequence of basic actions is uniquely determined by
the subsequence of write actions, the subsequence of read actions, and the length of
the shortest queue that can be transformed by the sequence without error. The proof is
based on a convergent finite semi-Thue system for the monoid Q. In sections 3 and 5,
we derive equations that hold in Q. The main result in this direction is Theorem 5.3,
which describes the normal form of the product of two sequences of basic actions in
normal form, i.e., it describes the monoid operation in terms of normal forms.
Sections 6 and 7 concentrate on the conjugacy problem in Q. The fundamental notion of conjugacy in groups has been extended to monoids in two different ways: call
x and y conjugate if the equation xz = zy has a solution, and call them transposed if
there are u and v such that x = uv and y = vu. Then conjugacy ≈ is reflexive and transitive, but not necessarily symmetric, and transposition ∼ is reflexive and symmetric,
but not necessarily transitive. These two relations have been considered, e.g., in [13, 16,
17, 6, 18, 5]. We prove that conjugacy is the transitive closure of transposition and that
two elements of Q are conjugate if and only if their subsequences of write and of read
actions, respectively, are conjugate in the free monoid. This characterization allows in
particular to decide conjugacy in polynomial time. In section 7, we prove that the set of
solutions z ∈ Q of xz = zy is effectively rational but not necessarily recognizable.
Section 8 investigates algorithmic properties of rational subsets of Q. Algorithmic
aspects of rational subsets have received increased attention in recent years; see [14]
for a survey on the membership problem. Employing the fact that every element of Q
has only polynomially many left factors, we can nondeterministically solve the rational
subset membership problem in logarithmic space. Since the direct product of two free
monoids embeds into Q, all the negative results on rational transductions (cf. [1]) as,
e.g., the undecidability of universality of a rational subset, translate into our setting (cf.
Theorem 8.3). The subsequent section 9 characterizes the recognizable subsets of Q.
Recall that an element of Q is completely determined by its subsequences of write and
read actions, respectively, and the length of the shortest queue that can be transformed
without an error. Regular conditions on the subsequences of write and read actions,
respectively, lead to recognizable sets in Q. Regarding the shortest queue that can be
transformed without error, the situation is more complicated: the set of elements of Q
that operate error-free on the empty queue is not recognizable. Using an approximation
of the length of the shortest queue, we obtain recognizable subsets Ωk ⊆ Q. The announced characterization then states that a subset of Q is recognizable if and only if it
is a Boolean combination of regular conditions on the subsequences of write and read
actions, respectively, and sets Ωk (cf. Theorem 9.4). In the final section 10, we prove
that Q is not automatic in the sense of Thurston et al. [4] (it cannot be automatic in the
sense of Khoussainov and Nerode [12] since the free monoid with two generators is
interpretable in first order logic in Q).
All missing proofs are contained in the complete version [9] of this paper.
2 Preliminaries
Let A be an alphabet. As usual, the set of finite words over A, i.e. the free monoid
generated by A, is denoted A∗ . Let w = a1 . . . an ∈ A∗ be some word. The length
of w is |w| = n. The word obtained from w by reversing the order of its symbols is
wR = an . . . a1 . A word u ∈ A∗ is a prefix of w if there is v ∈ A∗ such that w = uv.
In this situation, the word v is unique and we refer to it by u−1 w. Similarly, u is a suffix
of w if w = vu for some v ∈ A∗ and we then put wu−1 = v. For k ∈ N, we let
A≤k = { w ∈ A∗ | |w| ≤ k } and define A>k similarly.
Let M be an arbitrary monoid. The concatenation of two subsets X, Y ⊆ M
is defined as X · Y = { xy | x ∈ X, y ∈ Y }. The Kleene iteration of X is the set
2
X ∗ = { x1 · · · xn | n ∈ N, x1 , . . . , xn ∈ X }. In fact, X ∗ is a submonoid of M , namely
the smallest submonoid entirely including X. Thus, X ∗ is also called the submonoid
generated by X. The monoid M is finitely generated, if there is some finite subset
X ⊆ M such that M = X ∗ .
A subset L ⊆ M is called rational if it can be constructed from the finite subsets of
M using union, concatenation, and Kleene iteration only. The subset L is recognizable
if there are a finite monoid F and a morphism φ : M → F such that φ−1 (φ(L)) =
L. The image of a rational set under a monoid morphism is again rational, whereas
recognizability is retained under preimages of morphisms. It is well-known that every
recognizable subset of a finitely generated monoid is rational. The converse implication
is in general false. However, if M is the free monoid generated by some alphabet A, a
subset L ⊆ A∗ is rational if and only if it is recognizable. In this situation, we call L
regular.
3 Definition and basic equations
We want to model the behavior of a fifo-queue whose entries come from a finite set A
with |A| ≥ 2 (if A is a singleton, the queue degenerates into a partially blind counter).
Consequently, the state of a valid queue is an element from A∗ . In order to have a
defined result even if a read action fails, we add the error state ⊥. The basic actions
are writing of the symbol a ∈ A into the queue (denoted a) and reading the symbol
a ∈ A from the queue (denoted a). Formally, A is a disjoint copy of A whose elements
are denoted a. Furthermore, we set Σ = A ∪ A. Hence, the free monoid Σ ∗ is the set
of sequences of basic actions and it acts on the set A∗ ∪ {⊥} by way of the function
. : (A∗ ∪ {⊥}) × Σ ∗ → A∗ ∪ {⊥}, which is defined as follows:
(
q ′ .u if q = aq ′
⊥.u = ⊥
q.ε = q
q.au = qa.u
q.au =
⊥
otherwise
for q ∈ A∗ , a ∈ A, and u ∈ Σ ∗ .
Example 3.1. Let the content of the queue be q = ab. Then ab.ac = b.c = bc.ε = bc
and ab.ca = abc.a = bc.ε = bc, i.e., the sequences of basic actions ac and ca behave
the same on the queue q = ab. In Lemma 3.5, we will see that this is the case for any
queue q ∈ A∗ ∪ {⊥}. Differently, we have ε.aa = ⊥ =
6 ε = ε.aa, i.e., the sequences
of basic actions aa and aa behave differently on certain queues.
Definition 3.2. Two words u, v ∈ Σ ∗ are equivalent if q.u = q.v for all queues q ∈ A∗ .
In that case, we write u ≡ v. The equivalence class wrt. ≡ containing the word u is
denoted [u].
Since ≡ is a congruence on the free monoid Σ ∗ , we can define the quotient monoid
Q = Σ ∗ /≡ and the natural epimorphism η : Σ ∗ → Q : w 7→ [w]. The monoid Q is
called the monoid of queue actions.
Remark 3.3. Note that the concrete form of Q depends on the size of the alphabet A,
so let Qn denote the monoid of queue actions defined with A = |n|. As a consequence
of Theorems 4.1 and 5.3 below, Qn embeds into Q2 where the generators of Qn are
mapped to [an+i ban−i b] and [an+i ban−i b], respectively.
3
Intuitively, the basic actions a and a act “dually” on A∗ ∪ {⊥}. We formalize this
intuition by means of the duality map δ : Σ ∗ → Σ ∗ , which is defined as follows:
δ(ε) = ε, δ(au) = δ(u)a, and δ(au) = δ(u)a for a ∈ A and u ∈ Σ ∗ . Notice that
δ(uv) = δ(v)δ(u) and δ(δ(u)) = u (i.e., δ is an anti-isomorphism and an involution).
In the following, we use the term “by duality” to refer to the proposition below.
Proposition 3.4. For u, v ∈ Σ ∗ , we have u ≡ v if and only if δ(u) ≡ δ(v).
Consequently, the duality map δ can be lifted to a map δ : Q → Q : [u] 7→ [δ(u)]. Also
this lifted map is an anti-isomorphism of Q and an involution.
The second equivalence in the lemma below follows from the first one by duality.
Lemma 3.5. Let a, b ∈ A. We have abb ≡ abb, aab ≡ aab, and if a 6= b then ab ≡ ba.
From the first and the last equivalence, we get abc ≡ acb for any a, b, c ∈ A, even when
b = c. Similarly, the second and the third equivalence imply abc ≡ bac.
Our computations in Q will frequently make use of alternating sequences of writeand read-operations on the queue. To simplify notation, we define the shuffle of two
words over A and over A as follows: Let a1 , a2 , . . . , an , b1 , b2 , . . . , bn ∈ A with v =
a1 a2 . . . an and w = b1 b2 . . . bn . We write w for b1 b2 . . . bn and set
hv, wi = a1 b1 a2 b2 . . . an bn .
The following proposition describes the relation between the shuffle operation and the
multiplication in Q. Its proof works by induction on the lengths of x and y.
Proposition 3.6. Let u, v, x, y, x′ , y ′ ∈ A∗ .
(1)
(2)
(3)
(4)
if xy = x′ y ′ and |x| = |y ′ | = |u|, then hu, xi y ≡ x′ u, y ′ .
if xy = x′ y ′ and |y| = |x′ | = |v|, then x hy, vi ≡ hx′ , vi y ′ .
If |u| = |v| and |x| = |y|, then x hu, vi y ≡ hxu, vyi.
If |x| = |y|, then hx, yi ≡ xy.
The first claim expresses that the sequence of write-operations u can be “moved along”
the sequence of read-operations xy = x′ y ′ , its dual (2) moves a sequence of readoperations v along a sequence of write-operations. The third claim expresses that writeoperations from the left and read-operations from the right can be “swallowed” by a
shuffle. The last one follows from (3) with u = v = ε.
Corollary 3.7. Let u, v, w ∈ A∗ . If |w| = |v|, then uvw ≡ vuw. If |u| = |v|, then
uvw ≡ uwv.
The first claim follows from vw ≡ hv, wi and the possibility to move v along the
sequence of read-operations uw, the second claim follows dually.
4
4 A semi-Thue system for Q
We order the equations from Lemma 3.5 as follows (with a 6= c):
abb → abb
aab → aab
ac → ca
Let R be the semi-Thue system with the above three types of rules. Note that a word
over Σ is irreducible if and only if it has the form u hv, vi w for some u, v, w ∈ A∗ .
When doing our calculations, we found it convenient to think in terms of pictures as
follows:
u
v
v
w
Here, the blocks represent the words u, v, v, and w, respectively, where we placed
the read-blocks (i.e., words over A) in the first line and write-blocks in the second. The
shuffle hv, vi is illustrated by placing the corresponding two blocks on top of each other.
Ordering the alphabet such that a < b for all a, b ∈ A, all rules are decreasing in
the length-lexicographic order; hence R is terminating. It is confluent since the only
overlap of left-hand sides have the form abbc. Consequently, for any u ∈ Σ ∗ , there is
∗
a unique irreducible word nf(u) with u −
→ nf(u). We call nf(u) the normal form of u
and denote the set of all normal forms by NF ⊆ Σ ∗ , i.e.,
∗
∗
NF = { nf(u) | u ∈ Σ ∗ } = A { aa | a ∈ A } A∗ .
By our construction of R from the equations in Lemma 3.5, nf(u) = nf(v) implies
u ≡ v for any words u, v ∈ Σ ∗ . For the converse implication, let u ≡ v. Because of
u ≡ nf(u), we can assume that u and v are in normal form, i.e., u = u1 hu2 , u2 i u3 and
v = v1 hv2 , v2 i v3 . Then one first shows u1 = v1 using q.u = q.v for q ∈ {u1 , v1 }.
The equation u2 = v2 follows from u1 = v1 and q.u = q.v for q ∈ {u1 u2 a, v1 v2 a}
for each a ∈ A (here we rely on the fact that |A| ≥ 2). Finally, u3 = v3 follows from
u1 = v1 , u2 = v2 , and u1 .u = u1 .v.
Consequently, u ≡ v and nf(u) = nf(v) are equivalent. Hence, the mapping
nf : Σ ∗ → NF can be lifted to a mapping nf : Q → NF by defining nf([u]) = nf(u). In
summary, we have the following theorem.
Theorem 4.1. The natural epimorphism η : Σ ∗ → Q maps the set NF bijectively
onto Q. The inverse of this bijection is the map nf : Q → NF.
Let π, π : Σ ∗ → A∗ be the morphisms defined by π(a) = π(a) = a and π(a) =
π(a) = ε for a ∈ A (i.e., π is the projection of a word over Σ to its subword over A, and
π is the projection to its subword over A, with all the bars deleted). By Theorem 4.1,
these two morphisms can be lifted to morphisms π, π : Q → A∗ by π([u]) = π(u) and
π([u]) = π(u).
Definition 4.2. Let w ∈ Σ ∗ be a word and nf(w) = x hy, yi z its normal form. The
overlap width of w and of [w] is the number ow(w) = ow([w]) = |y|.
By Theorem 4.1, q ∈ Q is uniquely determined by π(q), π(q), and ow(q). Let nf(q) =
x hy, yi y. Then x is the shortest queue w with w.q 6= ⊥. Furthermore, ow(q) = |π(q)|−
|x|. Hence, q is also uniquely described by the two projections and the length of the
shortest queue it transforms without error.
5
5 Multiplication
For two words u and v in normal form, we want to determine the normal form of uv.
For this, the concept of overlap of two words will be important:
Definition 5.1. For u, v ∈ A∗ , let ol(v, u) denote the longest suffix of v that is also a
prefix of u.
For example, ol(ab, bc) = b, ol(aba, aba) = aba, and ol(ab, cba) = ε. The follow∗
ing lemma describes the normal form of a word from A∗ A .
Lemma 5.2. Let u, v ∈ A∗ and set s = ol(v, u), r = vs−1 and t = s−1 u. Then
uv ≡ r hs, si t.
The equation uv ≡ r hs, si t can be visualized as follows:
v
u
r
≡
ol(v, u)
ol(v, u)
t
v
=
u
Our intuition is that the word v tries to slide along u to the left as far as possible. This
movement is stopped as soon as we reach a word in normal form (which, for the first
time, occurs when a suffix of v coincides with a prefix of u).
The proof of Lemma 5.2 first assumes |u| = |v| and proceeds by induction on this
length. The general case follows using Cor. 3.7. Applying Prop. 3.6(4), Cor. 3.7, and
Lemma 5.2, one gets rather immediately the following description of the normal form
of the product of two words in normal form.
Theorem 5.3. Let u1 , u2 , u3 , v1 , v2 , v3 ∈ A∗ and set s = ol(u2 v1 v2 , u2 u3 v2 ), r =
u2 v1 v2 s−1 , and t = s−1 u2 u3 v2 . Then
u1 hu2 , u2 i u3 · v1 hv2 , v2 i v3 ≡ u1 r hs, si tv3 .
This theorem can be visualized as follows:
u1
u2
u2
≡
=
u1
u1
u3
r
·
v1
v2
v2
ol(u2 v1 v2 , u2 u3 v2 )
ol(u2 v1 v2 , u2 u3 v2 )
v3
t
v3
u2 v 1 v 2
u2 u3 v 2
v3
Here, first, v2 moves to the left until it reaches the right border of u3 . Then u2 moves to
the right until it reaches the left border of v1 . Finally, the united block u2 v1 v2 tries to
slide to the left along u2 u3 v2 until a normal form is reached.
6
6 Conjugacy
The conjugacy relation in groups has two natural generalizations to monoids, which,
when considered in Q, we determine in this section. Let M be a monoid and p, q ∈ M .
Then p and q are conjugate, which we denote by p ≈ q, if there exists x ∈ M such that
px = xq. Furthermore, p and q are transposed, denoted by p ∼ q, if there are x, y ∈ M
∗
with p = xy and q = yx. Moreover, ∼ is the transitive closure of ∼.
Observe that ≈ is reflexive and transitive whereas ∼ is reflexive and symmetric,
and ∼ ⊆ ≈. If M is actually a group, then both relations coincide and are equivalence
relations, called conjugacy. The same is true for free monoids [15, Prop. 1.3.4] and even
for special monoids [18], but there are monoids where none of this holds.
Example 6.1. Let u, v, w ∈ A∗ . Then u hv, vi w ≡ uvvw ≡ vuvw. Consequently,
∗
∗
∗
∗
Q = η(A∗ A A∗ ) and dually Q = η(A A∗ A ). Furthermore, vuvw ∼ uvwv. Hence,
∗
∗
for every q ∈ Q, there exists q ′ ∈ η(A A∗ ) with q ∼ q ′ , i.e., Q is the closure of
∗
η(A A∗ ) under transposition.
Theorem 6.2. For any p, q ∈ Q, the following are equivalent:
∗
(1) p ∼ q
(2) p ≈ q
(4) (π(p) ∼ π(q) and π(p) ∼ π(q))
(3) q ≈ p
The implication (1) ⇒ (2) holds in every monoid since ≈ is transitive and since ∼ ⊆ ≈.
The implication (2) ⇒ (4) holds since π and π are homomorphisms and since ≈, ∼, and
∗
∼ coincide on the free monoid. To show (4) ⇒ (1), we first invoke Example 6.1: we can
∗
assume p = [π(p)π(p)] and similarly for q. The crucial step is to show [xay] ∼ [xya]
∗
and [axy] ∼ [xay], i.e., that one can rotate a single letter in the read-part or in the writepart. This ensures the implication (4) ⇒ (1). Since (2) and (4) are equivalent and since
∼ is symmetric on the free monoid, also the equivalence of (2) and (3) follows.
We obtain the following consequence of Theorem 6.2: Given two words u, v ∈ Σ ∗ , one
can decide in quadratic time whether π(u) ∼ π(v) and π(u) ∼ π(v). Consequently, it
is decidable in polynomial time whether [u] ≈ [v] holds. It remains an open question
∗
k
whether there is some number k ∈ N such that p ∼ q if and only if p ∼ q.
7 Conjugators
Let M be a monoid and x, y ∈ M . An element z ∈ M is a conjugator of x and y if xz =
zy. The set of all conjugators of x and y is denoted C(x, y) = { z ∈ M | xz = zy }.
Suppose that M is a free monoid A∗ and consider x, y ∈ A∗ . It is well-known that
C(x, y) is a finite union of sets of the form u(vu)∗ and hence regular. In contrast, the
set of conjugators of [a] and [a] is not recognizable since η −1 (C([a], [a])) ∩ a∗ a∗ =
{ ak aℓ | k ≤ ℓ }. In this section, we prove the following weaker result:
Theorem 7.1. Let x, y ∈ Q. Then the set C(x, y) is rational.
7
The proof proceeds as follows: First note that, by Theorem 4.1, xz = zy if and only
if π(xz) = π(zy), π(xz) = π(zy), and ow(xz) = ow(zy). The set D(x, y) of all
z ∈ Q satisfying the first two conditions is recognizable (since x and y are fixed) and it
remains to handle the third condition (under the assumption that the first two hold).
The crucial point in the proof of Theorem 7.1 is the regularity of the language
Gk = { nf(z) | z ∈ D(x, y), ow(xz) − ow(z) ≥ k } .
Having this, it follows that the languages
Ek = { nf(z) | z ∈ D(x, y), ow(xz) − ow(z) = k } and
Fk = { nf(z) | z ∈ D(x, y), ow(zy) − ow(z) = k }
are regular. Consequently, the language
[
Ek ∩ F k
0≤k≤|π(x)|
is regular. Since one can also show that 0 ≤ ow(xz) − ow(z) ≤ |π(x)| for z ∈ D(x, y),
this language equals the language of all words nf(z) with z ∈ C(x, y). Hence C(x, y)
is the image wrt. the natural epimorphism η of a regular language and therefore rational.
8 Rational subsets
This section studies decision problems concerning rational subsets of Q.
Let w ∈ Σ ∗ . Then, by Theorem 5.3, the number of left-divisors of [w] in Q is
at most |w|3 . This allows to define a DFA with |w|3 many states that recognizes the
language [w] = { u ∈ Σ ∗ | u ≡ w }. Even more, this DFA can be constructed in logarithmic space. This fact allows to reduce the problem below in logarithmic space to the
intersection problem of NFAs. Hence we get the following result, where completeness
follows since A∗ embeds into Q:
Theorem 8.1. The following rational subset membership problem for Q is NL-complete:
Input: A word w ∈ Σ ∗ and an NFA A over Σ.
Question: Is there a word v ∈ L(A) with w ≡ v?
We do not have a description of the submonoids of Q, but we get the following embedding of the direct product of two free monoids.
Proposition 8.2. Let R ⊆ Q denote the submonoid generated by {[a], [ab], [b], [abb]}.
(1) There exists an isomorphism α from {a, b}∗ × {c, d}∗ onto R with α((a, ε)) = [a],
α((b, ε)) = [ab], α((ε, c)) = [b], and α((ε, d)) = [abb].
(2) If S ⊆ R is recognizable in R, then it is recognizable in Q.
The proof makes heavy use of Theorem 4.1. This proposition implies in particular that
rational transductions can be translated into rational subsets of Q, resulting in the following undecidability results:
8
Theorem 8.3. (1) The set of rational subsets of Q is not closed under intersection.
(2) The emptiness of the intersection of two rational subsets of Q is undecidable.
(3) The universality of a rational subset of Q is undecidable.
Consequently, inclusion and equality of rational subsets are undecidable.
(4) The recognizability of a rational subset of Q is undecidable.
We sketch the proof of statement (3), the other claims are proved along similar lines:
Let S ⊆ {a, b}∗ × {c, d}∗ be rational. Then α(S) is rational. Due to Prop. 8.2 (2), the
set R is recognizable in Q. Thus, Q\R is recognizable and therefore, since Q is finitely
generated, rational. Consequently, α(S) ∪ Q \ R is rational as well. This rational set
equals Q if and only if α(S) = R, i.e., S = {a, b}∗ × {c, d}∗ . But this latter question
is undecidable by [1, Theorem 8.4(iv)].
9 Recognizable subsets
In this section, we aim to describe the recognizable subsets of Q. Clearly, sets of the
form π −1 (L) or π −1 (L) for some regular L ⊆ A∗ as well as Boolean combinations
thereof are recognizable. This does not suffice to produce all recognizable subsets: for
instance, the singleton set {[aa]} is recognizable but any Boolean combination of inverse projections containing [aa] also includes [aa]. However, we will see in the main
result of this section, namely Theorem 9.4, that incorporating certain sets that can impose a simple restriction on relative positions of write and read symbols suffices to
generate the recognizable sets as a Boolean algebra.
Recall that any q ∈ Q is completely determined by π(q), π(q), and ow(q). Consequently, it would seem natural to incorporate sets which restrict the overlap width.
Unfortunately, this does not work since the set of all q ∈ Q with ow(q) = k is not
recognizable (for any k ∈ N).
Nevertheless, the subsequent definition provides a slight variation of this idea which
conduces to our purpose. To simplify notation, we say two elements p, q ∈ Q have the
same projections and write p ∼π q if π(p) = π(q) and π(p) = π(q).
Definition 9.1. For each k ∈ N, the set Ωk ⊆ Q is given by
Ωk = { q ∈ Q | ∀p ∈ Q : p ∼π q & ow(q) ≤ ow(p) ≤ k =⇒ p = q } .
Observe that Q = Ω0 ⊇ Ω1 ⊇ Ω2 ⊇ . . . . Intuitively, for fixed projections π(q) and
π(q) the set Ωk contains all q with ow(q) ≥ k as well as the unique q with maximal
ow(q) ≤ k.
Example 9.2. (1) The queue action q = [abaaba] satisfies ow(q) = 1 and hence q ∈
Ω1 . The only p ∈ Q with p ∼π q and ow(p) ≥ ow(q) is p = [aabbaa]. Since
ow(p) = 3, this implies q ∈ Ω2 but q 6∈ Ω3 .
(2) For every k ≥ 1, we have [(aa)k ] ∈ Ωk−1 \ Ωk .
(3) All queue actions of the form q = [uv] with u, v ∈ A∗ satisfy q ∈ Ωk for every
k ∈ N.
9
Remark 9.3. We know that q ∈ Q is uniquely described by π(q), π(q), and ow(q).
Somewhat surprisingly, we still have a unique description of q if we replace ow(q) by
the maximal k ∈ N with q ∈ Ωk or the fact that there is no such maximum.
The aforementioned main result characterizing the recognizable subsets of Q is the
following.
Theorem 9.4. For every subset L ⊆ Q, the following are equivalent:
(1)
(2)
(3)
(4)
L is recognizable,
∗
L is wrw-recognizable, i.e., the language η −1 (L) ∩ A∗ A A∗ is regular,
∗
∗
η −1 (L) ∩ A A∗ A is regular,
L is simple, i.e., a Boolean combination of sets of the form π −1 (R) or π −1 (R) for
some regular R ⊆ A∗ and the sets Ωk for k ∈ N.
The implication “(1)⇒(2)” is trivial. Regarding wrw-recognizability note that L =
∗
∗
η(η −1 (L) ∩ A∗ A A∗ ) by Example 6.1, i.e., the language η −1 (L) ∩ A∗ A A∗ describes
∗
∗
the set L completely. This is not the case if we replace A∗ A A∗ by A∗ A : The set
n
L = { [a aaan ] | n ≥ 1 } is not recognizable, since the set of its normal forms is not
∗
regular. However, η −1 (L) ∩ A∗ A is empty and hence regular.
Note that the implication“(4)⇒(1)” follows easily from the following result:
Proposition 9.5. For each k ∈ N, the set η −1 (Ωk ) is regular.
The crucial point in its proof is the following characterization of the language η(Ωk ):
w ∈ Σ ∗ belongs η −1 (Ωk ) if and only if, for every u ∈ A≤k , one of the following holds:
1. u is no prefix of π(w) or
2. u is no suffix of π(w) or
3. the ith write symbol in w appears before the ith of the last |u| read symbols (for all
1 ≤ i ≤ |u|).
As an illustration, aababaaa belongs to η −1 (Ω3 ) and aababaaa does not. For every u ∈
A≤k the language of words w satisfying one of the above three conditions is regular.
Hence η −1 (Ωk ) is the intersection of finitely many regular languages and therefore
regular.
The implication “(2)⇒(4)” of Theorem 9.4 is the following:
Proposition 9.6. If L ⊆ Q is wrw-recognizable, then it is simple.
Proof idea. Let k be the number of elements of the syntactic monoid of η −1 (L) ∩
∗
A∗ A A∗ . Consider the following partition of L:
[ L = L ∩ π −1 A<k ∩ Ωk ∪ L ∩ π −1 A≥k ∩ Ωk ∪
L ∩ Ωℓ \ Ωℓ+1 .
0≤ℓ<k
One can show that all the parts
are simple; we indicate how this is done for the first part,
i.e., the set L ∩ π −1 A<k ∩ Ωk :
10
∗
Let K = η −1 (L) ∩ A∗ A A∗ and φ : Σ ∗ → M be a morphism recognizing K.
We further consider the morphisms µ, µ : A∗ → M defined by µ(w) = φ(w) and
µ(w) = φ(w). We show the claim by establishing the equation
[
L ∩ π −1 A<k ∩ Ωk =
π −1 (u) ∩ π −1 µ−1 (m) ∩ Ωk .
u∈A<k ,m∈M
µ(u)m∈φ(K)
Let X and Y denote the left and right hand side of this equation,
respectively. Clearly,
X, Y ⊆ π −1 A<k ∩ Ωk . Consider some q ∈ π −1 A<k ∩ Ωk . It suffices to show
that q ∈ X precisely if q ∈ Y .
To this end, let u = π(q). Then |u| < k. Using u ∈ Ωk , one can show that there is
p ∈ Q such that q = [u] p. Clearly, π(p) = ε, i.e., p = [y] for some y ∈ A∗ . Notice that
q = [uy]. Altogether,
q∈X
⇐⇒
q = [uy] ∈ L
⇐⇒
φ(uy) = µ (u) µ (π(q)) ∈ φ(K)
⇐⇒
q∈Y .
The simplicity of the other sets is shown using similar arguments.
Since the implication “(1)⇒(2)” in Theorem 9.4 is trivial, we have the equivalence
of (1), (2), and (4). Claim (3) can be added using duality arguments.
10
Thurston-automaticity
Many groups of interest in combinatorial group theory turned out to be Thurstonautomatic [4]. The more general concept of a Thurston-automatic semigroup was introduced in [3]. In this chapter, we prove that the monoid of queue-actions Q does not
fall into this class.
Let M be a monoid, Γ an alphabet, θ : Γ + → M a semigroup morphism, and
L ⊆ Γ + . The triple (Γ, θ, L) is an automatic structure for the monoid M if θ maps L
bijectively onto M , if the language L is regular and if the relations
La = (u, v) ∈ L2 θ(ua) = θ(v) ⊆ L2
are synchronously rational (i.e., accepted by a synchronous transducer, cf. [1, 8]) for all
a ∈ Γ .3 A monoid is Thurston-automatic if it has some automatic structure.
Theorem 10.1. The monoid of queue actions Q is not Thurston-automatic.
Proof idea. Suppose Q is Thurston-automatic. By [7], there exists an automatic structure (Σ ∪ {ι}, θ, L) for Q with θ(a) = [a], θ(a) = [a] for a ∈ A, and θ(ι) = [ε]. For
m, n ∈ N, let um,n ∈ L be the unique word with θ(um,n ) = [am an ]. By Theorem 5.3,
there are precisely min(m, n) + 1 many q ∈ Q with [am an b] = q[b]. It follows that
this is the number of words w ∈ L with um,n b ≡ wb. Since the set of pairs (um,n , w)
satisfying this equation (with m, n ∈ N and w ∈ (Σ ∪ {ι})∗ ) is synchronously rational
3
This is not the original definition from [3], but it is equivalent by [3, Prop. 5.4].
11
[3], one can construct a nondeterministic finite automaton A with min(m, n) + 1 many
runs on any word of the form am an . This then leads to a contradiction.
⊓
⊔
Recently, the notion of an automatic group has been extended to that of Cayley
graph automatic groups [11]. This notion can easily be extended to monoids. It is not
clear whether the monoid Q is Cayley graph automatic. A way to disprove this would
be to show that the elementary theory of its Cayley graph is undecidable.
Note that Q is not automatic in the sense of Khoussainov and Nerode [12]: This is
due to the fact that η(A∗ ) is isomorphic to A∗ and an element of Q is in η(A∗ ) if and
only if it cannot be written as ras for r, s ∈ Q and a ∈ A. Hence, using the a for a ∈ A
as parameters, A∗ is interpretable in first order logic in Q. Therefore, since A∗ is not
automatic in this sense [2], neither is Q [12].
References
1. J. Berstel. Transductions and context-free languages. Teubner Studienbücher, Stuttgart,
1979.
2. A. Blumensath and E. Grädel. Finite presentations of infinite structures: Automata and interpretations. ACM Transactions on Computer Systems, 37(6):641–674, 2004.
3. C. M. Campbell, E. F. Robertson, N. Ruškuc, and Richard M. Thomas. Automatic semigroups. Theoretical Computer Science, 250(1-2):365–391, 2001.
4. J. W. Cannon, D. B. A. Epstein, D. F. Holt, S. V. F. Levy, M. S. Paterson, and W. P. Thurston.
Word processing in groups. Jones and Barlett Publ., Boston, MA, 1992.
5. Ch. Choffrut. Conjugacy in free inverse monoids. Int. J. Algebra Comput., 3(2):169–188,
1993.
6. C. Duboc. On some equations in free partially commutative monoids. Theoretical Computer
Science, 46:159–174, 1986.
7. A. J. Duncan, E. F. Robertson, and N. Ruškuc. Automatic monoids and change of generators.
Mathematical Proceedings of the Cambridge Philosophical Society, 127:403–409, 11 1999.
8. Ch. Frougny and J. Sakarovitch. Synchronized rational relations of finite and infinite words.
Theoretical Computer Science, 108:45–82, 1993.
9. M. Huschenbett, D. Kuske, and G. Zetzsche. The monoid of queue actions. preprint
arXiv:1404.5479, 2014.
10. M. Kambites. Formal languages and groups as memory. Communications in Algebra,
37:193–208, 2009.
11. O. Kharlampovich, B. Khoussainov, and A. Miasnikov. From automatic structures to automatic groups. preprint arXiv:1107.3645, 2011.
12. B. Khoussainov and A. Nerode. Automatic presentations of structures. In Logic and Computational Complexity, Lecture Notes in Comp. Science vol. 960, pages 367–392. Springer,
1995.
13. A. Lentin and M.-P. Schützenberger. A combinatorial problem in the theory of free monoids.
In Combin. Math. Appl., Proc. Conf. Univ. North Carolina 1967, pages 128–144, 1969.
14. M. Lohrey. The rational subset membership problem for groups: A survey, 2013. To appear.
15. M. Lothaire. Combinatorics on Words, volume 17 of Encyclopedia of Mathematics and its
Applications. Addison-Wesley, 1983.
16. V. A. Osipova. On the conjugacy problem in semigroups. Proc. Steklov Inst. Math., 133:169–
182, 1973.
17. F. Otto. Conjugacy in monoids with a special Church-Rosser presentation is decidable.
Semigroup forum, 29:223–240, 1984.
18. L. Zhang. Conjugacy in special monoids. J. of Algebra, 143(2):487–497, 1991.
12
© Copyright 2026 Paperzz