Order Invariance on Decomposable Structures
Abstract
Orderinvariant formulas access an ordering on a structure’s universe, but the model relation is independent of the used ordering. They are frequently used for logicbased approaches in computer science. Orderinvariant formulas capture unordered problems of complexity classes and they model the independence of the answer to a database query from lowlevel aspects of databases. We study the expressive power of orderinvariant monadic secondorder (mso) and firstorder (fo) logic on restricted classes of structures that admit certain forms of tree decompositions (not necessarily of bounded width).
While orderinvariant mso is more expressive than mso and, even, cmso (mso with modulocounting predicates) in general, we show that orderinvariant mso and cmso are equally expressive on graphs of bounded tree width and on planar graphs. This extends an earlier result for trees due to Courcelle. Moreover, we show that all properties definable in orderinvariant fo are also definable in mso on these classes. These results are applications of a theorem that shows how to lift up definability results for orderinvariant logics from the bags of a graph’s tree decomposition to the graph itself.
Keywords: finite model theory, firstorder logic, monadic secondorder logic, orderinvariant logic, modulocounting logic, bounded tree width, planarity
nolistsep,leftmargin= \setitemizelabel=– \setenumeratefont=
1 Introduction
A formula is orderinvariant if it has access to an additional total ordering on the universe of a given structure, but its answer is invariant with respect to the given order. The concept of order invariance is used to formalize the observation that logical structures are often encoded in a form that implicitly depends on a linear order of the elements of the structure; think of the adjacencymatrix representation of a graph. Yet the properties of structures we are interested in should not depend on the encoding and hence the implicit linear order, but just on the abstract structure. Thus, we use formulas that access orderings, but define unordered properties. This approach can be prominently found in database theory where formulas from firstorder (fo) and monadic secondorder (mso) logic are used to model query languages for relational databases and (hierarchical) xml documents, respectively. Being orderinvariant means in this setting that the formula evaluation process is always independent of lowlevel aspects of databases like, for example, the encoding of elements as indices. Another example approach can be found in descriptive complexity theory where formulas whose evaluation is invariant with respect to specific encodings of the input structure capture unordered problems decidable by certain complexity classes. The famous open problem of whether there is a logic that captures all unordered properties decidable in polynomial time falls into this category.
Gurevich [17] proved that orderinvariant fo (<invfo) is more expressive than fo (also see [24] for details). The same holds for orderinvariant mso (<invmso) and mso with modulocounting predicates (cmso); Ganzow and Rubin showed that <invmso is able to express more properties than cmso on general finite structures [15]. Since it is not possible to decide, for a given foformula, whether it is orderinvariant or not, this opens up the question of whether we can find alternative logics that are equivalent to the orderinvariant logics <invfo and <invmso. While on general logical structures no logics that are equivalent to <invfo or <invmso are known, this changes if we consider classes of structures that are wellbehaved. Benedikt and Segoufin [1] showed that <invfo and fo have the same expressive power on the class of all strings and the class of all trees (we write on to indicate that the properties definable in <invfo equal the properties definable in fo when considering structures from a class ). Considering <invmso, Courcelle [7] showed that it has the same expressive power as cmso on the class of trees (that means, on trees). Recently it was shown that and hold on classes of graphs of bounded tree depth [12]. More general results that apply to graphs of bounded tree width or planar graphs have not been obtained so far. This is due to the fact that, whenever we want to move from an orderinvariant logic to another logic on a class of structures, we need to understand both (1) the expressive power of the orderinvariant logic when restricted to these structures, and (2) the ability of the other logic to handle the structures in terms of, for example, definable decompositions.
Results.
Our results address both of these issues to better understand the expressive power of orderinvariant logics on decomposable structures.
Addressing issue (1), we prove two general results, which show how to liftup definability results for orderinvariant logics from the bags of tree decompositions up to the whole decomposed structure. We show that, whenever we are able to use msoformulas to define a tree decomposition whose adhesion is bounded (that means, bags have only bounded size intersections) and we can define total orderings on the vertices of each bag individually, then (Theorem 3.1) and (Theorem 3.2). Lifting theorems of this kind can be seen to be implicitly used earlier [1, 5, 6], but so far they only applied to the case where the defined tree decomposition has a bounded width. In this case, the whole structure can be easily transformed into an equivalent tree. Our theorems also handle the case where bags have an unbounded width: they merely assume the additional definability of a total ordering on bags, possibly using arbitrary parameters (which may be sets in the case of msodefinability). This is a much weaker assumption than having bounded width, and it covers larger graph classes. The proofs of the lifting theorems use typecomposition methods to show how one can define the logical types of structures from the logical types of substructures. The main challenge lies in trading the power of the used types (in our case these are certain orderinvariant types based on orderings that are compatible with the given decomposition) with the ability to prove the needed typecomposition methods. The latter need to work with bags of unbounded size and, thus, are more general than the typecomposition methods that are commonly used for the case of bounded size bags.
Addressing issue (2), we study two types of classes of graphs where it is possible to meet the assumptions of the lifting theorems and, thus, show that and hold on these classes. The first two results (formally stated as Theorems 5.6 and 5.7) apply to classes of graphs of bounded tree width. For the proof, we show that one can define tree decompositions of bounded adhesion in mso, where the bags admit msodefinable total orderings. Let us remark that in proving these results we do not rely on the msodefinability of widthbounded tree decompositions, a result announced by Lapoire [18], but only proved recently (and independently of our work) by Bojańczyk and Pilipczuk [3] [4]. Benedikt and Segoufin [1] had shown earlier how to prove these results using the msodefinability of widthbounded tree decompositions. Our second application of the lifting theorem is concerned with classes of graphs that, for some , do not contain as a minor. This includes the class of planar graphs and all classes of graphs embedabble in a fixed surface [22, 23]. Using an msodefinable tree decomposition into 3connected components due to Courcelle [8] along with proving that there are msodefinable total orderings for the 3connected bags of the decomposition, we are able to apply the lifting theorems to prove that (Theorem 5.10) and (Theorem 5.11) hold on every class of graphs that exclude as a minor for some .
Organization of the paper.
The paper starts with a preliminary section (Section 2) containing definitions related to graphs and logic. In Section 3, we formally state and prove the lifting theorems. Section 4 shows how to msodefine tree decompositions along clique separators and reviews the known msodefinable tree decomposition into 3connected components. Section 5 picks up the decomposed graphs and shows how to define total orderings for bags. This is combined with the lifting theorems to prove the results about bounded tree width graphs and minorfree graphs stated above.
2 Background
In the present section, we introduce the necessary background related to logical structures and graphs (Section 2.1), monadic secondorder logic and its variants (Section 2.2), logical games and types (Section 2.3), and transductions (Section 2.4).
2.1 Structures and Graphs
A vocabulary is a finite set of relational symbols where an arity is assigned to each . A structure over a vocabulary consists of a finite set , its universe, and a relation for every . We sometimes write by , in particular if is a symbol like .
An expansion of a structure is a structure for some vocabulary such that and for all . If is a structure and , then the induced substructure is the structure with universe and relations for all . Furthermore, we let .
Graphs are structures over the vocabulary with . When working with graphs, we also write for the graph’s universe (its set of vertices) and call its set of edges. The graphs we are working with are undirected. That means, for every two vertices and , we have if, and only if, and . The Gaifman graph of a structure has vertices and for every pair of distinct elements and that are part of a common tuple in , we insert the edge into ; thus, is always undirected.
A tree decomposition of a structure is a tree together with a labeling function satisfying the following two conditions. (Connectedness condition) For every element , the induced subtree is nonempty and connected. (Cover condition) For every tuple of a relation in , there is a with . It will be convenient to assume that the trees underlying our tree decompositions are directed. That means, all edges are directed away from a root. The set of neighbors of a node in a directed tree consists of its children (if is not a leaf) and its parent (if is not the root). The set of children of a node in a directed tree is denoted by . We omit from and if it is clear from the context. The sets for every are the bags of the tree decomposition. The width of the tree decomposition is and its adhesion is . The tree width, , of a structure is the minimum width of a tree decomposition for it. Structures and their Gaifman graphs have the same tree decompositions. In particular . The torso of a node in a tree decomposition for a structure with Gaifman graph is together with edges between all pairs for .
2.2 Monadic SecondOrder Logic and its Variants
Monadic secondorder logic (msologic) is defined by taking all secondorder formulas without secondorder quantifiers of arity 2 and higher. More specifically, to define its syntax, we use element variables for and set variables for . Formulas of msologic (msoformulas) over a vocabulary are inductively defined as usual (see, for example, [19]). Such formulas are also called formulas to indicate the vocabulary along with the logic. The set of free variables of an msoformula , denoted by , contains the variables of that are not used as part of a quantification. By renaming a formula’s variables, we can always assume for some ; we write to indicate that the free variables of are exactly to and to . Given an msoformula , indicates that together with the assignment , for , and , for , to ’s free variables satisfies . A formula without free variables is also called a sentence.
Monadic secondorder logic with modulocounting (cmsologic) extends msologic with the ability to access (builtin) modulocounting atoms for every where is a relation symbol. Given a structure over a vocabulary that contains , we have exactly if divides (that means, ). Atoms where is a set variable are used in the same way.
Let be a vocabulary and a binary relation symbol not contained in . An msosentence of vocabulary is orderinvariant if for all structures and all linear orders of we have if, and only if, . We can now form a new logic, orderinvariant monadic secondorder logic (<invmsologic), where the sentences of vocabulary are the orderinvariant sentences of vocabulary , and a structure satisfies an orderinvariant sentence if satisfies in the usual sense for some (and hence for all) linear orders of . There is a slight ambiguity in the definition of orderinvariant sentences in which binary relation symbol we are referring to as our special “order symbol” (there may be several binary relation symbols in ). But we always assume that is clear from the context. Alternatively, we could view as a “builtin” relation symbol that is fixed once and for all and is not part of any vocabulary. However, this would be inconvenient because we sometimes need to treat just as an ordinary relation symbol and the sentences of <invmsologic of vocabulary just as ordinary msosentences of vocabulary .
Firstorder logic (fologic) and orderinvariant firstorder logic (<invfologic) are defined by taking all sentences of msologic and <invmsologic, respectively, that do not contain set variables.
2.3 Games and Types
The quantifier rank of an msoformula , denoted by , is the maximum number of nested quantifiers in . For structures and , we write if and satisfy the same msosentences of quantifier rank at most . We write if and satisfy the same orderinvariant msosentences of quantifier rank at most . For every , we write if and satisfy the same cmsosentences of quantifier rank at most and only numbers are used in the modulocounting atoms.
It will sometimes be convenient to use versions of mso and cmso without element variables (see, for example, [25]). In particular, in the context of EhrenfeuchtFraïssé games. We will freely do so. We assume that the reader is familiar with the characterizations of msoequivalence and cmsoequivalence by EhrenfeuchtFraïssé games (see, for example, [11, 15]). Corresponding to the versions of the logics without element variables, we use a version of the games where the players only select sets and never elements, and a position induces a partial isomorphism if the mapping between the singleton sets of the position is a partial isomorphism. (The rules of the game require the Duplicator to answer to a singleton set with a singleton set and to preserve the subset relation.) Then a position of the game on structures is a sequence of pairs of subsets and . The position is a move winning position for one of the players if this player has a winning strategy for the move game starting in this position.
We also use the concept of types. Let be a vocabulary and . Then for all structures and sets , the msotype of of quantifier rank is
Moreover, the class of all types over with respect to rank and free set variables is
and we let . For , we say that a cmsoformula has rank at most if it has quantifier rank at most and only contains modulocounting atoms with . Based on this notion of rank, we define the cmsotype , and sets and .
Note that if, and only if, is a move winning position for the Duplicator in the msogame on . Furthermore, for we have if, and only if, . Similar remarks apply to cmsotypes.
For a vocabulary and a binary relation symbol , we say that a subset is orderinvariant if for all structures and all linear orders of we have if, and only if, . If is inclusionwise minimal orderinvariant, then we call it an orderinvariant type. Note that every is contained in exactly one orderinvariant type, which we denote by . We set , the set of all orderinvariant types. For a structure , we call the set for some and, hence, for all linear orders of the orderinvariant msotype of of quantifier rank . It may seem more natural to define the orderinvariant type of a structure as the set of all orderinvariant sentences it satisfies. The following proposition says that this would lead to an equivalent notion, but our version is easier to work with, because it makes the connection between types of ordered structures and orderinvariant types more explicit.
Lemma 2.1.
For all structure , the following statements are equivalent.

