Set Automata and Limits of Decidability of Two-Variable Logic on Data Words
Abstract
We extend the two-variable logic on data words [4] with guarded regular binary predicates of the form that is true if positions and have the same data value and the factor strictly between and is in the regular language . 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 is expressively equivalent to a quasi-normal set automaton with the monoid of relations . In particular, if 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, DecidabilityCategory:
Track B: Automata, Logic, Semantics, and Theory of ProgrammingFunding:
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:
2012 ACM Subject Classification:
Theory of computation Logic and verification ; Theory of computation Formal languages and automata theoryEditors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
A data word is a finite sequence of pairs 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 is called a data language. In most cases (including this work) is assumed to be closed under permutations of the set , that is, every occurrence of some data value can be replaced with another data value 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, can be represented as a collection of relational first-order structures of the form where and denote the set and the natural order on it, the unary predicates denotes the labelling by , and is the equivalence relation on positions given by data values, i.e., if . The relation denotes the class successor relation, i.e., , if and the positions strictly between and are not equivalent to them. The class of is the equivalence class of under the relation , i.e., the set of all positions labelled with the data value .
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 denote the first-order formulas using the predicates from and the variables and . The logic consists of formulas of the form with , where stands for the monadic second-order predicates that quantify over sets of positions. Certainly, it is natural to consider the first-order logic () with the vocabulary on data words. However, as one would expect, the satisfiability problem of the logic 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 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, 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 is the word . Let be a class of . The string projection of this class is the word . We say is a class of to mean a class whose string projection is .
Example 1.
Let . We can think of and as increments and decrements of a counter and as a zero-test.
-
1.
Let be the set of all data words where each class is of the form or . This language is defined by the formula where
(1) -
2.
Let consist of all data words satisfying the property: there is no position labelled by between each and of the same class. Note that could be in a different class than that of the and .
The language is not definable in as noted in [25]. In fact it is not recognised by the data automata of [4], that is equivalent to the logic . However, 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 , see [25]).
To define in , 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 where is a regular language. A data word with the string projection at the pair of positions , for , satisfies the predicate if and the factor given by the interval is in . A guarded regular predicate is equivalent to the formula .
For a regular expression , let denote the language defined by it. Using regular predicates, the language can be defined in by the below formula.
| (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 . We can think of the alphabet as encoding the increments, decrements, and zero-tests of a two-counter machine.
-
1.
Let be the set of all data words satisfying the following property: each class is of the form or , . Clearly is in .
-
2.
Let consist of all data words satisfying the following property: for each , there is no position labelled by between each and of the same class.
From Formula 2, it is not difficult to see that is definable in using the guarded regular predicates defined by the languages and . 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 is a set with an associative binary operation. It is a monoid if the operation has an identity, denoted by . All semigroups we consider in this paper are either finite or free semigroups of the form . Let be a finite monoid. A morphism is a map satisfying and . A language is recognised by a morphism , where is a finite monoid, if there is a finite subset such that . We also consider semigroups recognising languages. Let be a finite semigroup and be the monoid obtained by adjoining an identity to . The monoid morphism is unit-reflecting if . We say a language is recognised by if it is recognised by a unit-reflecting morphism into . A monoid recognises a family of languages over if there is a morphism that recognises each language in the family. Definitions of other semigroup-theoretic notions required for our purposes can be found in Appendix A.
Let be a morphism. The logic is the extension of the logic with the family of all regular predicates recognised by . For a monoid , by we denote the set of formulas for some morphism . The logics and are defined analogously where the predicates used are guarded. The above definitions extend naturally to semigroups and unit-reflecting morphisms. Now, we introduce the extension of the above logics. For instance, a formula is in if it is of the form where and stands for the monadic second-order predicates . Note that the morphism , for some finite monoid , maps words over the extended alphabet that indicates the interpretations of the variables in .
Example 4.
The language family from Equation 2 is recognised by the two element monoid with a zero under the usual product operation, with the morphism and and accepting set . However, the family is not recognisable by the monoid as both languages cannot be recognised by the same morphism. However is recognised by the product monoid . under the morphism , with the accepting sets and respectively.
A key difference in the structure of the two monoids above is that in , the two-sided ideals (See Definition 44) are linearly ordered while it is not the case in (See Figure 2 and Example 28). Motivated by this, we consider the class of linear bands, namely the class of idempotent monoids whose two-sided ideals are linearly ordered, that is, for each , we have or . 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 with the below operation where is the usual addition over natural numbers.
The unique morphism given by the map (and if ) recognises the family of languages . Thus the logic where is a generalisation of the successor relation on positions. The decidability of the latter logic is shown in [4].
Our Contributions
Our main result is as follows.
Theorem 5.
Let be a finite aperiodic monoid. Satisfiability of formulas over data words is decidable if and only if is a linear band.
Our decidable fragment is a strict extension of the of [4] as the language of Example 1 is definable in the decidable fragment of Section 1 but not in the of [4]. The guardedness of the regular predicates does not impose a restriction on the expressibility in the following sense: for every formula in with regular predicates recognised by a monoid there is an equivalent formula in with guarded regular predicates recognised by another monoid . 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 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 for ). 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 and set automata are non-elementary and is inherited from and data automata.
We obtain decidability of the logic by converting formulas where is a linear band to ordered quasi-normal set automata. To show undecidability of the logic when 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 on data words, the results in [4] are already mentioned. The related, but weaker logic 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.
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 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 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 , let denote the set . The set of Boolean values is denoted by . Let be a finite ordered set. The power set of is denoted as . A Boolean column vector indexed by is an element of . For a subset , the restriction of to is given by . The set of column vectors over indexed by is denoted by . The Boolean operations can be extended to elements of pointwise. For , we denote by the complement of . For , let denote the vector whose -component is and all other components are . The vectors are called unit vectors.
Let be a set. For a subset , let denote the characteristic function given by if and otherwise. Extending this notation, for a vector of subsets of indexed by , let denote the function . The vector is called the characteristic vector of in .
A binary relation on a set is a subset of the cartesian product . We simply write relation instead of binary relation. The converse of a relation is the relation where the order is switched. For a subset , the restriction of to is . The image of an element under the relation is the set given by . Similarly, the image of a subset of under the relation is given by . 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 , their product is given by .
Example 6.
Let and be relations on the set . Then and .
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 form a monoid with the identity function as the identity element. Let and denote the monoid of relations and transformations on the set , respectively.
A relation over is naturally viewed as a Boolean matrix where if and otherwise. Conversely, for every Boolean matrix there is a corresponding relation such that . It is easy to verify that . We denote by the transpose of a matrix .
2.2 Set Automaton
Definition 7 (Set automaton).
A set automaton is a tuple where is a finite set of states, is a finite set of names for sets, and is the input alphabet. The transition relation is given by . The initial and final sets of states are respectively and . Finally, is the family of accepting vectors of membership of data values.
A configuration of the automaton is a pair where is a state and is a vector of subsets of data values. A data value is said to be present in if it is in for some . A configuration is initial if and for each .
When the automaton is in a configuration , on the input pair , the transition is applicable if , , and , that is, the characteristic vector of membership of the data value is . The set or global update is given by the relation . The global update transfers the contents of each set to each set . This results in the vector of subsets of data values stored in the sets of , where . We observe that for each data value , the characteristic vector of membership after the global update. The local updates are given by the vectors . The local updates are applied on the contents of the sets given by , with the current data value added to the sets given by and removed from the sets given by . Let be such that and . This results in the configuration where is given by for each .
A configuration is accepting if and the characteristic vector of each data value present in is in . A successful run of on a data word is a sequence of applicable transitions taking the automaton from an initial to an accepting configuration. The language of , denoted as , is the set of all data words on which has a successful run.
Let denote the set of global updates used in the transitions of the set automaton . Let , called the update semigroup of , be the subsemigroup of relations on generated by . Clearly is a subsemigroup of .
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 over the alphabet where and are the languages described in Example 1. This language is accepted by a set automaton with the sets . 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 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 and not in any other set and is then moved to by local updates. Again, the global update is the identity relation. Whenever a is read, the data value is ensured to not be present in any of the sets and is added to the set by local updates. Further, the global update copies each set to itself, and also to . This is given by the relation . This ensures that whenever a is encountered the set is empty provided is empty at the end of the run. In turn, this ensures that the data word is in . At the end the automaton accepts only if the sets and are empty. This ensures that all classes are of the form or and there is no 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 satisfies the following properties:
-
1.
the set update is a transformation, and,
-
2.
is a unit vector and if then , otherwise .
In a normal set automaton with sets , 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 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 , there exists a corresponding transformation on the set . A consequence of this is that every set automaton can be normalised.
Example 10.
Consider the relation on the family of sets given by . This relation corresponds to an equivalent transformation on the sets where each set represents a subset of sets in . For instance, the set tracks the data values present in the set but not in and the set tracks the data values present in both the sets and . The corresponding transformation on the sets is given as follows:
Proposition 11.
For each set automaton with the family of sets there is an equivalent normal set automaton with the family of sets .
We now provide a generalisation of normal set automata.
A set of a set automaton is said to be stable if for each global update used in the transitions of the automaton.
Let be a set automaton. The restriction of to the sets denoted as is given as follows: if where , , , and , and .
Definition 12 (Quasi-normal set automaton).
Let be a set automaton with the family of sets and stable sets . The set automaton is quasi-normal if the restriction 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 . Let be the set of global updates used by transitions of where is an index set over . Let be the union of the update relations and denote the transitive closure of . Consider the graph and a set . If there is no vertex with that can reach , then the induced subgraph consisting of the vertices that can reach is acyclic. For each vertex , we can show by induction that if the number of vertices from which is reachable is , then contains at most 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 . Let be the transitive closure of the union of the update relations used in the transitions of . A set is bounded if in the graph , there is no vertex such that that can reach .
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 be a set and be a linear order on it. For subsets , we write to mean that for each and . An ordered partition of is a tuple of disjoint subsets that cover (i.e., ) such that .
Definition 14 (Ordered normal set automaton).
Let be a normal set automaton with family of sets and bounded sets . The automaton is ordered if there is a linear order on such that for each global update transformation used in the transitions there is an associated ordered partition of such that the tranformation maps the elements of to , and is the identity transformation on . That is, in a transformation of the contents of each set in is emptied and added to a set in and the contents of the sets in are not copied anywhere else. If the automaton is quasi-normal with the family of stable sets then is ordered if the restriction 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 where is the finite set of states, is the finite alphabet, is the ordered finite set of non-negative counters, is the set of initial states, and is the set of final states. Let . The set of transitions is given by
From a given state on a label , the transition increments the counter by one and moves to the state . Similarly, decrements the counter by one and tests the counters 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 where and where is the value of the counter . 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 can be constructed.
Proof.
Let be an ordered normal set automaton with the family of sets and bounded sets . Let be the linear order on according to the definition. We extend to the family of sets by choosing an arbitrary linear order on and setting .
We construct an ordered multicounter automaton that simulates the ordered normal set automaton . The automaton has a counter for each and the counters are ordered with respect to the order . The counter tracks the number of data values in the set 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 with a successful run of the ordered normal set automaton . Let be a transition in the run. Note that since the automaton is normal, is a unit vector and and are either unit or zero vectors. It is simulated by the ordered multicounter automaton as follows:
-
1.
The states and the current label are handled by the underlying finite state automaton.
-
2.
If is a unit vector , the automaton tests that the counter is nonzero (by successively decrementing and incrementing), signifying the presence of a data value with the characteristic vector . Otherwise if then the transition is always enabled.
-
3.
Let be the ordered partition of associated with . Let . The automaton successively decrements the counter and increments the counter such that (Note that ). This process is repeated for each set (on -transitions) until the automaton guesses the counters to be zero. The guess is verified by zero-testing the set of counters . Note that the sets in form a prefix that can be zero-tested using the hierarchical zero-tests of .
-
4.
The global update on the bounded sets is simulated by decrementing the counter for and incrementing the counter such that (Note that may not necessarily be in ), 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.
Finally the local updates and are simulated by incrementing the counter and decrementing the counter corresponding to the unit vector if .
The transitions and 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 such that 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 .
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 there is a formula such that .
Proof sketch.
Using standard ideas we write a formula that is satisfied by a data word if and only if there is a successful run of on . 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 to indicate the transition used at a position in the run. We use the monadic predicates to indicate the contents of the sets during the run: is true, for , at a position if and only if during the run of after executing the transition on we have present in the set . Let . Our formula is of the form where is the conjunction of the formulas detailed in this sketch. To capture that the characteristic vector of membership at position is , we write,
First, we ensure that the updates made at each position with label is consistent with the transition at position . That is, the current data value with characteristic vector after the application of the transition with global update and local updates and has the characteristic vector of membership , i.e., is true. We write
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 denote the characteristic vectors of the monadic predicates . Let denote the subset of such that the restriction of to the set contains only unit vectors, this signifies that at a position exactly one transition is taken. Let . Let be the projection function that maps a letter to the unique such that is true in . We extend the map to the map in the natural manner.
Let be the projection map defined as that maps each transition to its update relation given as an element of the update semigroup . We extend the map to the map in the natural manner.
Let be the product morphism that maps each word to the product of in the semigroup . Clearly, the morphism maps a sequence of letters in to the product of the corresponding set update relations in .
For , let denote all transitions with the characteristic vector of membership . Assume that a position is labelled by a transition . Let position be the class-successor of position . Assume that the position satisfies , i.e., the characteristic vector of membership of the data value in position is , and is labelled by a transition in . Then we ensure that the product of the set update relations in the positions strictly in between and is an element such that . We write
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 be a monoid and be a morphism. A set automaton over the alphabet is -suffix-storing if it is a quasi-normal set automaton whose non-stable family of sets is of the form and obeys the following property: after reading the input prefix , the set is a subset of images of suffixes of under .
The rest of the section is devoted to the proof of Proposition 24.
Proposition 24.
For each formula , there is a -suffix-storing set automaton such that .
We proceed by translating the formulas to suffix-storing set automata.
Assume that we are given a formula where and . Further, assume that uses guarded predicates defined by the morphism . Since quasi-normal set automata are closed under letter-to-letter renaming it suffices to show that there is a set automaton recognising . In the following, to transform the formulas we add additional monadic variables to the vocabulary. This requires to be replaced by the morphism where is the projection map to the alphabet . 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 in Scott Normal Form (see, for instance [12]). Hence, we get an equivalent formula
| (3) |
where are new unary predicates and and are quantifier-free with free variables . 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
| (4) |
Unary and Binary types
Let stand for the formula , i.e., occurs before but is not its predecessor. Let denote the set of binary order-types on two variables, i.e.,
No two formulas in are satisfiable at the same time, and any quantifier-free formula that uses only the predicates is equivalent to a disjunction of formulas from (easily verified by converting the formula to DNF).
Let , read as “ and are class-distant”, stand for the formula , i.e., and are in the same class but neither is the class successor of the other. Let denote the set of binary equivalence-types on two variables, i.e.,
It is easily verified that no two formulas in are satisfiable at the same time and that any quantifier-free two-variable formula using the predicates is equivalent to a disjunction of formulas in .
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 is a conjunction of a positive literal from and a maximally-consistent set of literals over on the same variable (either or ). For example, let . Then is a unary-type over the unary predicates , whereas and are not. Let denote the set of unary-types.
Construction of the Quasi-Normal Set Automaton
We first transform the formulas and 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:
| (5) |
where , , , and is either or a guarded regular predicate of the form or for some language defined by . 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 , by introducing additional unary predicates, it suffices to consider formulas of the form
| (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 -suffix-storing set automaton for a formula with conjuncts in either of the above forms. Let be the number of such conjuncts. For the construction of the set automaton, we use the family of non-stable sets . In addition to the sets in , we use a number of other stable sets for book-keeping purposes. On a letter , the automaton applies the set update transformation to the sets in .
We now obtain Proposition 24 from Lemma 25.
Lemma 25.
For each formula where each is a formula of form
there is an equivalent -suffix-storing set automaton.
We illustrate the key ideas of the construction by considering the formula given below.
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 . Observe that the condition captures that . Thus in the construction we do not need to specifically ensure that and can instead simply work with .
We construct a set automaton that in addition to the sets in , has the family of stable sets where , , and .
Let be the string projection of an input data word. Assume that the automaton is on a position . Let be any data value occurring in the data word prior to position . The following invariants are maintained during the run of the set automaton :
- (X)
-
The data value is in the set , where , if and only if the factor bordered by latest occurrence of and the current position has image . Note that a data value can be present in at most one of the sets in , ensuring quasi-normality of the set automaton.
- (A)
-
The data value is in the set if and only if the latest occurrence of before was with the label .
- (H)
-
The data value is in if and only if there is a factor bordered by a non-latest occurrence of in ’s class and the latest occurrence of in ’s class, whose image is .
- (F)
-
The data value is in if and only if there is a factor bordered by the latest occurrence of in ’s class and the latest occurrence of whose image is .
Example 26.
The invariants can be understood from the below figure. For ease of presentation, in Figure 1, for a pair of positions we use the notation (respectively to denote the set (respectively ) where is the image of the factor in the monoid .
On encountering a pair , the automaton performs the following actions.
The set update is performed, updating the sets in and maintaining the invariant (X).
The data value is removed from the unique set in in which it is present, if any.
Further, to maintain the invariant (X) for the upcoming positions in the run, the data value is added to the set (here, is the identity of the monoid ) by means of local updates since the run of the monoid starts at the identity element.
To maintain the invariant (A), the data value is removed from the unique set in , if any, in which it is present and is added to the set using local updates.
If :
The current data value is removed from all the sets in and is added to the set if prior to the set update, the data value was present in and .
Further, the data value is added to the set if prior to the set update, the data value was present in and .
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 if present.
If :
If the data value is present in any of the sets in , it is removed from it and added to the set if prior to the set update, the data value was present in the sets , and .
Further, if the data value was present in and prior to the set update then it is added to the set .
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 containing corresponds to an accepting element of the monoid for the language if is not in (i.e., if the latest element in the class is not an ) (2) and all the sets containing must satisfy where is the accepting set for the language used in the guarded regular predicate.
Note that this captures only the condition as it only considers where , thus ensuring .
Both the conditions can be ascertained from the characteristic vector of .
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 is a linear band if it is a band and the preorder relation on is total. In other words, satisfies identities and for all .
Example 28.
Below are some examples and non-examples of linear bands.
-
1.
The two-element monoid with a zero is a linear band.
-
2.
Consider the band with the operation given in Figure 2. It is not a linear band since the elements and are -incomparable, i.e., the two-sided ideals generated by and are incomparable with respect to inclusion. This example shows that linear bands are not closed under products.
-
3.
Consider the null monoid , with the operation , for each . The null monoid is given in Figure 2. The monoid is not a linear band.
A semigroup is in the class of semigroups if it satisfies the identity for each element and idempotent such that . The name comes from an equiavalent definition that all regular -classes of are aperiodic subsemigroups. They correspond to positive regular languages (subsets of ) recognised by 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 has a decidable satisfiability problem when is a linear band. It suffices to show the below result.
Proposition 30.
Let be a linear band and be a morphism. For each -suffix-storing set automaton there is an equivalent ordered quasi-normal set automaton.
Proof.
Let be a linear band and be a -suffix-storing set automaton for some morphism . Assume that 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 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 .
-
1.
If then .
-
2.
The relation is antisymmetric, i.e., and then .
-
3.
If then , and, if and then either or .
-
4.
If , and , then .
An order is easily found by fixing an ordering on the columns of each -class in the eggbox diagram of .
Let and denote and respectively. A (strict) -chain in is a sequence of elements from such that . Let be the length of the longest -chain in . The -height of an element , denoted by , is the length of the longest -chain starting with .
We observe that a subset is an -total set, if, and only if, it is -total, and equivalently, the elements of forms a strict -chain. Moreover, if is a strict -chain then .
Claim 31.
If is an -total set. Then for all , is also -total.
Proof.
Assume that is -total. It suffices to prove that for each , if , then , which follows from the fact that is stable under right multiplication (Fact 47).
Claim 32.
If for , then .
Proof.
Assume that . Let be a strict -chain starting in . Let , for , be such that . The we claim that the -chain is strict. Since we have . By induction, we have , for . Since is compatible with the -relation, we conclude that the chain is strict. Thus we infer that . The other direction follows symmetrically.
Claim 33.
Let be two elements such that . Then for each , if then .
Proof.
Assume that . We claim that . Otherwise and we also have , therefore by Fact 46 we have . Now by Claim 32 we have , a contradiction. Hence we have . Since is linear, we have either or . If we have since is in . Here we have , a contradiction. Thus and since we get . We deduce that .
We construct an ordered quasi-normal set automaton that has the family of sets , where and . The sets in are used to simulate the non-stable sets of the -suffix-storing set automaton . At any point during a run of the automaton , the set has the content of a unique nonempty set if it exists. During the run, except for the last transition, the sets in remain empty and the identity transformation is applied to them. At the last transition we copy the nonempty sets in to the corresponding set in (i.e., to ). The automaton simulates in the following way.
Since the automaton is -suffix-storing, at any point during the run, the subset is an -total set, and hence -total also. The contents of each is stored in the set and the automaton also remembers in its state the information about the element that corresponds to the nonempty set (this is a partial map defined as ). To effect the global update of , i.e., right multiplication by an element , the automaton moves the data values in each nonempty set to the set , i.e., by the global update , and replaces the map by the map . Note that since is a -total set, elements of form a strict -chain, and therefore whenever , for . Therefore each nonempty set corresponds to precisely one nonempty set from . On the last input pair the global update is simulated by the update , i.e., the sets in are copied to sets in 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 , where , and is ordered by the relation , and an arbitrary order is fixed on . 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 formulas over data words is decidable when is a linear band.
4.3 Undecidability with Guarded Regular Predicates not recognised by Linear Bands
Proposition 35.
If is an aperiodic monoid that is not a linear band then or divides .
Proof.
Let be an aperiodic monoid that is not a linear band. If contains an element that is not an idempotent then is not a band. Here divides the submonoid generated by . Hence assume that all elements of are idempotent. Now since is not a linear band, there exist two idempotents and that are -incomparable. Here divides .
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 formulas over data words is undecidable when or divides .
Theorem 37.
Let be a finite aperiodic monoid. Satisfiability of formulas over data words is undecidable when 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 consisting of formulas of the form
| (7) |
where and is in .
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 , there is a formula belonging to the restricted fragment of consisting of formulas of the form given in Equation 7 such that .
Theorem 42.
Set automata and are expressively equivalent.
Now by Proposition 22, we obtain the below corollary.
Corollary 43.
For each formula in , there is an equivalent formula in for some monoid .
6 Conclusion
We have characterised the decidability frontier for the 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 is a binary relation on that is reflexive and transitive. A preorder is total if or for each . We say the subset is -total if any two elements in is comparable with respect to , in other words 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 , its monoidal extension is defined to be if it is already a monoid and otherwise to be the monoid obtained by adjoining an identity element to it. We denote by the semigroup generated by elements in the set . For a semigroup , a subset of is a subsemigroup if implies that . A submonoid of a monoid is a subsemigroup containing the identity. An element of a semigroup is said to be an idempotent if . Let and be semigroups. The semigroup is a quotient of if there exists a surjective morphism from onto . The semigroup is said to divide if is a quotient of a subsemigroup of .
Definition 44 (Ideals).
Let be a semigroup. A right ideal of is a subset of such that , that is, for each and , we have that . Symmetrically, a left ideal is a subset of such that . A (two-sided) ideal is a subset of which is both a right and a left ideal, i.e. .
Definition 45 (Green’s relations).
Let be elements of a semigroup . The Green’s preorders , and are given as follows: for some , for some , and for some .
Let . The Green’s preorders have equivalence relations associated with them that are given as Further, the relation is given by .
These relations can be formulated in terms of ideals. We have that (respectively , ) if and only if (, ), that is, the ideal (right ideal, left ideal) generated by is contained in the ideal (right ideal, left ideal) generated by .
The equivalence class of an element under the relation is called the -class of and is denoted by . 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 be elements of a finite semigroup.
-
1.
If and then .
-
2.
If and then .
Fact 47 (Stability of and ).
The following is true in any semigroup.
-
1.
is stable on the left, i.e., if then . Hence, if then .
-
2.
is stable on the right, i.e., if then . Hence, if then .
