Model Checking Existential Logic on Partially Ordered Sets111This research was supported by ERC Starting Grant (Complex Reason, 239962) and FWF Austrian Science Fund (Parameterized Compilation, P26200).
We study the problem of checking whether an existential sentence (that is, a first-order sentence in prefix form built using existential quantifiers and all Boolean connectives) is true in a finite partially ordered set (in short, a poset). A poset is a reflexive, antisymmetric, and transitive digraph. The problem encompasses the fundamental embedding problem of finding an isomorphic copy of a poset as an induced substructure of another poset.
Model checking existential logic is already NP-hard on a fixed poset; thus we investigate structural properties of posets yielding conditions for fixed-parameter tractability when the problem is parameterized by the sentence. We identify width as a central structural property (the width of a poset is the maximum size of a subset of pairwise incomparable elements); our main algorithmic result is that model checking existential logic on classes of finite posets of bounded width is fixed-parameter tractable. We observe a similar phenomenon in classical complexity, where we prove that the isomorphism problem is polynomial-time tractable on classes of posets of bounded width; this settles an open problem in order theory.
We surround our main algorithmic result with complexity results on less restricted, natural neighboring classes of finite posets, establishing its tightness in this sense. We also relate our work with (and demonstrate its independence of) fundamental fixed-parameter tractability results for model checking on digraphs of bounded degree and bounded clique-width.
Motivation. The model checking problem, to decide whether a given logical sentence is true in a given structure, is a fundamental computational problem which appears in a variety of areas in computer science, including database theory, artificial intelligence, constraint satisfaction, and computational complexity. The problem is computationally intractable in its general version, and hence it is natural to seek restrictions of the class of structures or the class of sentences yielding sufficient or necessary conditions for computational tractability.
Here, as usual in the complexity investigation of the model checking problem, computational tractability refers to polynomial-time tractability or, in cases where polynomial-time tractability is unlikely, a relaxation known as fixed-parameter tractability with the sentence as a parameter. The latter guarantees a decision algorithm running in time on inputs of size and sentences of size , where is a computable function and is a constant. For further discussion of the complexity setup adopted here, including its algorithmic motivations, we refer the reader to [12, 8].
The study of model checking first-order logic on restricted classes of finite combinatorial structures is an established line of research originating from the seminal work of Seese . Results in this area have provided very general conditions for computational tractability, and even exact characterizations in many relevant cases . As Grohe observes , though, it would be also interesting to investigate structural properties facilitating the model checking problem in the realm of finite algebraic structures, for instance groups or lattices.
In this paper, we investigate the class of finite partially ordered sets. A partially ordered set (in short, a poset) is the structure obtained by equipping a nonempty set with a reflexive, antisymmetric, and transitive binary relation. In other words, the class of posets coincides with the class of directed graphs satisfying a certain universal first-order sentence (axiom); namely, the sentence that enforces reflexivity, antisymmetry, and transitivity of the edge relation. In this sense, from a logical perspective, posets form an intermediate case between combinatorial and algebraic structures; they can be viewed as being stronger than purely combinatorial structures, as the nonlogical vocabulary is presented by a first-order axiomatization; but weaker than genuinely algebraic structures, as the axiomatization is expressible in universal first-order logic (too weak of a fragment to define algebraic operations).
Posets are fundamental combinatorial objects [11, Chapter 8], with applications in many fields of computer science, ranging from software verification  to computational biology . However, very little is known about the complexity of the model checking problem on classes of finite posets; to the best of our knowledge, even the complexity of natural syntactic fragments of first-order logic on basic classes of finite posets is open.
A prominent logic in first-order model-checking is primitive positive logic, that is, first-order sentences built using existential quantification () and conjunction (); the problem of model checking primitive positive logic is equivalent to the constraint satisfaction problem and the homomorphism problem . However, restricted to posets, the problem of model checking primitive positive logic and even existential positive logic, obtained from primitive positive logic by including disjunction () in the logical vocabulary, is trivial; because of reflexivity, every existential positive sentence is true on every poset!
As we observe (Proposition 2), the complexity scenario changes abruptly in existential conjunctive logic, that is, first-order sentences in prefix negation normal form built using , , and negation (). Here, the model checking problem is NP-hard even on a certain fixed finite poset; in the complexity jargon, the expression complexity of existential conjunctive logic is NP-hard on finite posets. In other words, as long as computational tractability is identified with polynomial-time tractability, any structural property of posets is algorithmically immaterial (in a sense that can be made precise). There is then a natural quest for relaxations of polynomial-time tractability yielding (i) a nontrivial complexity analysis of the problem, and (ii) a refined perspective on the structural properties of posets underlying tamer algorithmic behaviors; in this paper we achieve (i) and (ii) through the glasses of fixed-parameter tractability.
More precisely, as we discuss below, our contribution is a complete description of the parameterized complexity of model checking (all syntactic fragments of) existential first-order logic (first-order sentences in prefix normal form built using , , , and ), with respect to classes of finite posets in a hierarchy generated by fundamental poset invariants.222Note that existential disjunctive logic (first-order sentences in prefix negation normal form built using , , and ) is trivial on posets. In fact, every sentence in the fragment is either true on every poset, or false on every poset, and it is easy to check which of the two cases holds for any given sentence.
Model checking existential logic encompasses as a special case the fundamental embedding problem, to decide whether a given structure contains an isomorphic copy of another given structure as an induced substructure; in fact, the embedding problem reduces in polynomial-time to the problem of model checking certain existential (even conjunctive) sentences. The aforementioned fact that existential conjunctive logic is already NP-hard on a fixed finite poset leaves open the existence of a nontrivial classical complexity classification of the embedding problem. We provide such a classification by giving a complete description of the classical complexity of the embedding problem in the introduced hierarchy of poset invariants.
We hope that the investigation of the existential fragment prepares the ground (and possibly provides basic tools) for understanding the model checking problem for more expressive logics on posets.
In contrast to the classical case, model checking existential logic on fixed structures is trivially fixed-parameter tractable; in fact, even the full first-order logic is trivially fixed-parameter tractable on any class of finite structures of bounded size. On the other hand, there exist classes of finite posets where existential logic is unlikely to be fixed-parameter tractable (in fact, there exist classes where even the embedding problem is -hard); but the reduction class given by the natural hardness proof is rather wild, in particular it has bounded depth but unbounded width (Proposition 4).
The width of a poset is the maximum size of a subset of pairwise incomparable elements (antichain); along with its depth, the maximum size of a subset of pairwise comparable elements (chain), these two invariants form the basic and fundamental structural properties of a poset, arguably its most prominent and natural features. Our main result establishes that width helps algorithmically (in contrast to depth); specifically, we prove that model checking existential logic on classes of finite posets of bounded width is fixed-parameter tractable (Theorem 5). This, together with Seese’s algorithm (plus a routine reduction described in Proposition 6), allows us to complete the parameterized complexity classification of the investigated poset invariants, as depicted in Figure 1.
We believe that our tractability result essentially enlightens the fundamental feature of posets of bounded width that can be exploited algorithmically; namely, bounded width posets admit a polynomial-time compilation to certain semilattice structures, which are algorithmically tamer than the original posets, but equally expressive with respect to the problem at hand. The proof proceeds in two stages. We first prove that, on any class of finite relational structures, model checking existential logic is fixed-parameter tractable if and only if the embedding problem is fixed-parameter tractable (Proposition 1). Next, using the color coding technique of Alon, Yuster, and Zwick , we reduce an instance of the embedding problem on posets of bounded width to a suitable family of instances of the homomorphism problem of certain semilattice structures, which is polynomial-time tractable by classical results of Jeavons, Cohen, and Gyssens .
Our approach is reminiscent of the well established fact in order theory that finite posets correspond exactly (in a sense that can be made precise in category-theoretic terms) to finite distributive lattices. However, the algorithmic implications of this correspondence have been possibly overlooked. Indeed, using the correspondence and the known fact that the isomorphism problem is polynomial-time tractable on finite distributive lattices, we prove that the isomorphism problem for posets of bounded width is polynomial-time tractable (Theorem 8), which settles an open question in order theory [2, p. 284].
Motivated by the equivalence (in parameterized complexity) between embedding and model checking existential conjunctive logic (Proposition 1) on one hand, and the fact that existential conjunctive logic is already NP-hard on a fixed finite poset (Proposition 2) on the other hand, we also revisit the classical complexity of the embedding problem for finite posets and classify it with respect to the poset invariants studied in the parameterized complexity setting. The outcome is pictured in Figure 1; here, polynomial-time tractability of the embedding problem on posets of bounded size is optimal with respect to the studied poset invariants. We remark that the hardness results are technically involved (Theorem 6 and Theorem 7); in particular, bounded width is a known obstruction for hardness proofs (for instance, the complexity of the dimension problem is unknown on bounded width posets).
We conclude mentioning that our work on posets relates with, but is independent of, general results by Seese  and Courcelle, Makowsky, and Rotics , respectively, on model checking first-order logic on classes of finite graphs of bounded degree and bounded clique-width. Namely, the order relation of a poset has bounded degree if and only if the poset has bounded depth and bounded cover-degree (that is, its cover relation has bounded degree); moreover, if a poset has bounded width, then it has bounded cover-degree (Proposition 3). However, there exist classes of bounded width posets with unbounded degree (for instance, chains), and there exist classes of bounded width posets with unbounded clique-width (Proposition 5), which excludes the direct application of the aforementioned results.
For all integers , we let denote the set .
Logic. In this paper, we focus on relational first-order logic. A vocabulary is a finite set of relation symbols, each of which is associated to a natural number called its arity; we let denote the arity of . An atom (over vocabulary ) is an equality of variables () or is a predicate application , where and are variables. A formula (over vocabulary ) is built from atoms (over ), conjunction (), disjunction (), negation (), universal quantification (), and existential quantification (). A sentence is a formula having no free variables. We let denote the class of first-order sentences in prefix negation normal form, that is, for each , the quantifiers occur in front of the sentence and the negations occur in front of the atoms.
Let be a subset of containing at least one quantifier and at least one binary connective. We let denote the syntactic fragment of -sentences built using only logical symbols in . We call the existential fragment, the existential conjunctive fragment, and , the existential conjunctive positive (or primitive positive) fragment.
Structures. Let be a relational vocabulary. A structure (over ) is specified by a nonempty set , called the universe of the structure, and a relation for each relation symbol . A structure is finite if its universe is finite.
All structures considered in this paper are finite.
Given a structure and , we denote by the substructure of induced by , namely the universe of is and for all .
Let and be -structures. A homomorphism from to is a function such that implies , for all and all ; a homomorphism from to is strong if implies . An embedding from to is an injective strong homomorphism from to . An isomorphism from to is a bijective embedding from to .
In graph theory, an injective strong homomorphism is also called a “strong embedding”, and the term “embedding” is used in the weaker sense of injective homomorphism; here, we adopt the order-theoretic (and model-theoretic) terminology.
For a structure and a sentence over the same vocabulary, we write if the sentence is true in the structure . When is a structure, is a mapping from variables to the universe of , and is a formula over the vocabulary of , we liberally write to indicate that is satisfied by and .
A structure with is called a digraph, and a graph if is irreflexive and symmetric. We let denote the class of all graphs. Let be a digraph. The degree of , in symbols , is equal to , and the degree of , in symbols , is the maximum degree attained by the elements of .
A digraph is a poset if is a reflexive, antisymmetric, and transitive relation over , that is, respectively, , , and .
A chain in is a subset such that or for all (in particular, if is a chain in , we call itself a chain). We say that and are incomparable in (denoted ) if . An antichain in is a subset such that for all (in particular, if is an antichain in , we call itself an antichain).
Let be a poset and let . We say that covers in (denoted ) if and, for all , implies . The cover graph of is the digraph with vertex set and edge set . If is a class of posets, we let . It is well known that computing the cover relation corresponding to a given order relation, and vice versa the order relation corresponding to a given cover relation, is feasible in polynomial time .
In the figures, posets are represented by their Hasse diagrams, that is a diagram of their cover relation where all edges are intended oriented upwards.
Let be the class of all posets. A poset invariant is a mapping such that for all such that and are isomorphic. Let inv be any invariant over . Let be any class of posets. We say that is bounded with respect to inv if there exists such that for all . Two poset invariants are incomparable if there exists a class of posets bounded under the first but unbounded under the second, and there exists a class of posets bounded under the second but unbounded under the first.
Problems. We refer the reader to  for the standard algorithmic setup of the model checking problem, including the underlying computational model, encoding conventions for input structures and sentences, and the notion of size of the (encoding of an) input structure or sentence. We also refer the reader to  for further background in parameterized complexity theory (including the notion of fpt many-one reduction and fpt Turing reduction).
Here, we mention that a parameterized problem is a problem together with a parameterization , where is a finite alphabet. A parameterized problem is fixed-parameter tractable (with respect to ), in short fpt, if there exists a decision algorithm for , a computable function , and a polynomial function , such that for all , the running time of the algorithm on is at most . We provide evidence that a parameterized problem is not fixed-parameter tractable by proving that the problem is -hard under fpt many-one reductions; this holds unless the exponential time hypothesis fails .
The (parameterized) computational problems under consideration are the following. Let be a relational vocabulary, be a class of -structures, and be a class of -sentences. The model checking problem for and , in symbols , is the problem of deciding, given , whether . The parameterization, given an instance , returns the size of the encoding of . The embedding problem for , in symbols , is the problem of deciding, given a pair , where is a -structure and is a -structure in , whether embeds into . The parameterization, given an instance , returns the size of the encoding of . The problems and are defined similarly in terms of homomorphisms and isomorphisms respectively.
3 Basic Results
In this section, we set the stage for our parameterized and classical complexity results in Section 4 and Section 5 respectively. We start observing some basic reducibilities between the problems under consideration.
Let be a class of structures. The following are equivalent.
is fixed-parameter tractable.
is fixed-parameter tractable.
is fixed-parameter tractable.
In particular, polynomial-time (thus fpt) many-one reduces to .
Let be a class of -structures.
We give a polynomial-time many-one reduction of to . Note that embedding a -structure into a -structure reduces to checking whether verifies the existential closure of the -formula
Clearly, polynomial-time many-one reduces to . We conclude the proof giving a fpt Turing (in fact, even truthtable) reduction, from to .
Let . Say that is disjunctive if and for all . Clearly, for every , a disjunctive such that is computable by (equivalence preserving) syntactic replacements.
Let be a -sentence in . Say that the disjunctive -sentence is a completion of if and, for all , if the quantifier prefix of is , then:
for all , it holds that or occur in the quantifier free part of ;
for all and all , it holds that or occur in the quantifier free part of ;
moreover, is said reduced if, for all , is satisfiable, does not contain dummy quantifiers, and does not contain atoms of the form .
Let be a reduced completion of the -sentence . Clearly, is computable from as follows. Let be the quantifier prefix of .
For all such that neither nor occur in the quantifier free part of , conjoin to the quantifier free part of .
For all and such that neither nor
occur in the quantifier free part of , conjoin to the quantifier free part of .
Compute a disjunctive form of the resulting sentence, eliminate equality atoms and dummy quantifiers from each disjunct, and finally eliminate unsatisfiable disjuncts (empty disjunctions are false on all structures).
Note that for each , the disjunct naturally corresponds to a -structure , defined as follows. Let be the quantifier prefix of . The universe is , and if and only if occurs in the quantifier free part of .
We are now ready to describe the reduction. Let be an instance of . The algorithm first computes a disjunctive form logically equivalent to , say , and then, for each , computes a reduced completion logically equivalent to , say . For each and , let be the structure corresponding to .
We claim that if and only if there exist and such that embeds into . The backwards direction is clear. For the forwards direction, assume . Then, there exist and such that . Then, embeds into .
Thus, the algorithm works as follows. For each and , it poses the query to the problem , and it accepts if and only if at least one query answers positively. ∎
The next observation is that model checking existential conjunctive logic (and thus the full existential logic) on posets is unlikely to be polynomial-time tractable, even if the poset is fixed. Let be the bowtie poset defined by the universe and the covers for all and .
Let be a relational vocabulary where and for all . Let be the -structure such that is isomorphic to , say without loss of generality via the isomorphism for all , and where for all . By the case of the main theorem in Pratt and Tiuryn [16, Theorem 2], the problem is NP-hard. We give a polynomial-time many-one reduction of to .
Let be an instance of , and let be the existential closure of the conjunction of the following -literals (thus, is a -sentence on the vocabulary of ):
, for all ;
, for all and ;
, for all and ;
, for all .
It is easy to check that maps homomorphically to if and only if . ∎
In contrast, model checking existential logic on any fixed poset is trivially fixed-parameter tractable (the instance is a structure of constant size, and a sentence taken as a parameter). However, there are classes of posets where the embedding problem, and hence, by Proposition 1, the problem of model checking existential logic, is unlikely to be fixed-parameter tractable, as we now show.
First, we introduce a family of poset invariants and relate them as in Figure 2. Let be a poset.
The size of is the cardinality of its universe, .
The width of , in symbols , is the maximum size attained by an antichain in .
The depth of , in symbols , is the maximum size attained by a chain in .
The degree of , in symbols , is the degree of the order relation of , that is, .
The cover-degree of , in symbols , is the degree of the cover relation of , that is, .
Let be a class of posets.
has bounded degree if and only if has bounded depth and bounded cover-degree.
If has bounded width, then has bounded cover-degree.
has bounded size if and only if has bounded width and bounded degree.
We prove (i). Assume that has bounded degree. Let . Then follows from the fact that is contained in , while follows from the fact that each chain forms a complete directed acyclic subgraph in . Conversely, let and be the largest depth and cover-degree attained by a poset in , respectively. Then, for every and , it holds that , hence has bounded degree.
We prove (ii). Let be the largest width attained by a poset in . Then, for every and , it holds that , because the lower covers of and the upper covers of form antichains in , hence has at most lower or upper covers. Hence, has bounded cover-degree.
We prove (iii). Assume that has bounded size. Let be the largest size attained by a poset in . Then, for every , it holds that , that is, has bounded width and bounded degree. Conversely, by (i), has bounded depth. Let and be the largest depth and width attained by a poset in , respectively. Let . By Dilworth’s theorem, there exist chains in whose union is , hence . We conclude that has bounded size. ∎
The previous proposition, together with the observation that bounded width and bounded degree (bounded width and bounded depth, bounded cover-degree and bounded depth, respectively) are incomparable, justifies the order in Figure 2, whose interpretation is the following: invariant inv is below invariant if and only if, for every class of posets, if is bounded under inv, then is bounded under .
The emerging hierarchy of poset invariants will provide a measure of tightness for our positive algorithmic results, once we will manage to surround them with complexity results on covering neighboring classes.
To this aim, we immediately observe that there exists a class of posets of bounded depth where the embedding problem, and hence model-checking existential first-order logic, is -hard. Given any graph , construct a poset by taking pairwise disjoint -element chains, and covering the bottom of the th chain by the top of the th chain if and only if and are adjacent in . Note that . Hence, the class has bounded depth.
Clique fpt many-one reduces to by mapping to . ∎
For the parameterized complexity of model checking existential logic, we have tractability on bounded degree classes by Seese’s algorithm , and hardness on (certain) bounded depth classes by Proposition 4. In Section 4, we establish tractability on bounded width classes by Theorem 5, and hardness on (certain) bounded cover-degree classes by Proposition 6.
We conclude the section by relating our work on posets of bounded width with previous work on digraphs of bounded clique-width, and showing that our results are indeed independent.
Clique-width is a prominent invariant of undirected as well as directed graphs which generalizes treewidth ; in particular, it is known that monadic second-order logic (precisely, ) is fixed-parameter tractable on digraphs of bounded clique-width , thus:
is fixed-parameter tractable for any class of posets such that the clique-width of is bounded.
Since it is possible to compute the cover relation from the order relation (and vice versa) in polynomial time, one might wonder whether using the clique-width of the cover graph would allow us to efficiently model check wider classes of posets. This turns out not to be the case:
Observation 2 (follows from Examples 1.32, 1.33 and Corollary 1.53 of ).
For any class of posets, the clique-width of is bounded if and only if the clique-width of is bounded.
A natural class of posets which is easily observed having clique-width bounded by (despite having unbounded treewidth) is the class of series parallel posets. However, we show that there exist classes of posets of bounded width which do not have bounded clique-width (if not Theorem 5 would follow from Observation 1).
There exists a class of posets which has bounded width but does not have bounded clique-width.
For each , we define a poset as follows. The universe is and the cover relation is defined by the following pairs:
Notice that contains a grid as a subgraph; indeed, one may define the th row of the grid to consist of the chain and similarly the th column to consist of for odd and for even . Furthermore, has width and has degree . We will prove that has unbounded clique-width.
Let be the class of undirected graphs corresponding to the covers of (that is, contains the symmetric closure of for all ). Since contains graphs with arbitrarily large grids, has unbounded tree-width. Hence also has unbounded clique-width by [5, Corollary 1.53], and the fact that it has bounded degree. It is a folklore fact that for any graph and any orientation of , the clique-width of is bounded by the clique-width of (indeed, one can use the same decomposition in this direction). Since contains one orientation for each graph in and since has unbounded clique-width, we conclude that has unbounded clique-width. ∎
4 Parameterized Complexity
In this section, we study the parameterized complexity of the problems under consideration. The section is organized as follows.
4.1 Embedding is FPT on Bounded Width Posets
We first outline our proof strategy. The core of the proof lies in defining a suitable compilation of bounded width posets. We then proceed in two steps:
proving that the homomorphism problem is polynomial-time tractable on such compilations, and
reducing the embedding problem between two bounded width posets to fpt many instances of the homomorphism problem between compilations of these posets.
For (i), we prove that the compilation admits a semilattice polymorphism (Lemma 1), and use the classical result by Jeavons et al. that the homomorphism problem is polynomial-time tractable on semilattice structures (Theorem 1). For (ii), we use color coding and hash functions (Theorem 2) to link a homomorphism between two compilations to the existence of an embedding between the compiled posets (Lemma 2).
4.1.1 Known Facts
The proof uses known facts about semilattice structures and hash functions, collected below.
Semilattice Polymorphisms. Let be a finite relational vocabulary, and let be a -structure. Let be an -ary function on . We say that is a polymorphism of (or, admits ) if preserves all relations of , that is, for all , where , if
We say that a function is a semilattice function over if is idempotent, associative, and commutative on , that is, , , and for all .
Theorem 1 ().
Let be a -structure, and let be a semilattice function over . If is a polymorphism of , then is polynomial-time tractable.
Hash Functions. Let and be sets, and let . A -perfect family of hash functions from to is a family of functions from to such that for every subset of cardinality there exists such that is injective.
[Theorem 13.14, ] Let be a finite set. There exists an algorithm that, given and , computes a -perfect family of hash functions from to of cardinality in time .
4.1.2 Semilattice Compilation
Let be a poset. Let be a tuple of numbers. A chain partition of is a tuple such that for all , , for all , is the substructure of induced by , and is a chain.
Let be the poset with universe , where and , and cover relation , , , , and . Then, is a chain partition of . See Figure 3 (left).
Let be the poset with universe , where and , and cover relation , , , , , , , and . Then, is a chain partition of . See Figure 3 (right).
The mapping defined by , , , , , , , embeds into .
[Theorem 1, ] Let be a poset. Then, in time , it is possible to compute both and a chain partition of of the form .
We are now ready to define the aforementioned compilations. Note that our compilations will depend not only on the poset itself, but also on a chain decomposition of the poset and a family of colorings (the significance of the latter will become clear in the proof of Lemma 2).
Let be a poset such that , and let be a chain partition of . Let and let be a subtuple of , that is, is obtained from by deleting indices. For all , let be such that , be a family of functions from to , and .
For a suitable relational vocabulary depending on and for all , we define the -structure
which we call the compilation of with respect to the coordinatization and the coloring , as follows (we use as a shorthand if the coordinatization and the coloring are contextually clear).
The relational vocabulary of consists of one binary relation symbol , two unary relation symbols and for each -element subset of , and one binary relation symbol for each and .
The universe of is
Let and be elements of , and let . The interpretation of the vocabulary in is the following:
The interpretation of is the set of all pairs such that .
For each -element subset of , and are interpreted, respectively, over and ,
For each and , is interpreted over the subset of the interpretation of defined by
The intuition underlying the compilation procedure is the following. The universe of is the Cartesian product of a family of chains