.

.

There is a sequence of structures and linear orders with , , and for all .
Proof of Lemma 2.1.
For proving (1)(3), suppose . Let for some linear order of and for some linear order of . Let be the class of all ordered structures such that there is a sequence of structures and linear orders such that and and for all , and let the class of types for . An easy induction on the length of the witnessing sequence shows that . Moreover, is orderinvariant, and thus . Similarly, we define and prove that . Thus , and this implies (3).
To prove (3)(2), just note that all structures in a witnessing sequence satisfy the same orderinvariant formulas.
Finally, to prove (2)(1), suppose that . Let for some linear order of . Then . Let with . Then is an orderinvariant msosentence of quantifier rank . As , we have , and thus satisfies as a sentence of <invmso. Hence satisfies as a sentence of <invmso, and thus for some linear order of . Thus there is a such that , which implies . Hence . ∎
2.4 Transductions
Transductions define new structures out of a given structure. We use copying msotransductions as defined in [10], but based on the below terminology. They are able to (1) enlarge the universe of a given structure by establishing copies of each element, (2) define relations over the new universe from the given structure, and (3) not only define a single structure, but a set of new structures parameterized by adding monadic relations to the given structure.
An msotransduction of width with parameters for some is defined via a finite collection of msoformulas over where the relation symbols are monadic and not part of . consists of a group of msoformulas ,…, for defining the universe of a new structure and for each with some arity a group of formulas for . Given a structure and , they define the universe of a structure via
and for each relation symbol the relation
Finally, by ranging over all possible parameters, defines the set
for a given structure where is a formula that is also part of the transduction, which singles out the valid combinations of the given structure and parameters. Moreover, for a structure , we set . For an element , we call its level.
msotransductions preserve msodefinability (formally stated by Fact 2.2) and they can be composed to form new transductions (formally stated by Fact 2.3). For a formal proof of Fact 2.3, which implies Fact 2.2, see [10]. The facts also hold if we replace all occurrences of mso by cmso.
Fact 2.2 (mso is closed under msotransductions).
Let be an msodefinable property of structures and an msotransduction. Then the property of structures is msodefinable.
Fact 2.3 (msotransductions are closed under composition).
Let be an transduction and be an for some vocabularies . Then there is an transduction with for every structure .
3 Lifting Definability
An ordered tree decomposition of a structure is a tree decomposition of together with a linear order for each bag. We represent ordered tree decompositions by logical structures in the following way. An ordered tree extension (otx for short) of a structure is a structure that extends by a tree decomposition of and a linear order of for each . The adhesion of is the adhesion of the tree decomposition . Formally, we view as a structure over the vocabulary , where and are unary, and are binary, and is ternary. Of course we assume that none of these symbols appears in . In the structure , these symbols are interpreted as follows:
An transduction defines an otx (of adhesion at most ) of a structure if every is isomorphic to an otx of (of adhesion at most ) and is nonempty. We say that defines otxs (of adhesion at most ) on a class of structures if defines an otx (of adhesion at most ) of every . Moreover, admits msodefinable ordered tree decompositions (of bounded adhesion) if there is such a transduction that defines otxs (of adhesion at most for some constant ) on . We make similar definitions for the logic cmso.
We prove the following theorems, which show how to use the tree decompositions and the bag orderings to define properties of orderinvariant formulas without using order invariance.
Theorem 3.1 (Lifting theorem for <invmso).
Let be a class of structures that admits cmsodefinable ordered tree decompositions of bounded adhesion. Then on .
Theorem 3.2 (Lifting theorem for <invfo).
Let be a class of structures that admits msodefinable ordered tree decompositions of bounded adhesion. Then on .
Theorem 3.1 is proved in three steps: First, in Section 3.1, we modify the given ordered tree extension, such that its tree decomposition follows a certain normal form that allows to partition its nodes into two different classes (called anodes and bnodes). The partition of the nodes along with a global partial order that is based on the local orderings in the bags is then encoded as part of the structure, turning every otx into an expanded otx. Second, in Section 3.2, we prove typecomposition lemmas for both the anodes and the bnodes. They show how one can define the type of an expanded otx with respect to total orderings that respect the already existing partial order from the types of substructures that arise by adding such compatible orderings to them. Third, Section 3.3 shows how these typecomposition lemmas can be used in the context of orderinvariance. Finally, Section 3.4 applies the type compositions to prove Theorem 3.1. The proof of Theorem 3.2 proceeds in a similar way. The modifications that we need to apply to the proof of Theorem 3.1 in order to prove Theorem 3.2 are mentioned along the way.
3.1 Segmented Ordered Tree Extensions
Recall that we view the tree in a tree decomposition as directed. A tree decomposition of a structure is segmented if the set can be partitioned into a set of adhesion nodes and a set of bag nodes (anodes and bnodes, for short) satisfying the following conditions.

