Abstract 1 Introduction 2 Set Automata 3 Equivalence of Set Automata and 𝐅𝐎𝟐 with Guarded Regular Predicates 4 Decidability & Undecidability Results on 𝐅𝐎𝟐 with Guarded Regular Predicates 5 Discussion 6 Conclusion References Appendix A Appendix

Set Automata and Limits of Decidability of Two-Variable Logic on Data Words

Shibashis Guha ORCID Tata Institute of Fundamental Research, Mumbai, India    Amaldev Manuel ORCID Indian Institute of Technology Goa, India    S P Rishal ORCID Sarva Labs, Lewes, DE, USA
Abstract

We extend the two-variable logic on data words [4] with guarded regular binary predicates of the form L~(x,y) that is true if positions x and y have the same data value and the factor strictly between x and y is in the regular language L. We characterise the class of aperiodic monoids for which the extension of the two-variable logic with guarded predicates recognised by the monoid is decidable, namely the class of idempotent monoids whose two-sided ideals are linearly ordered, called linear bands. For this, we introduce an automata formalism, set automata, that is equivalent to the class automata of Bojańczyk and Lasota and thus has an undecidable emptiness problem. The set updates used in the automaton form a semigroup of relations. We identify a subclass of set automata called ordered quasi-normal set automata that has a decidable emptiness problem by reduction to the emptiness problem of ordered multicounter automata. We show that the two-variable logic extended with guarded regular predicates recognised by a monoid M is expressively equivalent to a quasi-normal set automaton with the monoid of relations M. In particular, if M is a linear band then the resulting automaton is ordered, and the decidability result follows.

Keywords and phrases:
Data words, Two-variable FO, Class automata, Finite semigroups, Decidability
Category:
Track B: Automata, Logic, Semantics, and Theory of Programming
Funding:
Shibashis Guha: Partially supported by CEFIPRA project no. 7302-I and by the Department of Atomic Energy, Government of India, under project no. RTI4014.
Copyright and License:
[Uncaptioned image] © Shibashis Guha, Amaldev Manuel, and S. P. Rishal; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic and verification
; Theory of computation Formal languages and automata theory
Related Version:
Full Version: http://arxiv.org/abs/2605.09077 [13]
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

A data word is a finite sequence of pairs (ai,di)Σ×𝒟 where Σ is a finite alphabet and 𝒟 is an infinite domain of data values that can be tested only for equality. A set of data words L is called a data language. In most cases (including this work) L is assumed to be closed under permutations of the set 𝒟, that is, every occurrence of some data value di can be replaced with another data value djdi as long as such a mapping is a permutation. Thus the specific data values considered are not important to the study and we only capture properties involving equality of data values. For our purposes, L can be represented as a collection of relational first-order structures of the form ([n],(a)aΣ,<,+1,1) where [n] and < denote the set {1,,n} and the natural order on it, the unary predicates (a)aΣ denotes the labelling by Σ, and is the equivalence relation on positions given by data values, i.e., ij if di=dj. The relation 1 denotes the class successor relation, i.e., i1=j, if ij and the positions strictly between i and j are not equivalent to them. The class of i is the equivalence class of i under the relation , i.e., the set of all positions labelled with the data value di.

The primary direction in the study of data words has been identifying suitable notions of automata and logics for them (See [21, 2] and the survey [25]). The models and logics in the literature can broadly be classified into two families: temporal logics (correspondingly, the register automata family) and first-order logics (data automata family). The prominent member of the first family is the freeze-LTL (i.e., LTL with registers) of [10], while the most important logic of the latter is the two-variable first-order logic of [4]. In this work we present a decidable, strict extension of the two-variable logic that incorporates some aspects of temporal logics. First we recall the two-variable logic in some detail.

For a vocabulary τ of unary and binary predicates let FO2[τ] denote the first-order formulas using the predicates from τ and the variables x and y. The logic EMSO2[τ] consists of formulas of the form X1Xnφ with φFO2[X¯,τ], where X¯ stands for the monadic second-order predicates X1,,Xn that quantify over sets of positions. Certainly, it is natural to consider the first-order logic (FO) with the vocabulary (Σ,<,) on data words. However, as one would expect, the satisfiability problem of the logic FO[Σ,<,] is undecidable [4]. The undecidability persists even if the number of variables is restricted to three. This prompted the study of the two-variable fragment of the logic. It is shown in [4] that the satisfiability problem of EMSO2[Σ,<,+1,,1] is decidable over data words in non-elementary time. The proof is by translating the formulas into an automaton formalism called data automata and showing the decidability of the emptiness problem of data automata. As far as the study of logics over data words is concerned this result is a milestone and despite nearly two decades of active research, FO2 remains as one of the yardstick logics with which any new formalism is measured.

Next we look at some examples. The string projection of a data word w is the word str(w)=a1an. Let 1i1<i2<<ikn be a class of w. The string projection of this class is the word u=ai1aik. We say u is a class of w to mean a class whose string projection is u.

Example 1.

Let Σ={ι,δ,z}. We can think of ι and δ as increments and decrements of a counter and z as a zero-test.

  1. 1.

    Let L1 be the set of all data words where each class is of the form ιδ or z. This language is defined by the formula φ1 where

    φ1 :=xy(x<yxyι(x)δ(y))((xyx=y)z(x)) (1)
  2. 2.

    Let L2 consist of all data words satisfying the property: there is no position labelled by z between each ι and δ of the same class. Note that z could be in a different class than that of the ι and δ.

The language L2 is not definable in FO2 as noted in [25]. In fact it is not recognised by the data automata of [4], that is equivalent to the logic EMSO2[Σ,<,x+1,,1]. However, L2 is definable in freeze-LTL with only forward-looking modalities (Next and Until), a logic with a decidable satisfiability problem (as a trade-off this logic cannot define L1, see [25]).

To define L2 in FO2, we extend the two-variable logic with the below predicates.

Definition 2 (Regular Predicate).

A regular predicate over the alphabet Σ is a binary relation of the form L(x,y) where LΣ is a regular language. A data word w with the string projection 𝑠𝑡𝑟(w)=a1anΣ at the pair of positions (i,j), for i,j[n], satisfies the predicate L(x,y) if i<j and the factor ai+1aj1 given by the interval (i,j) is in L. A guarded regular predicate L~(x,y) is equivalent to the formula xyL(x,y).

For a regular expression r, let r denote the language defined by it. Using regular predicates, the language L2 can be defined in FO2 by the below formula.

xy((ι(x)δ(y)δ(x)ι(y))xy¬ΣzΣ~(x,y)). (2)

The below example illustrates that adding regular predicates to the vocabulary leads to undecidability even when relatively simple regular predicates are used.

Example 3.

Let Σ={ι1,δ1,z1,ι2,δ2,z2}. We can think of the alphabet as encoding the increments, decrements, and zero-tests of a two-counter machine.

  1. 1.

    Let L3 be the set of all data words satisfying the following property: each class is of the form ιiδi or zi, i{1,2}. Clearly L3 is in FO2[Σ,<,+1,].

  2. 2.

    Let L4 consist of all data words satisfying the following property: for each i{1,2}, there is no position labelled by zi between each ιi and δi of the same class.

From Formula 2, it is not difficult to see that L4 is definable in FO2 using the guarded regular predicates defined by the languages Σz1Σ and Σz2Σ. This is sufficient to encode the run of a two-counter machine as a data word.

The algebraic theory of regular languages where the semigroup recognising a language is considered, allows for properties of regular languages to be understood through the structure of the semigroup recognising it. Motivated by this, in our logic we consider families of regular predicates defined by a semigroup recognising it.

A semigroup S is a set with an associative binary operation. It is a monoid if the operation has an identity, denoted by 1. All semigroups we consider in this paper are either finite or free semigroups of the form Σ. Let M be a finite monoid. A morphism h:ΣM is a map satisfying h(ab)=h(a)h(b) and h(ε)=1. A language LΣ is recognised by a morphism g:ΣM, where M is a finite monoid, if there is a finite subset PM such that L=h1(P). We also consider semigroups recognising languages. Let S be a finite semigroup and S1 be the monoid obtained by adjoining an identity 1 to S. The monoid morphism h:ΣS1 is unit-reflecting if h1(1)=ε. We say a language LΣ is recognised by S if it is recognised by a unit-reflecting morphism into S1. A monoid M recognises a family of languages over Σ if there is a morphism h:ΣM that recognises each language in the family. Definitions of other semigroup-theoretic notions required for our purposes can be found in Appendix A.

Let h:ΣM be a morphism. The logic FO2[Σ,<,+1,,1,h] is the extension of the logic with the family h of all regular predicates recognised by h. For a monoid M, by FO2[Σ,<,+1,,1,M] we denote the set of formulas φFO2[Σ,<,+1,,1,h] for some morphism h:ΣM. The logics FO2[Σ,<,+1,,1,~h] and FO2[Σ,<,+1,,1,~M] are defined analogously where the predicates ~h used are guarded. The above definitions extend naturally to semigroups and unit-reflecting morphisms. Now, we introduce the EMSO2 extension of the above logics. For instance, a formula is in EMSO2[Σ,<,+1,,1,h] if it is of the form X1Xnφ where φFO2[X¯,Σ,<,+1,,1,h] and X¯ stands for the monadic second-order predicates X1,,Xn. Note that the morphism h:Σ×{0,1}nM, for some finite monoid M, maps words over the extended alphabet that indicates the interpretations of the n variables in X¯.

Example 4.

The language family {ΣzΣ} from Equation 2 is recognised by the two element monoid with a zero U1={1,0} under the usual product operation, with the morphism z0 and ι,δ1 and accepting set P={0}. However, the family ={Σz1Σ,Σz2Σ} is not recognisable by the monoid U1 as both languages cannot be recognised by the same morphism. However is recognised by the product monoid U12=U1×U1={(1,1),(1,0),(0,1),(0,0)}. under the morphism z1(0,1), z2(1,0) with the accepting sets {(0,1),(0,0)} and {(1,0),(0,0)} respectively.

A key difference in the structure of the two monoids above is that in U1, the two-sided ideals (See Definition 44) are linearly ordered while it is not the case in U12 (See Figure 2 and Example 28). Motivated by this, we consider the class of linear bands, namely the class of idempotent monoids M whose two-sided ideals are linearly ordered, that is, for each x,yM, we have MxMMyM or MyMMxM. The idempotency restriction follows from another such language that leads to undecidability (See Proposition 36).

The below example illustrates how guarded regular predicates defined by a semigroup can be used to capture a previously known decidable logic given in [4].

Example 5 (Nilpotent Predicates).

Consider the monoid {0,1,,n1,},n1 with the below operation where x+y is the usual addition over natural numbers.