For all edges , either and or and .

For all anodes and all distinct neighbors , we have .

For all bnodes and all distinct neighbors we have .

All leaves of are bnodes.
We can transform an arbitrary tree decomposition into a segmented tree decomposition as follows. In the construction, we view as an undirected tree. We will have . Thus we can direct the edges of away from the root of , which will remain the root of . We first contract all edges with , resulting in a decomposition where for all . Then, for all edges , we introduce a new node , where , and edges from to and . Then we identify all nodes and such that . We let be the resulting tree. The nodes from the original tree are the bnodes, and the nodes are the anodes. We define on by for and for all . The resulting tree decomposition is segmented. This transformation is definable by an msotransduction. Thus we may assume that the tree decompositions in ordered tree extensions are segmented, because there is an transduction that transforms every otx into an otx where the tree decomposition is segmented.
For the rest of this section, we fix a vocabulary that does not contain the order symbol and a . In the rest of this section, we only consider otxs of structures. We assume that the adhesion of these otxs is at most and their tree decomposition is segmented.
It will be convenient to introduce some additional notation. As before, whenever we denote an otx by , we denote the underlying structure by and the tree decomposition by . We denote the descendant order in the tree of an otx by . For every node , we let be the subtree of rooted in , that is, . We let , called the cone of , be the union of all bags for . If is the parent of we let ; this is the separator at . For the root we let . In all these notations we may omit the index if is clear from the context. Note that for all anodes of and all we have .
We expand an otx to a structure over the vocabulary , where are unary and are binary relation symbols that do not appear in . We let and be the sets of anodes and bnodes of the tree , respectively, and
We let be the partial order on defined as follows. We first define the restriction of to . For all bnodes , we let be the linear order on defined by if the set is lexicographically smaller than or equal to the set with respect to the linear order on , for all children . This is indeed a linear order because is a linear order of and for all distinct . Then we let the restriction of to be the reflexive transitive closure of the “descendant order” on and all the relations for bnodes . To define the restriction of to , for every we let be the topmost (that is, minimal) node such that . Then we let if, and only if, or and . To complete the definition of , we let for all and .
Finally, we define the relations by letting be the set of all pairs , where and is the th element of with respect to the partial order , which is a linear order when restricted to . Recall that we have by our general assumption that the adhesion of all otxs is at most . This completes the definition of . It is easy to see that there is an transduction that defines in .
We call an expanded otx (otxx for short) of . More generally, we call a structure an expanded otx if there is a structure such that is an otxx of . Let be an expanded otx. For every , we let
We call a structure a subotxx if there is an otxx and a node with . The only difference between an otxx and a subotxx is that in an otxx the set is empty for the root whereas in a subotxx it may be nonempty.
Lemma 3.3.
There are msosentences otxxs and subotxx of vocabulary defining the classes of all otxx and subotxx (satisfying our general assumptions: the tree decomposition is segmented and has adhesion at most ).
Proof.
Straightforward. ∎
We will later modify an otxx by replacing a subotxx , for some , by another subotxx . Let be the root node of the tree . The replacement is possible if the induced substructures and are isomorphic. If they are, there is a unique isomorphism, because and are linearly ordered by the restrictions of , . Now replacing by in just means deleting all elements in except those in , adding a disjoint copy of , and identifying the elements in and according to the unique isomorphism. Note that the substructures and are isomorphic if the subotxxs and satisfy the same firstorder sentences of quantifier rank , where denote the maximum arity of a relation symbol in the vocabulary . To express isomorphism, we use the relations and the fact that the root of an otxx can be defined by a formula of quantifier rank . Thus in particular, if for some , we can replace by .
Finally, we say that a linear order on an otxx or subotxx is compatible if it extends the partial order . If is a compatible linear order, then denotes the expansion of by this order, and denotes the induced substructure where is restricted to the subotxx . We can extend the replacement operation to such ordered expansions of otxxs; in the same way we replace a subotxx by , we can replace a by for some compatible linear order of .
3.2 Ordered Type Compositions
As all structures we are working with in this subsection are otxxs and subotxx, we denote them by rather than . Apart from that, we use the same notation as before. In particular, if is an otxx then by we denote the tree of its tree decomposition, and for a node , by we denote the subotxx rooted in , and we let .
Throughout this subsection, we fix a such that and and is at least the quantifier rank of the formulas otxx and subotxx of Lemma 3.3. This means that if is an otxx (or subotxx) and an arbitrary structure with , then is an otxx (a subotxx) as well. Furthermore, if are the root nodes of , , respectively, then the induced substructures and are isomorphic. Finally, if are otxxs and are linear orders of , respectively, such that then is compatible if, and only if, is compatible.
We let . Furthermore, we assume that .
Let be an otxx, a compatible linear order of , and (usually for a node ). For all , let be the set of all such that . We call the type partition of . (Note that some of the may be empty. We always allow partitions to have empty parts.) The following lemma extends classical typecomposition theorems [21, 14] to our situation, where substructures are combined through bnodes.
Lemma 3.4 (Ordered type composition at bnodes).
For every there is an formula such that for every otxx , every bnode , and every compatible linear order of , if is the type partition of , then
Proof.
For , let , and suppose that . Then and , and we may assume that for all . Let . The core of the proof is the following claim.
Claim.
Let be otxxs and compatible linear orders of , respectively. Let and . Let and be the type partitions of