xy={x+yif x,y{0,1,,n1} and x+y<n,otherwise.

The unique morphism given by the map g:Σ1 (and g:Σ if n=1) recognises the family of languages {Σi0in1}{Σn}. Thus the logic FO2[Σ,<,,g]FO2[Σ,<,+1,+2,+3,,+n,] where +k is a generalisation of the successor relation +1 on positions. The decidability of the latter logic is shown in [4].

Our Contributions

Our main result is as follows.

Theorem 5.

Let M be a finite aperiodic monoid. Satisfiability of EMSO2[Σ,<,+1,, 1,~M] formulas over data words is decidable if and only if M is a linear band.

Our decidable fragment is a strict extension of the FO2 of [4] as the language L2 of Example 1 is definable in the decidable fragment of Section 1 but not in the FO2 of [4]. The guardedness of the regular predicates does not impose a restriction on the expressibility in the following sense: for every formula in EMSO2[Σ,<,+1,,1,M] with regular predicates recognised by a monoid M there is an equivalent formula in EMSO2[Σ,<,+1,,1,~M] with guarded regular predicates recognised by another monoid M. We state our results for the guarded fragment.

To show decidability of the logic, we employ a new automaton formalism called set automata. A set automaton 𝒜 is a finite state automaton with a fixed number of sets X={X1,,Xk} that can store data values. During the run, the automaton can add or remove the current data value from the sets as well as assign a union of sets to each set (i.e. of the form Xi=jJXj for J[k]). The latter kind of updates can be represented as an element of a semigroup of relations on the sets. The acceptance of a run is determined by the state as well as the sets in which the data values are present at the end of the run. The set automaton model is equivalent to the class automata of [6] and is thus undecidable. Furthermore, for each data automaton there is an equivalent set automaton where the only set update used is the identity relation.

We identify a subclass of set automata with decidable emptiness, called ordered quasi-normal set automata. The decidability of emptiness of ordered quasi-normal set automata is shown by a reduction to the emptiness problem of ordered multicounter automata which is known to be decidable [24]. The complexity of the decision procedures for the logic EMSO2[Σ,<,+1,,1,~M] and set automata are non-elementary and is inherited from FO2[Σ,<,+1,] and data automata.

We obtain decidability of the logic by converting EMSO2[Σ,<,+1,,1,~M] formulas where M is a linear band to ordered quasi-normal set automata. To show undecidability of the logic when M is not a linear band, we use a reduction from the halting problem of two-counter machines which is known to be undecidable [20].

Related Work

Automata on Data Words.

There exists numerous extensions of finite state automata with registers [15], pebbles [21], hash tables [2], counters [19], sets [1, 14], etc. to handle data values (See the survey [25]). The bibliography is extensive and we mention only those relevant to our work. Register automata [15] and its variants [21, 10, 5] equip finite state automata with a fixed number of registers for storing data values and compare them by equality. Set augmented finite automata [1], register set automata [14], and history register automata [11] are generalisations of register automata with unbounded registers (or sets in our terminology). The latter two are equivalent to set automata except for the acceptance conditions. Class automata [6] are closely related to data automata and are expressively equivalent to set automata. A subclass of class automata captures the alternating one register automata of [10]. The decidable subclass presented in our work was previously unknown.

Logics on Data Words.

As for FO2 on data words, the results in [4] are already mentioned. The related, but weaker logic EMSO2(Σ,,+1) was studied in [16]. It was shown to be equivalent to a semantic restriction of data automata, called weak data automata. A weakening of MSO logic with data equality tests called rigidly guarded MSO was introduced in [7]. It was shown that it is as expressive as orbit-finite data monoids [3] and its satisfiability is decidable. A μ-calculus that has modalities corresponding to successor, predecessor, class successor and class predecessor relations was introduced in [8].

Regular Predicates.

Extending logics with regular predicates or modalities is an idea that dates back to [26] and has been used in a number of contexts ever since, see [18, 9]. The relationship between FO2 with regular predicates and unary regular temporal logic on words is studied in [23].

Organisation of the Paper

In Section 2 we introduce set automata and its various restrictions namely normal, quasi-normal, and ordered set automata. We also prove the necessary closure properties required to translate EMSO2 formulas with guarded regular predicates to quasi-normal set automata. Subsequently, in Section 3 we establish the automata-logic connection. Section 4 details the decidability and undecidability results on EMSO2 with guarded predicates. Section 5 discusses comparisons of set automata with data automata and class automata, and provides a logical characterisation of set automata. In Section 6 we conclude with some open questions and future directions. Standard facts from the theory of Green’s relations on finite semigroups, and definitions of basic relations like preorder, partial order, and other related notions are given in Appendix A. To improve readability, we have omitted some proofs that are provided in the full version [13].

2 Set Automata

In this section, we introduce set automata, and the subclasses normal, quasi-normal, and ordered set automata. As our main result, we show that the emptiness problem of ordered quasi-normal set automata is decidable.

2.1 Relations and Transformations

For k>0, let [k] denote the set {1,,k}. The set of Boolean values is denoted by 𝟚={0,1}. Let Y be a finite ordered set. The power set of Y is denoted as 𝒫(Y). A Boolean column vector u¯=(uy)yY indexed by Y is an element of 𝟚Y. For a subset YY, the restriction of u¯ to Y is given by u¯Y=(uy)yY. The set of column vectors over 𝟚 indexed by Y is denoted by 𝟚Y. The Boolean operations can be extended to elements of 𝟚Y pointwise. For u𝟚Y, we denote by uc=(1uy)yY the complement of u. For yY, let ey𝟚Y denote the vector whose y-component is 1 and all other components are 0. The vectors {eyyY} are called unit vectors.

Let S be a set. For a subset XS, let 𝟏X:S𝟚 denote the characteristic function given by 𝟏X(x)=1 if xX and 𝟏X(x)=0 otherwise. Extending this notation, for X¯=(Xy)yY𝒫(S)Y a vector of subsets of S indexed by Y, let 𝟏X¯:S𝟚Y denote the function x(𝟏Xy(x))yY. The vector 𝟏X¯(x) is called the characteristic vector of x in X¯.

A binary relation ρ on a set Y is a subset of the cartesian product Y×Y. We simply write relation instead of binary relation. The converse of a relation ρ is the relation ρ1={(y,x)(x,y)ρ} where the order is switched. For a subset YY, the restriction of ρ to Y is ρY=ρ(Y×Y). The image of an element xY under the relation ρ is the set ρ(x)Y given by ρ(x)={yY(x,y)ρ}. Similarly, the image of a subset S of Y under the relation is given by ρ(S)=xSρ(x). A transformation on a set is a function from the set to itself. A bijective transformation is called a permutation. Given relations ρ and σ on the set Y, their product ρσ is given by ρσ={(x,z)Y×YyY,(x,y)ρ,(y,z)σ}.

Example 6.

Let ρ={(0,0),(0,1),(1,1)} and σ={(0,0),(1,0)} be relations on the set {0,1}. Then ρσ={(0,0),(1,0)} and σρ={(0,0),(0,1),(1,0),(1,1)}.

The omission of to denote the product operation is intentional. When ρ and σ are functions then their function composition ρσ is the function ρσ=σρ that is different from their product ρσ. The product of relations is an associative operation and the relations on a set Y form a monoid with the identity function idY={(y,y)yY} as the identity element. Let 𝐑Y and 𝐓Y denote the monoid of relations and transformations on the set Y, respectively.

A relation ρ over Y is naturally viewed as a Boolean matrix M(ρ)=(mij)(yi,yj)Y×Y where mij=1 if (yi,yj)ρ and 0 otherwise. Conversely, for every Boolean matrix M there is a corresponding relation ρ(M) such that M(ρ(M))=M. It is easy to verify that M(ρσ)=M(ρ)M(σ). We denote by MT the transpose of a matrix M.

2.2 Set Automaton

Definition 7 (Set automaton).

A set automaton 𝒜 is a tuple (Q,Y,Σ,Δ,I,F,C) where Q is a finite set of states, Y is a finite set of names for sets, and Σ is the input alphabet. The transition relation is given by ΔQ×Σ×𝟚Y×𝐑Y×𝟚Y×𝟚Y×Q. The initial and final sets of states are respectively IQ and FQ. Finally, C𝟚Y is the family of accepting vectors of membership of data values.

A configuration of the automaton 𝒜 is a pair γ=(q,X¯) where qQ is a state and X¯=(Xy)yY𝒫(𝒟)Y is a vector of subsets of data values. A data value d is said to be present in X¯ if it is in Xy for some yY. A configuration is initial if qI and Xy= for each yY.

When the automaton is in a configuration γ, on the input pair (a,d)Σ×𝒟, the transition (p,,z¯,ρ,u¯,v¯,p)Δ is applicable if p=q, =a, and z¯=𝟏X¯(d), that is, the characteristic vector of membership of the data value d is z¯. The set or global update is given by the relation ρ𝐑Y. The global update ρ transfers the contents of each set x to each set yρ(x). This results in the vector of subsets of data values stored in the sets of 𝒜, X¯=(Xy)yY where Xy=xρ1(y)Xx. We observe that for each data value d𝒟, the characteristic vector of membership 𝟏X¯(d)=M(ρ)T𝟏X¯(d) after the global update. The local updates are given by the vectors u¯,v¯𝟚Y. The local updates are applied on the contents of the sets given by X¯, with the current data value d added to the sets given by u¯ and removed from the sets given by v¯. Let U¯,V¯𝒫({d})Y be such that u¯=𝟏U¯(d) and v¯=𝟏V¯(d). This results in the configuration (p,X′′¯) where X′′¯=(Xy′′)yY is given by Xy′′=(XyUy)Vy for each yY.

A configuration (q,X¯) is accepting if qF and the characteristic vector of each data value present in X¯ is in C. A successful run of 𝒜 on a data word w is a sequence of applicable transitions taking the automaton from an initial to an accepting configuration. The language of 𝒜, denoted as L(𝒜), is the set of all data words w on which 𝒜 has a successful run.

Let 𝒰(𝒜) denote the set of global updates used in the transitions of the set automaton 𝒜. Let S𝒜=𝒰(𝒜), called the update semigroup of 𝒜, be the subsemigroup of relations on Y generated by 𝒰(𝒜). Clearly S𝒜 is a subsemigroup of 𝐑Y.

In the rest of the paper, when dealing with set automata, we do not distinguish between the name of a set and its contents and we directly use the name of the set to refer to its contents (i.e., a subset of data values).

Example 8.

Consider the language L12=L1L2 over the alphabet Σ={ι,δ,z} where L1 and L2 are the languages described in Example 1. This language is accepted by a set automaton 𝒜12 with the sets Y={I,D,Z,S}. Initially all of them are empty. Whenever the position is labelled by an ι the automaton checks if the data value is not present in any of the sets and it is then placed in the set I by local updates and the global update is the identity relation, i.e., it leaves the sets unchanged. Whenever a δ is read, the data value is ensured to be present in the set I and not in any other set and is then moved to D by local updates. Again, the global update is the identity relation. Whenever a z is read, the data value is ensured to not be present in any of the sets and is added to the set Z by local updates. Further, the global update copies each set to itself, and also I to S. This is given by the relation ρ=idY{(I,S)}. This ensures that whenever a z is encountered the set I is empty provided S is empty at the end of the run. In turn, this ensures that the data word is in L2. At the end the automaton accepts only if the sets I and S are empty. This ensures that all classes are of the form ιδ or z and there is no z present between a pair of ι and δ of the same class.

2.3 Normal Set Automaton

A set automaton is normal if it maintains the following invariant throughout the run on each data word: each data value is present in at most one set. This is captured by the following syntactic restriction.

Definition 9 (Normal Set Automaton).

A set automaton is normal if each of its transitions (p,,z¯,ρ,u¯,v¯,q) satisfies the following properties:

  1. 1.

    the set update ρ is a transformation, and,

  2. 2.

    u¯ is a unit vector and if u¯MT(ρ)z¯ then v¯=MT(ρ)z¯, otherwise v¯=0¯.

In a normal set automaton 𝒜 with sets Y, since each global update is a transformation, the update semigroup is a transformation semigroup. Further, for the same reason, data values in each set move to exactly one set. This, in combination with restricted local updates where the current data value can be added to at most one set ensures that each data value is present in at most one set throughout the run of a normal set automaton. Note that in the above definition, the characteristic vector z¯ can be assumed to be a unit or zero vector without loss of generality where the transition is not enabled otherwise.

For every relation on a set Y, there exists a corresponding transformation on the set 𝟚Y{0¯}. A consequence of this is that every set automaton can be normalised.

Example 10.

Consider the relation ρ on the family of sets Y={Y1,Y2} given by ρ={(Y1,Y2)}idY. This relation corresponds to an equivalent transformation ρ on the sets 𝟚Y{0¯} where each set represents a subset of sets in Y. For instance, the set Y(10) tracks the data values present in the set Y1 but not in Y2 and the set Y(11) tracks the data values present in both the sets Y1 and Y2. The corresponding transformation ρ on the sets 𝟚Y{0¯} is given as follows:

ρ ={(Ys¯,Ys¯)s¯,s¯𝟚Y0¯,s¯=MT(ρ)s¯}
={(Y(01),Y(01)),(Y(10),Y(11)),(Y(11),Y(11))}.
Proposition 11.

For each set automaton 𝒜 with the family of sets Y there is an equivalent normal set automaton 𝒩(𝒜) with the family of sets 𝟚Y{0¯}.

We now provide a generalisation of normal set automata.

A set y of a set automaton is said to be stable if ρ(y)={y}=ρ1(y) for each global update ρ used in the transitions of the automaton.

Let 𝒜=(Q,Y,Σ,Δ,I,F,C) be a set automaton. The restriction of 𝒜 to the sets YY denoted as 𝒜Y=(Q,Y,Σ,Δ,I,F,C) is given as follows: (p,,z¯,ρ,u¯,v¯,q)Δ if (p,,z¯,ρ,u¯,v¯,q)Δ where z¯=z¯Y, ρ=ρY, u¯=u¯Y, and v¯=v¯Y, and C={u¯Yu¯C}.

Definition 12 (Quasi-normal set automaton).

Let 𝒜 be a set automaton with the family of sets Y and stable sets SY. The set automaton 𝒜 is quasi-normal if the restriction 𝒜(YS) of 𝒜 to the non-stable sets is a normal set automaton.

2.4 Ordered Normal Set Automaton

In this section, we introduce ordered normal set automata and show that they have a decidable emptiness problem by reduction to the emptiness problem of ordered multicounter automata. Further, we extend this result to ordered quasi-normal set automata.

Let 𝒜 be a normal set automaton with the family of sets Y. Let {ρjjJ} be the set of global updates used by transitions of 𝒜 where J is an index set over 𝐑Y. Let ρ=jJρj be the union of the update relations and ρ+ denote the transitive closure of ρ. Consider the graph (Y,ρ+) and a set yY. If there is no vertex zY with (z,z)ρ+ that can reach y, then the induced subgraph consisting of the vertices YY that can reach y is acyclic. For each vertex yY, we can show by induction that if the number of vertices from which y is reachable is k, then y contains at most k+1 data values at each point during the run over a data word. Thus, we have the below definition.

Definition 13 (Bounded set).

Let 𝒜 be a normal set automaton with the family of sets Y. Let ρ+ be the transitive closure of the union of the update relations used in the transitions of 𝒜. A set yY is bounded if in the graph (Y,ρ+), there is no vertex z such that (z,z)ρ+ that can reach y.

We now introduce ordered normal set automata. The idea is to impose an order on the non-bounded sets of the automaton and restrict the global updates on the non-bounded sets such that they empty the contents of a prefix of sets and move them to sets higher in the order such that the contents of the higher sets are not further moved anywhere else. Such global updates are simulated by an ordered multicounter automaton using its restricted hierarchical zero-tests on a prefix of counters corresponding to the sets emptied by the global update. The number of data values present in the bounded sets are tracked by the ordered multicounter automaton without using zero-tests by maintaining the number of data values in each set in its finite state space.

Toward this, we recall the notion of an ordered partition. Let X be a set and be a linear order on it. For subsets Y,YX, we write YY to mean that yy for each yY and yY. An ordered partition of X is a tuple (X0,X1) of disjoint subsets that cover X (i.e., X0X1=X) such that X0X1.

Definition 14 (Ordered normal set automaton).

Let 𝒜 be a normal set automaton with family of sets Y𝒜 and bounded sets ZY. The automaton 𝒜 is ordered if there is a linear order on YZ such that for each global update transformation ρ used in the transitions there is an associated ordered partition (Y0,Y1) of YZ such that the tranformation ρ maps the elements of Y0 to Y1, and is the identity transformation on Y1. That is, in a transformation of 𝒜 the contents of each set in Y0 is emptied and added to a set in Y1 and the contents of the sets in Y1 are not copied anywhere else. If the automaton 𝒜 is quasi-normal with the family of stable sets S then 𝒜 is ordered if the restriction 𝒜(YS) is ordered.

Note that there is no restriction on the global update transformations on the bounded sets.

We now present the main result of this section. To this end, we recall the below definition.

Definition 15 (Ordered multicounter automaton [24]).

An ordered multicounter automaton is a tuple (Q,Σ,O,Δ,J,F) where Q is the finite set of states, Σ is the finite alphabet, O is the ordered finite set of non-negative counters, JQ is the set of initial states, and FQ is the set of final states. Let O={c1,,ck}. The set of transitions is given by

ΔQ×(Σ{ε})×{Ii,Di,Zii[k]}×Q.

From a given state p on a label a, the transition (p,a,Ij,q) increments the counter cj by one and moves to the state q. Similarly, Dj decrements the counter cj by one and Zj tests the counters {ci1ij} for zero value. Whenever the run tries to decrement the value of a counter below zero, the computation halts erroneously and rejects.

A configuration of an ordered multicounter automaton is a pair (q,𝐯) where qQ and 𝐯=(v1,,vk) where vi is the value of the counter ci. An accepting run of the automaton over a word is a sequence of transitions from an initial state with all the counters set to zero to a configuration where all counters are zero and the state is final. The language of an ordered multicounter automaton is the set of all words on which has an accepting run.

The following is a well known result about ordered multicounter automata.

Proposition 16 (Reinhardt, Theorem 6.1 of [24]).

Emptiness of ordered multicounter automata is decidable.

We simulate the run of an ordered normal set automaton using an ordered multicounter automaton.

Proposition 17.

For each ordered normal set automaton 𝒜, an ordered multicounter automaton recognising the string projection of L(𝒜) can be constructed.

Proof.

Let 𝒜=(Q,Σ,Y,Δ,I,F,C) be an ordered normal set automaton with the family of sets Y and bounded sets ZY. Let be the linear order on YZ according to the definition. We extend to the family of sets Y by choosing an arbitrary linear order on Z and setting YZ<Z.

We construct an ordered multicounter automaton that simulates the ordered normal set automaton 𝒜. The automaton has a counter cy for each yY and the counters are ordered with respect to the order . The counter cy tracks the number of data values in the set yY in a configuration of 𝒜 during the simulation. The automaton also remembers the number of data values present in each of the bounded sets using its state space. This memory is updated whenever the bounded sets are updated through global or local updates. This is further elaborated in Item 4 below.

Consider a word wL(𝒜) with a successful run ρ=δ1δ2δn of the ordered normal set automaton 𝒮. Let δ=(p,a,z¯,ρ,eu,v¯,q) be a transition in the run. Note that since the automaton 𝒜 is normal, eu is a unit vector and z¯ and v¯ are either unit or zero vectors. It is simulated by the ordered multicounter automaton as follows:

  1. 1.

    The states p,q and the current label a are handled by the underlying finite state automaton.

  2. 2.

    If z¯ is a unit vector ez, the automaton tests that the counter cz is nonzero (by successively decrementing and incrementing), signifying the presence of a data value with the characteristic vector ez. Otherwise if z¯=0¯ then the transition is always enabled.

  3. 3.

    Let (Y0,Y1) be the ordered partition of YZ associated with ρ. Let yY0. The automaton successively decrements the counter cy and increments the counter cz such that ez=MT(ρ)ey (Note that zY1). This process is repeated for each set yY0 (on ε-transitions) until the automaton guesses the counters {cyyY0} to be zero. The guess is verified by zero-testing the set of counters {cyyY0}. Note that the sets in Y0 form a prefix that can be zero-tested using the hierarchical zero-tests of .

  4. 4.

    The global update on the bounded sets is simulated by decrementing the counter cx for xZ and incrementing the counter cx such that ex=MT(ρ)ex (Note that x may not necessarily be in Z), until the former become zero. This step is accomplished without the use of zero-tests by remembering in the state space the size of each of the bounded sets. Further, the underlying finite state automaton updates this information after each transition.

  5. 5.

    Finally the local updates eu and v¯ are simulated by incrementing the counter cu and decrementing the counter cv corresponding to the unit vector v¯ if v¯0¯.

The transitions δ1 and δn are ensured to be initial and final transitions respectively by the underlying finite state automaton. At the end of the run, the automaton decrements all counters cx such that exC to zero and performs a zero-test on all the counters of the automaton, verifying that the characteristic vector of each data value present in the sets is in the family of accepting vectors of membership C.

Thus, by Propositions 16 and 17 we obtain the below result.

Theorem 18.

Emptiness of ordered normal set automata is decidable.

We now extend the above decidability result to ordered quasi-normal set automata.

Proposition 19.

For each ordered quasi-normal set automaton there is an equivalent ordered normal set automaton.

Corollary 20.

Emptiness of ordered quasi-normal set automata is decidable.

2.5 Closure Properties

Closure properties of set automata follow from that of class automata (See Proposition 39). We prove closure properties for quasi-normal set automata required for the translation of logical formulas to automata.

Lemma 21.

Quasi-normal set automata are closed under letter-to-letter renaming, and union and intersection with data automata.

Proof sketch.

It is easy to verify that the standard construction for closure under letter-to-letter renaming preserves quasi-normality. For closure under union and intersection with data automata, we use our result that for each data automaton there is an equivalent set automaton where each set is stable (See Proposition 38). The result follows from the standard constructions using this equivalent set automaton.

3 Equivalence of Set Automata and 𝐅𝐎𝟐 with Guarded Regular Predicates

3.1 Set Automata to 𝐅𝐎𝟐 with Guarded Regular Predicates

Proposition 22.

For each set automaton 𝒜 with update semigroup S𝒜 there is a formula ϕ𝒜EMSO2[Σ,<,+1,,1,~S𝒜] such that L(𝒜)=L(ϕ𝒜).

Proof sketch.

Using standard ideas we write a formula that is satisfied by a data word w=(a1,d1)(an,dn) if and only if there is a successful run of 𝒜 on w. In this sketch, we focus on how the global and local updates in the transitions of 𝒜 are captured by a formula with guarded regular predicates.

We ensure that (1) at each position the sets in which the input data value is present is consistent with the global and local updates of the transition, and (2) in two successive positions of a class, the sets in which the data value is present is consistent with the global updates made in the positions strictly between them.

Let Δ and 𝒮 denote the set of transitions and family of sets of 𝒜 respectively. We use the monadic predicates X¯={XδδΔ} to indicate the transition used at a position in the run. We use the monadic predicates Y¯={Yss𝒮} to indicate the contents of the sets during the run: Ys is true, for s𝒮, at a position j if and only if during the run of 𝒜 after executing the transition on (aj,dj) we have dj present in the set Ys. Let Z¯=X¯Y¯. Our formula is of the form Z¯φ where φFO2[Σ,Z¯,<,+1,,1,~S𝒜] is the conjunction of the formulas detailed in this sketch. To capture that the characteristic vector of membership at position x is ρ𝟚𝒮, we write,

ρ(x)s𝒮,ρ(s)=1Ys(x)s𝒮,ρ(s)=0¬Ys(x).

First, we ensure that the updates made at each position x with label (ai,di) is consistent with the transition δ=(p,ai,χ,t,α,β,q) at position x. That is, the current data value di with characteristic vector χ after the application of the transition δ with global update t and local updates α and β has the characteristic vector of membership ρδ=MT(t)χ+αβ, i.e., ρδ(x) is true. We write

x(Xδ(x)ρδ(x)).

Now, it suffices to ensure that the contents of the sets in two class-successive positions are consistent with the global updates in positions strictly between them. Toward this, we introduce the below notation.

Let 𝟚Z¯ denote the characteristic vectors of the monadic predicates Z¯. Let V denote the subset of 𝟚Z¯ such that the restriction of V to the set X¯ contains only unit vectors, this signifies that at a position exactly one transition is taken. Let Σ=Σ×V. Let πΔ:ΣΔ be the projection function that maps a letter Σ to the unique δΔ such that Xδ is true in . We extend the map πΔ to the map πΔ:ΣΔ in the natural manner.

Let π:ΔS𝒜 be the projection map defined as δ=(p,γ,χ,t,α,β,q)t that maps each transition to its update relation given as an element of the update semigroup S𝒜. We extend the map π to the map π:ΔS𝒜 in the natural manner.

Let σ:S𝒜S𝒜 be the product morphism that maps each word s1sn to the product of s1,,sn in the semigroup S𝒜. Clearly, the morphism σππΔ:ΣS𝒜 maps a sequence of letters in Σ to the product of the corresponding set update relations in S𝒜.

For χ𝟚𝒮¯, let ΔχΔ denote all transitions with the characteristic vector of membership χ. Assume that a position y is labelled by a transition δ=(p,aj,χ,t,α,β,p)Δ. Let position y be the class-successor of position x. Assume that the position x satisfies ρ(x), i.e., the characteristic vector of membership of the data value in position x is ρ, and y is labelled by a transition in Δχ. Then we ensure that the product of the set update relations in the positions strictly in between x and y is an element sS𝒜 such that χ=ρs. We write

xyχ,ρ𝟚𝒮δΔχ(x1=yρ(x)Xδ(y)L~(x,y))
where LmM,χ=ρs(σππΔ)1(s).

3.2 𝐅𝐎𝟐 with Guarded Regular Predicates to Quasi-Normal Set Automata

In this section we translate the guarded logic formulas to a subclass of quasi-normal set automata called suffix-storing set automata.

Definition 23 (Suffix-storing set automaton).

Let M be a monoid and h:ΣM be a morphism. A set automaton over the alphabet Σ is h-suffix-storing if it is a quasi-normal set automaton whose non-stable family of sets is of the form {XmmM} and obeys the following property: after reading the input prefix w(Σ×𝒟), the set {mXm} is a subset of images of suffixes of 𝑠𝑡𝑟(w) under h.

The rest of the section is devoted to the proof of Proposition 24.

Proposition 24.

For each formula ψEMSO2[Σ,<,+1,,1,~h], there is a h-suffix-storing set automaton 𝒜ψ such that L(ψ)=L(𝒜ψ).

We proceed by translating the formulas to suffix-storing set automata.

Assume that we are given a formula ψ=X¯φ where φFO2[Σ,X¯,<,+1,,1,~h] and X¯={X1,,Xm}. Further, assume that φ uses guarded predicates defined by the morphism h:(Σ×𝟚X¯)M. Since quasi-normal set automata are closed under letter-to-letter renaming it suffices to show that there is a set automaton recognising L(φ). In the following, to transform the formulas we add additional monadic variables to the vocabulary. This requires h to be replaced by the morphism hπ where π is the projection map to the alphabet Σ×2X¯. To keep the discussion simple, we omit referring to the step explicitly.

We convert the formula φ to an equivalent formula of size linear in |φ| with additional unary predicates Y¯={Y1,,Yn} in Scott Normal Form (see, for instance [12]). Hence, we get an equivalent formula

Y1Yn(xyχixyχi) (3)

where Y1,,Yn are new unary predicates and χ and χi are quantifier-free with free variables X¯Y¯. Again, by appealing to the closure under letter-to-letter renaming of set automata, it suffices to show that there is an equivalent set automaton for formulas of the form

xyχixyχi. (4)

Unary and Binary types

Let xy stand for the formula x<yx+1y, i.e., x occurs before y but is not its predecessor. Let O denote the set of binary order-types on two variables, i.e.,

O={xy,x+1=y,x=y,y+1=x,yx}.

No two formulas in O are satisfiable at the same time, and any quantifier-free formula that uses only the predicates {<,+1,=} is equivalent to a disjunction of formulas from O (easily verified by converting the formula to DNF).

Let x~⃝y, read as “x and y are class-distant”, stand for the formula xyx1yy1x, i.e., x and y are in the same class but neither is the class successor of the other. Let E denote the set of binary equivalence-types on two variables, i.e.,

E={x≁y,x~⃝y,x1=y,y1=x,x=y}.

It is easily verified that no two formulas in E are satisfiable at the same time and that any quantifier-free two-variable formula using the predicates {,1} is equivalent to a disjunction of formulas in E.

A literal is either an atomic formula or a negation of an atomic formula. Let Γ be a set of literals. The set Γ is consistent if Γ does not contain a literal and its negation. It is maximally-consistent if Γ is consistent and no strict superset of Γ is consistent.

A unary-type over ΣX¯ is a conjunction of a positive literal from Σ and a maximally-consistent set of literals over X¯ on the same variable (either x or y). For example, let Σ={a,b}. Then a(x)¬X1(x) is a unary-type over the unary predicates {a,b,X1}, whereas a(x) and a(x)b(y)X1(y) are not. Let U denote the set of unary-types.

Construction of the Quasi-Normal Set Automaton

We first transform the formulas xyχ and xyχi into suitable forms given below using standard techniques (see Lemma 12 and 13 of [4]).

It is straightforward to first transform χ to CNF and distribute the universal quantifiers over the conjunction. Furthermore, by using standard logical equivalences, we write each of the exponentially many conjuncts in χ obtained from the CNF transformation in the below form:

xy(α(x)β(y)o(x,y)ϵ(x,y)λ~(x,y)) (5)

where α,βU, o(x,y)O, ϵ(x,y)E, and λ~(x,y) is either 𝑓𝑎𝑙𝑠𝑒 or a guarded regular predicate of the form L~(x,y) or L~(y,x) for some language L defined by h. The set automaton constructed ensures that for each α and β with the class and order conditions met, the factor bordered by them satisfies the guarded regular predicate λ~ by storing information about the factors in its sets.

Similarly, for each χi, by introducing additional unary predicates, it suffices to consider formulas of the form

xy(α(x)β(y)o(x,y)ϵ(x,y)λ~(x,y)). (6)

Here, the set automaton ensures that each α is witnessed by a β satisfying the order, class, and guarded regular predicate constraints.

Thus, it suffices to construct a h-suffix-storing set automaton for a formula with conjuncts in either of the above forms. Let k be the number of such conjuncts. For the construction of the set automaton, we use the family of non-stable sets X={XmmM}. In addition to the sets in X, we use a number of other stable sets for book-keeping purposes. On a letter γU, the automaton applies the set update transformation {XpXph(γ)pM} to the sets in X.

We now obtain Proposition 24 from Lemma 25.

Lemma 25.

For each formula =i[k]ϕi where each ϕi is a formula of form

xy(α(x)β(y)o(x,y)ϵ(x,y)λ~(x,y)),or
xy(α(x)β(y)o(x,y)ϵ(x,y)λ~(x,y)),

there is an equivalent h-suffix-storing set automaton.

We illustrate the key ideas of the construction by considering the formula ϕ given below.

xy(α(x)β(y)xyx~⃝yL~(x,y))

The formula ϕ states that if an α is followed by a class-distant β that is not its successor, then the word bordered by them is in L. Observe that the condition x~⃝y captures that x+1y. Thus in the construction we do not need to specifically ensure that xy and can instead simply work with x<y.

We construct a set automaton 𝒜 that in addition to the sets in X, has the family of stable sets AHF where A={AγγU}, H={HmmM}, and F={FmmM}.

Let w be the string projection of an input data word. Assume that the automaton is on a position y. Let d be any data value occurring in the data word prior to position y. The following invariants are maintained during the run of the set automaton 𝒜:

(X)

The data value d is in the set Xm, where mM, if and only if the factor bordered by latest occurrence of d and the current position has image mM. Note that a data value can be present in at most one of the sets in X, ensuring quasi-normality of the set automaton.

(A)

The data value d is in the set Aγ if and only if the latest occurrence of d before y was with the label γ.

(H)

The data value d is in Hm if and only if there is a factor bordered by a non-latest occurrence of α in d’s class and the latest occurrence of α in d’s class, whose image is m.

(F)

The data value d is in Fm if and only if there is a factor bordered by the latest occurrence of α in d’s class and the latest occurrence of d whose image is m.

Example 26.

The invariants can be understood from the below figure. For ease of presentation, in Figure 1, for a pair of positions x<y we use the notation X(x,y) (respectively H(x,y),F(x,y)) to denote the set Xm (respectively Hm,Fm) where m is the image of the factor w(x,y) in the monoid M.

Figure 1: A data word w and the contents of the sets of 𝒜 on encountering position 9 of w.

On encountering a pair (,d), the automaton performs the following actions.

The set update {XpXph()pM} is performed, updating the sets in X and maintaining the invariant (X). The data value d is removed from the unique set in X in which it is present, if any. Further, to maintain the invariant (X) for the upcoming positions in the run, the data value d is added to the set X1 (here, 1 is the identity of the monoid M) by means of local updates since the run of the monoid M starts at the identity element. To maintain the invariant (A), the data value d is removed from the unique set in A, if any, in which it is present and is added to the set A using local updates.
If =α: The current data value d is removed from all the sets in H and is added to the set Huh(α)vw if prior to the set update, the data value was present in Hu,Fv and Xw. Further, the data value is added to the set Hm if prior to the set update, the data value was present in Xm and A. This is to maintain the invariant (H) in the upcoming positions. To maintain the invariant (F) in the upcoming positions, the data value is removed from the sets in F if present.
If α: If the data value d is present in any of the sets in F, it is removed from it and added to the set Fmh(γ)n if prior to the set update, the data value was present in the sets Fm,Aγ, and Xn. Further, if the data value d was present in Xm and Aα prior to the set update then it is added to the set Fm. This is to maintain the invariant (F). Further if =β, the following operations are also performed. To satisfy ϕ, we need to ensure that (1) the unique set Fm containing d corresponds to an accepting element of the monoid for the language L if d is not in Aα (i.e., if the latest element in the class is not an α) (2) and all the sets Hn containing d must satisfy nh(α)mP where PM is the accepting set for the language L used in the guarded regular predicate. Note that this captures only the condition xy as it only considers x~⃝y where x<y, thus ensuring x+1y. Both the conditions can be ascertained from the characteristic vector of d. If it is not, then 𝒜 halts erroneously.

Finally, at the end of the run, every configuration of the set automaton is accepting.

4 Decidability & Undecidability Results on 𝐅𝐎𝟐 with Guarded Regular Predicates

4.1 Linear Bands

A band is a semigroup in which every element is an idempotent.

Definition 27 (Linear Band).

A monoid M is a linear band if it is a band and the preorder relation 𝒥 on M is total. In other words, M satisfies identities x2=x and xyx=xyxy=y for all x,yM.

Example 28.

Below are some examples and non-examples of linear bands.

  1. 1.

    The two-element monoid U1={1,0} with a zero is a linear band.

  2. 2.

    Consider the band U12={1,r,s,0} with the operation rs=sr=0 given in Figure 2. It is not a linear band since the elements r and s are 𝒥-incomparable, i.e., the two-sided ideals generated by r and s are incomparable with respect to inclusion. This example shows that linear bands are not closed under products.

  3. 3.

    Consider the null monoid Nk={1,x1,,xk,0}, with the operation xixj=0, for each i,j[k]. The null monoid N2 is given in Figure 2. The monoid Nk is not a linear band.

Figure 2: (a) A linear band recognising the language (a+b)b+a over the alphabet {a,b}, (b) A linear band U1, (c) A band U12, and (d) a linear monoid N2. Here, (c) and (d) are not linear bands. Idempotents are denoted by a star in the above monoids.

A semigroup S is in the class of semigroups 𝐃𝐀 if it satisfies the identity ese=e for each element s and idempotent e such that e𝒥s. The name 𝐃𝐀 comes from an equiavalent definition that all regular 𝒟-classes of S are aperiodic subsemigroups. They correspond to positive regular languages (subsets of Σ+) recognised by FO2(Σ,<) formulas.

The below result follows from basic facts about Green’s relations.

Lemma 29.

Every linear band is in 𝐃𝐀.

4.2 Decidability with Guarded Regular Predicates recognised by Linear Bands

In this section, we show that the logic EMSO2[Σ,<,+1,,1,~M] has a decidable satisfiability problem when M is a linear band. It suffices to show the below result.

Proposition 30.

Let M be a linear band and h:ΣM be a morphism. For each h-suffix-storing set automaton there is an equivalent ordered quasi-normal set automaton.

Proof.

Let M be a linear band and 𝒜 be a h-suffix-storing set automaton for some morphism h:ΣM. Assume that X={XmmM} are the non-stable sets of 𝒜. Since stable sets can always be added to an ordered quasi-normal set automaton, to simplify the below construction we ignore the stable sets.

First, we introduce some machinery for the proof.

Let be a partial order on M extending , obtained by fixing total orders within each 𝒥-class on -classes such that they are stable on -classes, and ordering distinct 𝒥-classes according to . More precisely, satisfies the following conditions. Let x,yM.

  1. 1.

    If xy then xy.

  2. 2.

    The relation is antisymmetric, i.e., xy and yx then x=y.

  3. 3.

    If x<y then xy, and, if xy and xy then either xy or yx.

  4. 4.

    If xy, xx and yy, then xy.

An order is easily found by fixing an ordering on the columns of each 𝒥-class in the eggbox diagram of M.

Let xy and xy denote yx and yx respectively. A (strict) -chain in M is a sequence m1,,mn of elements from M such that m1m2mn. Let k1 be the length of the longest -chain in M. The -height of an element mM, denoted by km, is the length of the longest -chain starting with m.

We observe that a subset MM is an -total set, if, and only if, it is -total, and equivalently, the elements of M forms a strict -chain. Moreover, if m1m2mn is a strict -chain then km1>km2>>kmn.

Claim 31.

If MM is an -total set. Then for all mM, Mm is also -total.

Proof.

Assume that MM is -total. It suffices to prove that for each m1,m2M, if m1m2, then m1mm2m, which follows from the fact that is stable under right multiplication (Fact 47).

Claim 32.

If mm for m,mM, then km=km.

Proof.

Assume that mm. Let m=m1m2mn be a strict -chain starting in m. Let ziM, for 1in1, be such that zimi=mi+1. The we claim that the -chain mz1mz2z1mzn1z1m is strict. Since mm we have z1mz1m. By induction, we have ziz1mziz1m, for 1in1. Since is compatible with the -relation, we conclude that the chain is strict. Thus we infer that kmkm. The other direction follows symmetrically.

Claim 33.

Let m1,m2M be two elements such that m1m2. Then for each mM, if km1m<km1 then km2m<km1.

Proof.

Assume that km1m<km1. We claim that m1m<𝒥m1. Otherwise m1m𝒥m1 and we also have m1mm1, therefore by Fact 46 we have m1mm1. Now by Claim 32 we have km1m=km1, a contradiction. Hence we have m1m<𝒥m1. Since M is linear, we have either m<𝒥m1 or m1𝒥m. If m1𝒥m we have m1mm1=m1 since M is in 𝐃𝐀. Here we have m1𝒥m1m, a contradiction. Thus m<𝒥m1 and since m2m𝒥m we get m2m<𝒥m1. We deduce that km2m<km1.

We construct an ordered quasi-normal set automaton that has the family of sets YZ, where Y={Yiik} and Z={ZmmM}. The sets in Y are used to simulate the non-stable sets X of the h-suffix-storing set automaton 𝒜. At any point during a run of the automaton , the set Ykm has the content of a unique nonempty set Xm if it exists. During the run, except for the last transition, the sets in Z remain empty and the identity transformation is applied to them. At the last transition we copy the nonempty sets in Y to the corresponding set in Z (i.e., Ykm to Zm). The automaton simulates 𝒜 in the following way.

Since the automaton 𝒜 is h-suffix-storing, at any point during the run, the subset M={mMXm} is an -total set, and hence -total also. The contents of each Xm is stored in the set Ykm and the automaton also remembers in its state the information about the element m that corresponds to the nonempty set Ykm (this is a partial map f:[k]M defined as f:kmm). To effect the global update ρ={(Xm,Xmm)mM} of 𝒜, i.e., right multiplication by an element mM, the automaton moves the data values in each nonempty set Ykm to the set Ykmm, i.e., by the global update ρ={(Ykm,Ykmm)mM}{(Zm,Zm)mM}, and replaces the map f by the map f:kmmmm. Note that since Mm is a -total set, elements of Mm form a strict -chain, and therefore km1mkm2m whenever m1mm2m, for m1,m2M. Therefore each nonempty set Yi corresponds to precisely one nonempty set from X. On the last input pair the global update ρ={(Xm,Xmm)mM} is simulated by the update ρ′′={(Ykm,Zmm)mM}, i.e., the sets in Y are copied to sets in Z using the map stored in the sets. Finally the automaton accepts if a final state is reached and each data value is in an accepting configuration as given by that of 𝒜.

Let be the order on the family YZ, where YZ, and Y is ordered by the relation {(Yi,Yj)ji}, and an arbitrary order is fixed on Z. Using Claim 33, it is straightforward to check that global updates of are ordered with respect to .

Thus, by Propositions 24, 30, and Corollary 20, we have the below result.

Theorem 34.

Satisfiability of EMSO2[Σ,<,+1,,1,~M] formulas over data words is decidable when M is a linear band.

4.3 Undecidability with Guarded Regular Predicates not recognised by Linear Bands

Proposition 35.

If M is an aperiodic monoid that is not a linear band then U12 or N2 divides M.

Proof.

Let M be an aperiodic monoid that is not a linear band. If M contains an element x that is not an idempotent then M is not a band. Here N2 divides the submonoid generated by x. Hence assume that all elements of M are idempotent. Now since M is not a linear band, there exist two idempotents e and f that are 𝒥-incomparable. Here U12 divides M.

We obtain the below undecidability result by a reduction from the halting problem of two-counter machines [20]. We encode the run of a two-counter machine as a data word and write a formula that is satisfied by a data word if and only if the data word encodes an accepting run of the two-counter machine.

Proposition 36.

Satisfiability of EMSO2[Σ,<,+1,,1,~M] formulas over data words is undecidable when U12 or N2 divides M.

The below result follows from Propositions 35 and 36.

Theorem 37.

Let M be a finite aperiodic monoid. Satisfiability of EMSO2[Σ,<,+1,, 1,~M] formulas over data words is undecidable when M is not a linear band.

Our main result restated below follows from Theorem 34, Proposition 35 and Theorem 37.See 1

5 Discussion

5.1 Comparison with Other Models

A natural restriction of set automata captures the class of languages recognised by data automata.

Proposition 38.

For each data automaton there is an equivalent set automaton where each set is stable, that is, the only set update used in its transitions is the identity relation.

The following result highlights the robustness of the set automaton formalism.

Proposition 39.

Set automata are expressively equivalent to class automata.

5.2 Logical Characterisation of Set Automata

First, we recall a logical characterisation of class automata given in [6].

Proposition 40 (Bojańczyk and Lasota, [6]).

Class automata are expressively equivalent to a restricted fragment of MSO[Σ,<,] consisting of formulas of the form

X1XnY𝖼𝗅𝖺𝗌𝗌(Y)ϕ(X1,,Xn,Y) (7)

where 𝖼𝗅𝖺𝗌𝗌(Y):=yx(Y(x)yx) and ϕ is in MSO[Σ,<].

It is easy to see that the data value equality test, the class successor relation, and regular predicates are captured in this restricted fragment of MSO.

Proposition 41.

For each formula φEMSO2[Σ,<,+1,,1,], there is a formula ψ belonging to the restricted fragment of MSO[Σ,<,] consisting of formulas of the form given in Equation 7 such that L(φ)=L(ψ).

By Propositions 22, 39, 40, and 41, we obtain the below result.

Theorem 42.

Set automata and EMSO2[Σ,<,+1,,1,] are expressively equivalent.

Now by Proposition 22, we obtain the below corollary.

Corollary 43.

For each formula in EMSO2[Σ,<,+1,,1,M], there is an equivalent formula in EMSO2[Σ,<,+1,,1,~M] for some monoid M.

6 Conclusion

We have characterised the decidability frontier for the EMSO2 logic over data words with guarded regular predicates recognised by a monoid. The characterisation in the case of guarded regular predicates recognised by semigroups is yet to be done. The class of regular languages recognised by linear bands has not been studied in the literature and needs to be explored further.

References

  • [1] Ansuman Banerjee, Kingshuk Chatterjee, and Shibashis Guha. Set augmented finite automata over infinite alphabets. In DLT, volume 13911 of LNCS, pages 36–50. Springer, 2023. doi:10.1007/978-3-031-33264-7_4.
  • [2] Henrik Björklund and Thomas Schwentick. On notions of regularity for data languages. In Fundamentals of Computation Theory, pages 88–99. Springer Berlin Heidelberg, 2007. doi:10.1007/978-3-540-74240-1_9.
  • [3] Mikołaj Bojańczyk. Data monoids. In STACS, volume 9 of LIPIcs, pages 105–116. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2011. doi:10.4230/LIPIcs.STACS.2011.105.
  • [4] Mikołaj Bojańczyk, Claire David, Anca Muscholl, Thomas Schwentick, and Luc Segoufin. Two-variable logic on data words. ACM Trans. Comput. Logic, 12(4), July 2011. doi:10.1145/1970398.1970403.
  • [5] Mikołaj Bojańczyk and Rafał Stefański. Single-Use Automata and Transducers for Infinite Alphabets. In ICALP, volume 168 of LIPIcs, pages 113:1–113:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi:10.4230/LIPIcs.ICALP.2020.113.
  • [6] Mikolaj Bojańczyk and Sławomir Lasota. An extension of data automata that captures xpath. In LICS, pages 243–252, 2010.
  • [7] Thomas Colcombet, Clemens Ley, and Gabriele Puppis. On the use of guards for logics with data. In MFCS, volume 6907 of LNCS, pages 243–255. Springer, 2011. doi:10.1007/978-3-642-22993-0_24.
  • [8] Thomas Colcombet and Amaldev Manuel. Fragments of Fixpoint Logic on Data Words. In FSTTCS, volume 45 of LIPIcs, pages 98–111. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2015. doi:10.4230/LIPIcs.FSTTCS.2015.98.
  • [9] Stephane Demri and Paul Gastin. Specification and verification using temporal logics. In Modern Applications of Automata Theory, 2012.
  • [10] Stéphane Demri and Ranko Lazic. LTL with the freeze quantifier and register automata. ACM Trans. Comput. Log., 10(3):16:1–16:30, 2009. doi:10.1145/1507244.1507246.
  • [11] Radu Grigore and Nikos Tzevelekos. History-register automata. Log. Methods Comput. Sci., 12(1), 2016. doi:10.2168/LMCS-12(1:7)2016.
  • [12] Erich Grädel, Phokion G. Kolaitis, and Moshe Y. Vardi. On the decision problem for two-variable first-order logic. The Bulletin of Symbolic Logic, 3(1):53–69, 1997. doi:10.2307/421196.
  • [13] Shibashis Guha, Amaldev Manuel, and S P Rishal. Set automata and limits of decidability of two-variable logic on data words. CoRR, abs/2605.09077, 2026. arXiv:2605.09077.
  • [14] Sabína Gulčíková and Ondřej Lengál. Register set automata (technical report), 2022. arXiv:2205.12114.
  • [15] Michael Kaminski and Nissim Francez. Finite-memory automata. Theor. Comput. Sci., 134(2):329–363, 1994. doi:10.1016/0304-3975(94)90242-9.
  • [16] Ahmet Kara, Thomas Schwentick, and Tony Tan. Feasible automata for two-variable logic with successor on data words. In LATA, volume 7183 of LNCS, pages 351–362. Springer, 2012. doi:10.1007/978-3-642-28332-1_30.
  • [17] Gerard Lallement. Semigroups and combinatorial applications. Wiley, New York, 1979.
  • [18] Martin Leucker and César Sánchez. Regular linear temporal logic. In Theoretical Aspects of Computing – ICTAC 2007, pages 291–305. Springer Berlin Heidelberg, 2007. doi:10.1007/978-3-540-75292-9_20.
  • [19] Amaldev Manuel and Ramaswamy Ramanujam. Class counting automata on data words. International Journal of Foundations of Computer Science, 22, November 2011. doi:10.1142/S0129054111008465.
  • [20] Marvin L. Minsky. Computation: finite and infinite machines. Prentice-Hall, Inc., 1967.
  • [21] Frank Neven, Thomas Schwentick, and Victor Vianu. Finite state machines for strings over infinite alphabets. ACM Trans. Comput. Logic, 5(3):403–435, July 2004. doi:10.1145/1013560.1013562.
  • [22] Jean-Éric Pin. Mathematical Foundations of Automata Theory, 2022.
  • [23] Thomas Place and Marc Zeitoun. All about unambiguous polynomial closure. TheoretiCS, Volume 2, January 2024.
  • [24] Klaus Reinhardt. Reachability in petri nets with inhibitor arcs. Electron. Notes Theor. Comput. Sci., 223:239–264, December 2008. doi:10.1016/J.ENTCS.2008.12.042.
  • [25] Luc Segoufin. Automata and logics for words and trees over an infinite alphabet. In CSL, pages 41–57. Springer Berlin Heidelberg, 2006. doi:10.1007/11874683_3.
  • [26] Pierre Wolper. Temporal logic can be more expressive. Information and Control, 56(1):72–99, 1983. doi:10.1016/S0019-9958(83)80051-5.

Appendix A Appendix

Orders Preliminaries

A preorder on a set X is a binary relation on X that is reflexive and transitive. A preorder is total if xy or yx for each x,yX. We say the subset YX is -total if any two elements in Y is comparable with respect to , in other words Y is totally preordered by . A partial order is an antisymmetric preorder. A linear order is a total partial order.

Semigroup Preliminaries

We recall some fundamental definitions from the local theory of semigroups. A detailed account can be found in standard textbooks, such as [22, 17].

For a semigroup S, its monoidal extension S1 is defined to be S if it is already a monoid and otherwise to be the monoid obtained by adjoining an identity element 1 to it. We denote by X the semigroup generated by elements in the set X. For a semigroup S, a subset T of S is a subsemigroup if x,yT implies that xyT. A submonoid of a monoid is a subsemigroup containing the identity. An element e of a semigroup is said to be an idempotent if e2=e. Let S and T be semigroups. The semigroup T is a quotient of S if there exists a surjective morphism from S onto T. The semigroup T is said to divide S if T is a quotient of a subsemigroup of S.

Definition 44 (Ideals).

Let S be a semigroup. A right ideal of S is a subset R of S such that RS1R, that is, for each rR and sS1, we have that rsR. Symmetrically, a left ideal is a subset L of S such that S1LL. A (two-sided) ideal I is a subset of S which is both a right and a left ideal, i.e. S1IS1I.

Definition 45 (Green’s relations).

Let s,t be elements of a semigroup S. The Green’s preorders ,, and 𝒥 are given as follows: sts=ty for some yS1, sts=xt for some xS1, and s𝒥ts=xty for some x,yS1.

Let 𝒦{,,𝒥}. The Green’s preorders have equivalence relations associated with them that are given as s𝒦ts𝒦t and t𝒦s Further, the relation is given by stst and st.

These relations can be formulated in terms of ideals. We have that s𝒥t (respectively st, st) if and only if S1sS1S1tS1 (sS1tS1, S1sS1t), that is, the ideal (right ideal, left ideal) generated by s is contained in the ideal (right ideal, left ideal) generated by t.

The equivalence class of an element s under the relation 𝒦{,,𝒥,} is called the 𝒦-class of s and is denoted by 𝒦(s). Let 𝒦{,,𝒥}. Two 𝒦-classes are comparable when every element in one class is comparable to every element in the other class in the 𝒦 preorder. In finite semigroups the relations 𝒟== and 𝒥 coincide, and we use them interchangeably.

Fact 46 (Prefix/Suffix Lemma).

Let x,y be elements of a finite semigroup.

  1. 1.

    If xy and x𝒥y then xy.

  2. 2.

    If xy and x𝒥y then xy.

Fact 47 (Stability of and ).

The following is true in any semigroup.

  1. 1.

    is stable on the left, i.e., if xy then zxzy. Hence, if xy then zxzy.

  2. 2.

    is stable on the right, i.e., if xy then xzyz. Hence, if xy then xzyz.