Abstract 1 Introduction 2 Preliminaries: Background in Logic and Structural Graph Theory 3 New Upper Bounds for Second-Order Propositional Logic 4 A SAT Version of Courcelle’s Theorem 5 Fagin Definability via Automated Reasoning 7 Conclusion and Further Research References

Structure-Guided Automated Reasoning

Max Bannach ORCID European Space Agency, Advanced Concepts Team, Noordwijk, The Netherlands Markus Hecher ORCID Univ. Artois, CNRS UMR 8188, Centre de Recherche en Informatique de Lens (CRIL), 6230, France
Computer Science and Artificial Intelligence Lab, Massachusetts Institute of Technology, Cambridge, MA, USA
Abstract

Algorithmic meta-theorems state that problems definable in a fixed logic can be solved efficiently on structures with certain properties. An example is Courcelle’s Theorem, which states that all problems expressible in monadic second-order logic can be solved efficiently on structures of small treewidth. Such theorems are usually proven by algorithms for the model-checking problem of the logic, which is often complex and rarely leads to highly efficient solutions. Alternatively, we can solve the model-checking problem by grounding the given logic to propositional logic, for which dedicated solvers are available. Such encodings will, however, usually not preserve the input’s treewidth.

This paper investigates whether all problems definable in monadic second-order logic can efficiently be encoded into sat such that the input’s treewidth bounds the treewidth of the resulting formula. We answer this in the affirmative and, hence, provide an alternative proof of Courcelle’s Theorem. Our technique can naturally be extended: There are treewidth-aware reductions from the optimization version of Courcelle’s Theorem to maxsat and from the counting version of the theorem to #sat. By using encodings to sat, we obtain, ignoring polynomial factors, the same running time for the model-checking problem as we would with dedicated algorithms. Another immediate consequence is a treewidth-preserving reduction from the model-checking problem of monadic second-order logic to integer linear programming (ilp). We complement our upper bounds with new lower bounds based on ETH; and we show that the block size of the input’s formula and the treewidth of the input’s structure are tightly linked.

Finally, we present various side results needed to prove the main theorems: A treewidth-preserving cardinality constraints, treewidth-preserving encodings from cnfs into dnfs, and a treewidth-aware quantifier elimination scheme for qbf implying a treewidth-preserving reduction from qsat to sat. We also present a reduction from projected model counting to #sat that increases the treewidth by at most a factor of 2k+3.59, yielding a algorithm for projected model counting that beats the currently best running time of 22k+4poly(|ψ|).

Keywords and phrases:
automated reasoning, treewidth, satisfiability, max-sat, sharp-sat, monadic second-order logic, fixed-parameter tractability
Copyright and License:
[Uncaptioned image] © Max Bannach and Markus Hecher; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Constraint and logic programming
; Theory of computation Finite Model Theory ; Theory of computation Fixed parameter tractability
Related Version:
Technical Report: https://arxiv.org/abs/2312.14620
Acknowledgements:
Part of the research was carried out while Hecher was visiting the Simons Institute for the Theory of Computing at UC Berkeley. Author names are stated alphabetically.
Funding:
This research was funded by the Austrian Science Fund (FWF), grants J 4656 and P 32830, the Society for Research Funding in Lower Austria (GFF, Gesellschaft für Forschungsförderung NÖ) grant ExzF-0004, as well as the Vienna Science and Technology Fund (WWTF) grant ICT19-065.
Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim Thắng

1 Introduction

Many tools from the automated reasoning quiver can be implemented efficiently if a graphical representation of the given formula with good structural properties is given. The textbook example is the satisfiability problem (sat), which can be solved in time O(2kpoly(|ψ|)) on formulas ψ whose primal graph Gψ has treewidth k. (The primal graph contains a vertex for every variable of the formula and connects them if they appear together in a clause. Its treewidth intuitively measures how close it is to being a tree.) The result extends to the maximum satisfiability problem (maxsat), in which the clauses of the formula have weights and the goal is to minimize the weights of falsified clauses, and to the model counting problem (#sat), in which the goal is to compute the number of satisfying assignments. In this article, we will use the notation tower(h,t) to describe a tower of twos of height h with t at the top, and tower(h,t) as shorthand to hide polynomial factors, e.g., O(2kpoly(|ψ|))=tower(1,k):

Fact 1 (folklore, see for instance [1, 4, 5, 14, 24, 29, 30]).

One can solve sat, maxsat, and #sat in time tower(1,k) if a width-k tree decomposition is given.

It is worth to take some time to inspect the details of Fact 1. The hidden polynomial factor is not the subject of this paper (as indicated by the notation), but can be made as small as O(|φ|) [10, 26]. Our focus will be the value on top of the tower, which in Fact 1 is simply “k”. Under the exponential-time hypothesis (ETH), this is best possible.

The natural extension of the satisfiability problem to higher logic is the validity problem of fully quantified Boolean formulas (qsat). While it is well-known that qsat is fixed-parameter tractable (i.e., it is in FPT) with respect to treewidth [11], the dependencies on the treewidth is less sharp than in Fact 1. The height of the tower depends on the quantifier alternation qa(ψ) of the formula, while the top value has the form O(k+logk+loglogk+) due to the management of nested tables in the involved dynamic program.

Fact 2 ([11, 10]).

One can solve qsat in time tower(qa(ψ)+1,O(k)) if a width-k tree decomposition is given.

In contrast to Fact 1, there is a big-oh on top of the tower in Fact 2. The higher order version of the model counting problem is the projected model counting problem (pmc), in which we need to count the number of models that are not identical on a given set of variables.

Fact 3 ([15]).

One can solve pmc in time tower(2,k+4) if a width-k tree decomposition is given.

The fine art of automated reasoning is descriptive complexity, which studies the complexity of problems in terms of the complexity of a description of these problems; independent of any abstract machine model [21, 25]. A prominent example is Courcelle’s Theorem that states that the problems that can be expressed in monadic second-order logic can be solved efficiently on instances of bounded treewidth [12]. Differently phrased, the theorem states that the model-checking problem for mso logic (mc(mso)) is fixed-parameter tractable (the parameter is the size of the formula and the treewidth of the structure):

Fact 4 ([12]).

One can solve mc(mso) in time tower(qa(φ)+1,O(k+|φ|)) if a width-k tree decomposition is given.

For instance, the 3-coloring problem (Can we color the vertices of a graph with three colors such that adjacent vertices obtain different colors?) can be described by the sentence:

φ3col=RGBxy(RxGxBx)
Exy¬((RxRy)(GxGy)(BxBy)).

The sentence can be read aloud as: There are three colors red, blue, and green (RGB) such that for all vertices x and y (xy) we have that (i) each vertex has at least one color (RxGxBx), and (ii), if x and y are connected by an edge (Exy) then they do not have the same color (¬((RxRy)(GxGy)(BxBy))). The model-checking problem mc(mso) obtains as input a relational structure 𝒮 (say a graph like  or ) and an mso sentence φ (as the one from above) and asks whether 𝒮 is a model of φ, denoted by 𝒮φ. In our example we have φ3col and ⊧̸φ3col. Using Fact 4, we can conclude from φ3col that the 3-coloring problem parameterized by the treewidth lies in FPT.

Instead of utilizing Fact 4, another reasonable approach is to ground the mso sentence to a propositional formula and to then apply Fact 1. Formally, this means to reduce the model checking problem mc(mso) to sat, i.e., given a relational structure 𝒮 and an mso sentence φ, we need to produce, in polynomial time, a propositional formula ψ such that 𝒮φ iff ψsat. The naïve way of doing so is by generating an indicator variable Xu for every set variable X and every element u in the universe of 𝒮. Then we replace every first-order -quantifier by a “big-or” and -quantifier by a “big-and”:

The emerging question now is whether an automated translation such as the one we just sketched preserves treewidth in the following sense: Given a relational structure 𝒮 of treewidth tw(𝒮) and an mso sentence φ, can we mechanically derive a propositional formula ψ with 𝒮φ iff ψsat and tw(ψ)f(tw(𝒮)) for some function computable f:? Consider for instance the following graph shown on the left (it is “almost a tree” and has treewidth 2) and the primal graph of ψ3col obtained using the just sketched transformation on the right. In this example, the tree-like structure is preserved, as the treewidth gets increased by a factor of 3 and is at most 6:

We recap this finding as the following observation: The automated grounding process from mc(mso) to sat implies a reduction from the 3-coloring problem parameterized by the input’s treewidth to sat. We can, thus, derive that the 3-coloring problem can be solved in time tower(1,3k) using Fact 1 – without actually utilizing Courcelle’s Theorem!

For a second example consider the optimization and counting version of the dominating set problem: Given a graph G, the task is either to find a minimum-size set SV(G) of vertices such that every vertex is in S or adjacent to vertex in S, or to count the number of such sets. Optimization and counting problems can be modeled in descriptive complexity by “moving” an existential second-order quantifier (“guessing” the solution) out of the sentence and making it a free variable. The task is either to find a set of minimum size such that the given structure together with this set is a model of the formula, or to count the number of such sets. For instance, the following formula describes that X is a dominating set:

φds(X)=xyXx(ExyXy).

We will also say that the formula Fagin-defines the property that X is a dominating set. The problem #fd(mso) asks, given a relational structure 𝒮 and an mso formula with a free-set variable X, how many subsets S of the universe of 𝒮 satisfy 𝒮φ(S). The optimization problem fd(mso) gets as additional input an integer t and asks whether there is such a S with |S|t. The reduction from mc(mso) to sat can be extended to a reduction from fd(mso) to maxsat and from #fd(mso) to pmc. In order to ground fd(mso), we add new indicator variables Xu for the free-variable X and every element u of 𝒮 (as we did for the second-order quantifiers). For fd(mso), we additionally add a soft clause (¬Xu) for each of these variables – implying that we seek a model that minimizes |X|. We may now again ask: If we mechanically ground φds(X) on a structure of bounded treewidth to a propositional formula ψds, what can we say about the treewidth of ψds? Unfortunately, not so much. Even if the input has treewidth 1, the primal graph of ψds may become a clique (of treewidth n):

It follows that we cannot derive an fpt-algorithm for the dominating set problem or its counting version by reasoning about ψds, while we can conclude the fact from φds using appropriate versions of Courcelle’s Theorem. To summarize, we can naturally describe model-checking, optimization, and counting problems using monadic second-order logic. Using Courcelle’s Theorem, we can solve all of these problems in fpt-time on structures of bounded treewidth. Alternatively, we may ground the mso formulas to propositional logic and solve the problems using Fact 1. The produced encodings sometimes preserve the input’s structure (as for 3-coloring) and, thus, themselves serve as proof that the problems lie in FPT. However, the input’s structure can also get eradicated, as we observed for the dominating set problem. The present paper is concerned with the question whether there is a unifying grounding procedure that maps Fagin-defined mso properties to propositional logic while preserving the input’s treewidth.

Contribution I: Faster Structure-guided Reasoning.

Before we develop a unifying, structure-aware grounding process from the model-checking problem of monadic second order logic to propositional logic, we first improve both of the underlying results. In particular, we remove the logarithmic dependencies on k in top of the tower of Fact 2 and, thus, provide the first major improvement on qbf upper bounds with respect to treewidth since 20 years:

Theorem 1 (QBF Theorem).

One can solve qsat in time tower(qa(ψ)+1,k+3.92) if a width-k tree decomposition is given.

This bound matches the eth lower bound for qsat:

Fact 5 ([16]).

Unless ETH fails, qsat cannot be solved in time tower(qa(ψ)+1,o(tw(ψ))).

We will prove Theorem 1 fully in the spirit of an automated reasoning paper by an encoding into sat. In particular, we will not need any pre-requirements other than Fact 1. With a similar encoding scheme, we will also slightly improve on Fact 3:

Theorem 2 (PMC Theorem).

One can solve pmc in time tower(2,k+3.59) if a width-k tree decomposition is given.

Fact 6 ([15]).

Unless ETH fails, pmc cannot be solved in time tower(2,o(tw(ψ))).

Contribution II: A SAT Version of Courcelle’s Theorem.

We answer the main question of the introduction in the affirmative and provide a unifying, structure-aware encoding scheme from properties Fagin-defined with monadic second-order logic to variants of sat:

Theorem 3 (A SAT Version of Courcelle’s Theorem).

Assuming that the mso formulas on the left side are in prenex normal form and that a width-k tree decomposition is given, there are encodings from …

  1. 1.

    mc(mso)      to  sat      of size  tower(qa(φ),(k+9)|φ|+3.92);

  2. 2.

    fd(mso)      to  maxsat      of size  tower(qa(φ)+1,(k+9)|φ|+3.92);

  3. 3.

    #fd(mso)      to  #sat      of size  tower(qa(φ)+1,(k+9)|φ|+3.92).

All encodings of size tower(s,t) have a treewidth of tower(s,t) and can be computed in linear time with respect to their size.

In conjunction with Fact 1, the theorem implies Courcelle’s Theorem with sharp bounds on the values on top of the tower:

Corollary 4.

One can solve mc(mso) in time tower(qa(φ)+1,(k+9)|φ|+3.92), and fd(mso) and #fd(mso) in time tower(qa(φ)+2,(k+9)|φ|+3.92) if a width-k tree decomposition is given.

Since the reduction [27] from sat to integer linear programming (ilp) is treewidth-preserving and results in an instance of bounded domain, another consequence of Theorem 3 is an “ilp Version of Courcelle’s Theorem” via the dynamic program for ilp [22].

Contribution III: ETH Lower Bounds for the Encoding Size.

Given that we can encode mso definable properties into sat while preserving the input’s treewidth, we may ask next whether we can improve on the size of the encodings. While it is well-known that incarnations of Courcelle’s Theorem have to depend on the input’s treewidth and the formula’s size in a non-elementary way [3] (and hence, the encodings have to be huge at some point as well), these insights do not give us precise bounds on achievable encoding sizes.

Theorem 5 (ETH Lower Bound).

Under ETH, there is no sat encoding for mc(mso) of size tower(qa(φ)2,o(tw(𝒮))) that can be computed in this time.

We can make the lower bound a bit more precise in the following sense: The value at the top of the tower actually does not just depend on the treewidth tw(𝒮), but on the product of the treewidth and the block size bs(φ) of the sentence φ. The block size of a formula is the maximum number of consecutive quantifiers of the same type.

Theorem 6 (Trade-off Theorem).

Under ETH, there is no sat encoding for mc(mso) of size tower(qa(φ)2,o(tw(𝒮)bs(φ))) that can be computed within this time.

1.1 Related Work

The concept of treewidth was discovered multiple times. The name was coined in the work by Robertson and Seymour [28], while the concept was studied by Arnborg and Proskurowski [2] under the name partial k-trees simultaneously. However, treewidth was discovered even earlier by Bertelè and Brioschi [6], and independently by Halin [19]. Courcelle’s Theorem was proven in a series of articles by Bruno Courcelle [12], see also the textbook by Courcelle and Engelfriet for a detailed introduction [13]. The expressive power of monadic second-order logic was studied before, prominently by Büchi who showed that mso over strings characterizes the regular languages [9]. Related to our treewidth-aware reduction from mc(mso) to sat is the work by Gottlob, Pichler, and Wei, who solve mc(mso) using monadic Datalog [18]; and the work of Bliem, Pichler, and Woltran, who solve it using asp [8].

1.2 Structure of this Article

We provide preliminaries in the next section, prove Theorem 1 and 2 in Section 3, and establish a sat version of Courcelle’s Theorem in Section 4. The technical details of the latter can be found in the technical report version of this article. We extend the result to Fagin-definable properties in Section 5 and provide corresponding ETH lower bounds in Section 6. We conclude and provide pointers for further research in the last section, which also contains an overview table of this article’s results. Due to lack of space, most proofs are only avilable in the technical report and are replaced by a proof sketch within the main text. The corresponding positions are clearly marked with a “”.

2 Preliminaries: Background in Logic and Structural Graph Theory

We use the notation of Knuth [23] and consider propositional formulas in conjunctive normal form (cnfs) like ψ=(x1¬x2¬x3)(¬x1x4¬x5)(x2)(x6) as set of sets {{x1,¬x2,¬x3},{¬x1,x4,¬x5},{x2},{x6}}. We denote the sets of variables, literals, and clauses of ψ as vars(ψ), lits(ψ), and clauses(ψ). A (partial) assignment is a subset βlits(ψ) such that |{x,¬x}β|1 for all xvars(ψ), that is, a set of literals that does not contain both polarities of any variable. We use βvars(ψ) to denote partial assignments. The formula conditioned under a partial assignment β is denoted by ψ|β and obtained by removing all clauses from ψ that contain a literal lβ and by removing all literals l with ¬lβ from the remaining clauses. A assignment is satisfying for a cnf ψ if ψ|β=, and it is contradicting if ψ|β. A dnf is a disjunction of conjunctions, i.e., a set of terms. We use the same notations as for cnfs, however, in ψ|β we delete terms that contain a literal that appears negated in β and remove the literals in β from the remaining terms. Hence, β is satisfying if ψ|β, and contradicting if ψ|β=.

The model counting problem asks to compute the number of satisfying assignments of a cnf and is denoted by #sat. In projected model counting (pmc) we count the number of models that are not identical on a given set of variables. In the maximum satisfiability problem (maxsat) we partition the clauses of ψ into a set hard(ψ) of hard clauses and a set soft(ψ) of weighted soft clauses, i.e., every clause Csoft(ψ) comes with a weight w(C). The formula is then called a wcnf and the goal is to find under all assignments βvars(ψ) with hard(ψ)|β= the one that maximizes Csoft(ψ),{C}|β=w(c). In a fully quantified Boolean formula (a qbf, also called a second-order propositional sentence) all variables are bounded by existential or universal quantifiers. Throughout the paper we assume that qbfs are in prenex normal form, meaning that all quantifers appear in the front of a quantifier-free formula called the matrix. As is customary, we assume that the matrix is a cnf if the last (i.e., most inner) quantifier is existential, and a dnf otherwise. A qbf is valid if it evaluates to true (see Chapter 29–31 in [7]). Define qsat to be the problem of deciding whether a given qbf is valid.

2.1 Descriptive Complexity

A vocabulary is a finite set τ={R1a1,R2a2,,Ra} of relational symbols Ri of arity ai. A (finite, relational) τ-structure 𝒮 is a tuple (U(𝒮),R1𝒮,R2𝒮,,R𝒮) with universe U(𝒮) and interpretations Ri𝒮U(𝒮)ai. The size of 𝒮 is |𝒮|=|U(𝒮)|+i=1ai|Ri𝒮|. We denote the set of all τ-structures by struc[τ] – e.g., struc[{E2}] is the set of directed graphs.

Let τ be a vocabulary and x0,x1,x2, be an infinite repertoire of first-order variables. The first-order language (τ) is inductively defined, where the atomic formulas are the strings xi=xj and Ri(x1,,xai) for relational symbols Riτ. If α,β(τ) then so are ¬(α), (αβ), and xi(α). A variable that appears next to is called quantified and free otherwise. We denote a formula φ(τ) with φ(xi1,,xiq) if xi1,,xiq are precisely the free variables in φ. A formula without free variables is called a sentence. As customary, we extend the language of first-order logic by the usual abbreviations, e.g., αβ¬αβ and xi(α)¬xi(¬α). To increase readability, we will use other lowercase Latin letters for variables and drop unnecessary braces by using the usual operator precedence instead. Furthermore, we use the dot notation in which we place a “” instead of an opening brace and silently close it at the latest syntactically correct position. A τ-structure 𝒮 is a model of a sentence φ(τ), denoted by 𝒮φ, if it evaluates to true under the semantics of quantified propositional logic while interpreting equality and relational symbols as specified by the structure. For instance, φundir=xyExyEyx over τ={E2} describes the set of undirected graphs, and we have φundir and ⊧̸φundir.

We obtain the language of second-order logic by allowing quantification over relational variables of arbitrary arity, which we will denote by uppercase Latin letters. A relational variable is said to be monadic if its arity is one. A monadic second-order formula is one in which all quantified relational variables are monadic. The set of all such formulas is denoted by mso. The model checking problem for a vocabulary τ is the set mcτ(mso) that contains all pairs (𝒮,φ) of τ-structures 𝒮 and mso sentences φ with 𝒮φ. Whenever τ is not relevant (meaning that a result holds for all fixed τ), we will refer to the problem as mc(mso). We note that in the literature there is often a distinction between mso1- and mso2-logic, which describes the way the input is encoded [20]. Since we allow arbitrary relations, we do not have to make this distinction.

2.2 Treewidth and Tree Decompositions

While we consider graphs G as relational structures 𝒢 as discussed in the previous section, we also use common graph-theoretic terminology and denote with V(G)=U(𝒢) and E(G)=E𝒢 the vertex and edge set of G. Unless stated otherwise, graphs in this paper are undirected and we use the natural set notations and write, for instance, {v,w}E(G). The degree of a vertex is the number of its neighbors. A tree decomposition of G is a pair (T,χ) in which T is a tree (a connected graph without cycles) and χ:V(T)2V(G) a function with the following two properties:

  1. 1.

    for every vV(G) the set {xvχ(x)} is non-empty and connected in T;

  2. 2.

    for every {u,v}E(G) there is at least one node xV(T) with {u,v}χ(x).

The width of a tree decomposition is the maximum size of its bags minus one, i.e., width(T,χ)=maxxV(T)|χ(x)|1. The treewidth tw(G) of a graph G is the minimum width any tree decomposition of G must have. We do not require additional properties of tree decompositions, but we assume that T is rooted at a root(T)V(T) and, thus, that nodes tV(T) may have a parent(t)V(T) and children(t)V(T). Without loss of generality, we may also assume |children(t)|2.

Example 7.

The treewidth of the Big Dipper constellation (as graph shown on the left) is at most two, as proven by the tree decomposition on the right:

2.3 Treewidth of Propositional Formulas and Relational Structures

The definition of treewidth can be lifted to other objects by associating a graph to them. The most common graph for cnfs (or dnfs) ψ is the primal graph Gψ, which is the graph on vertex set V(Gψ)=vars(ψ) that connects two vertices by an edge if the corresponding variables appear together in a clause. We then define tw(ψ)tw(Gψ) and refer to a tree decomposition of Gψ as one of ψ. Note that other graphical representations lead to other definitions of the treewidth of propositional formulas. A comprehensive listing can be found in the Handbook of Satisfiability [7, Chapter 17]. A labeled tree decomposition (T,χ,λ) extends a tree decomposition with a mapping λ:V(T)2ψ (i.e., a mapping from the nodes of T to a subset of the clauses (or terms) of ψ) such that for every clause (or term) C there is exactly one tV(T) with Cλ(t) that contains all variables appearing in C. It is easy to transform a tree decomposition (T,χ) into a labeled one (T,χ,λ) by traversing the tree once’s and by duplicating some bags. Hence, we will assume throughout this article that all tree decompositions are labeled.

A similar approach can be used to define tree decompositions of arbitrary structures: The primal graph G𝒮 of a structure 𝒮, in this context also called the Gaifman graph, has as vertex set the universe of 𝒮, i.e., V(G𝒮)=U(𝒮), and contains an edge {u,v}E(G𝒮) iff u and v appear together in some tuple of 𝒮. As before, we define tw(𝒮)tw(G𝒮). One can alternatively define the concept of tree decompositions directly over relational structures, which leads to the same definition [17].

3 New Upper Bounds for Second-Order Propositional Logic

Central to our reductions are treewidth-preserving encodings from qsat to sat and from pmc to #sat. These encoding establishes new proofs of Chen’s Theorem [11] and the theorem by Fichte et al. [15], and improve the dependencies on k in the tower of Fact 2 and 3.

3.1 Treewidth-Aware Encodings from QSAT to SAT

We use a quantifier elimination scheme that eliminates the most-inner quantifier block at the cost of introducing O(2k|φ|) new variables while increasing the treewidth by a factor of 122k. Let first φ=Q1S1Sψ be the given qbf, in which ψ is a dnf. Let further (T,χ,λ) be the given labeled width-k tree decomposition of φ. We describe an encoding into a qbf, in which the last quantifier block QS gets replaced by new variables in S1.

We have to encode the fact that for an assignment on i=11Si all assignments to S satisfy ψ, i. e., at least one term in ψ. For that end, we introduce auxiliary variables for every term dterms(ψ) and any partial assignment α of the variables in S that also appear in the bag that contains d. More precisely, let λ1(d) be the node in V(T) with dλ(t) and let αχ(λ1(d))S be an assignment of the variables of the bag that are quantified by Q. We introduce the variable 𝑠𝑎𝑡dα that indicates that this assignment satisfies d:

dterms(ψ)αχ(λ1(d))S{d}α[𝑠𝑎𝑡dαxlits({d}α)x], // α may satisfy d (1)
dterms(ψ)αχ(λ1(d))S{d}|α=[¬𝑠𝑎𝑡dα]. // α falsifies d (2)

We have to track whether ψ can be satisfied by a local assignment α. For every tV(T) and every αχ(t)S we introduce a variable 𝑠𝑎𝑡tα that indicates that α can be extended to a satisfying assignment for the subtree rooted at t. Furthermore, we create variables 𝑠𝑎𝑡<t,tα for tchildren(t) that propagate the information about satisfiability along the tree decomposition. That is, 𝑠𝑎𝑡<t,tα is set to true if there is an assignment βχ(t)S that can be extended to a satisfying assignment and that is compatible with α:

// Either there is a term satisfing the bag or we can propagate:
tV(T)αχ(t)S[𝑠𝑎𝑡tαdλ(t)𝑠𝑎𝑡dαtchildren(t)𝑠𝑎𝑡<t,tα], (3)
// Propagate satisfiability:
tV(T)αχ(t)Stchildren(t)[𝑠𝑎𝑡<t,tαβχ(t)Sβlits(χ(t))=αlits(χ(t))𝑠𝑎𝑡tβ]. (4)

Finally, since Q=, we need to ensure that for all possible assignments of S there is at least one term that gets satisfied. Since satisfiability gets propagated to the root of the tree decomposition by the aforementioned constraint, we can enforce this property with:

αχ(root(T))S𝑠𝑎𝑡root(T)α.

The following lemma observes the correctness of the construction, and the subsequent lemma handles the case Q=.

Lemma 8 ().

There is an algorithm that, given a qbf φ=Q1S11S1Sψ and a width-k tree decomposition of Gφ, outputs in time O(2k) a qbf φ=Q1S11S1ψ and a width-(122k) tree decomposition of Gφ such that φ is valid iff φ is valid.

Lemma 9 ().

There is an algorithm that, given a qbf φ=Q1S11S1Sψ and a width-k tree decomposition of Gφ, outputs in time O(2k) a qbf φ=Q1S11S1ψ and a width-(122k) tree decomposition of Gφ such that φ is valid iff φ is valid.

Sketch of Proof.

The case Q= (in which ψ is a cnf) works similarly: The result follows by negating the inverse, where the roles of cnf and dnf are switched, and universal and existential quantification are switched as well.

Proof of Theorem 1.

The theorem follows by exhaustively applying Lemma 8 and Lemma 9 until a cnf is reached. The price for removing one alternation are O(2k|φ|) new variables and an increase of the treewidth by a factor of 122k. Hence, after removing one quantifier block we have a treewidth of 122k2k+log12, after two we have 1222k+log1222k+log12+log12, after three we then have 222k+log12+log12+log12; and so on. We can bound all the intermediate “+log12” by adding a “+1” on top of the tower, leading to a bound on the treewidth of tower(qa(φ),k+log12+1)tower(qa(φ),k+4.59). In fact, we can bound the top of the tower even tighter by observing log123.59 and guessing 3.92 as a fix point. Inserting yields 3.59+23.59+k23.92+k and 23.92+23.59+k223.92+k. Consequently, we can bound the treeewidth of the encoding by tower(qa(φ),k+3.92) and the size by tower(qa(φ),k+3.92).

3.2 Treewidth-Aware Encodings from PMC to #SAT

Recall that the input for pmc is a cnf ψ and a set Xvars(ψ). The task is to count the assignments αX that can be extended to models αvars(ψ) of ψ. We can also think of a formula ψ(X)=Yψ(X,Y) with free variables X and existential quantified variables Y (ψ is quantifier-free), for which we want to count the assignments to X that make the formula satisfiable. The idea is to rewrite ψ(X)=Yψ(X,Y)XYψ(X,Y), and to use a similar encoding as in the proof of Lemma 9 to remove the second quantifier.

In detail, we add a variable 𝑠𝑎𝑡cα for every clause cclauses(ψ) and every assignment of the corresponding bag αχ(λ1(c))Y. The semantic of this variable is that the clause c is satisfiable under the partial assignment α. We further add the propagation variables 𝑠𝑎𝑡tα and 𝑠𝑎𝑡<t,tα for all tV(T), tchildren(t), and αχ(λ1(c))Y. The former indicates that the assignment α can be extended to a satisfying assignment of the subtree rooted at t; the later propagates partial solutions from children to parents within the tree decomposition:

// α may satisfy c:
cclauses(ψ)αχ(λ1(c))Y{c}α[𝑠𝑎𝑡cαlits({c}α)], (1)
// α satisfies c:
cclauses(ψ)αχ(λ1(c))Y{c}α=[𝑠𝑎𝑡cα]. (2)
// Either there is a clause satisfying the bag or we can propagate:
tV(T)αχ(t)Y[𝑠𝑎𝑡tαcλ(t)𝑠𝑎𝑡cαtchildren(t)𝑠𝑎𝑡<t,tα], (3)
// Propagate satisfiability:
tV(T)αχ(t)Ytchildren(t)[𝑠𝑎𝑡<t,tαβχ(t)Yβlits(χ(t))=αlits(χ(t))𝑠𝑎𝑡tβ]. (4)

Observe that the constraints (1)–(4) contain no variable from Y (we removed them by locally speaking about α) and, furthermore, constraints (1), (3), and (4) are pure propagations, which leave no degree of freedom on the auxiliary variables. Hence, models of these constraint only have freedom in the variables in X within constraint (2). We are left with the task to count only models that actually satisfy the input formula, which we achieve with:

αχ(root(T))Y𝑠𝑎𝑡root(T)α.
Lemma 10 ().

There is an algorithm that, given a cnf ψ, a set Xvars(ψ), and a width-k tree decomposition of Gψ, outputs in time O(2k) a cnf ψ and a width-(122k) tree decomposition of Gψ such that the projected model count of ψ on X equals #(ψ).

Proof of Theorem 2.

By applying Fact 1 to the formula generated by Lemma 10 we obtain an algorithm for pmc with running time tower(2,k+3.59).

4 A SAT Version of Courcelle’s Theorem

We demonstrate the power of treewidth-aware encodings by providing an alternative proof of Courcelle’s theorem. We prove the main part of Theorem 3 in the following form:

Lemma 11.

There is an algorithm that, given a relational structure 𝒮, a width-k tree decomposition of 𝒮, and an mso sentence φ in prenex normal form, produces in time tower(qa(φ),(k+9)|φ|+3.92) a propositional formula ψ and tree decomposition of Gψ of width tower(qa(φ),(k+9)|φ|+3.92) such that 𝒮φψsat.

The lemma assumes that the sentence is in prenex normal form with a quantifier-free part ψ in cnf, i.e., φQ1S1Qq1Sq1QqsqQsi=1pψi with Qi{,} and Si (si) being second-order (first-order) variables. The requirement that the second-order quantifers appear before the first-order ones is for sake of presentation, the encoding works as is if the quantifiers are mixed. The main part of the proof is a treewidth-aware encoding from mc(mso) into qsat; which is then translated to sat using Theorem 1.

4.1 Auxiliary Encodings

Let ψ be a propositional formula and Xlits(ψ) be an arbitrary set of literals. A cardinality constraint cardc(X) with {,=,} ensures that { at most, exactly, at least } c literals of X get assigned to true. Classic encodings of cardinality constraints increase the treewidth of ψ by quite a lot. For instance, the naive encoding for card1(X)u,vX;uv(¬u¬v) completes X into a clique. We encode a cardinality constraint without increasing the treewidth by distributing a sequential unary counter:

Lemma 12 ().

For every c0 we can, given a cnf ψ, a set Xlits(ψ), and a width-k tree decomposition of ψ, encode cardc(X) such that tw(ψcardc(X))k+3c+3.

Sketch of Proof.

We add c+1 variables to every bag t of the tree decomposition, which count the number of literals set to true in the subtree rooted at t. The semantics of the sequential counter encoding [31] is then implemented along the edges of the decomposition. To cover the new constraints, we can add the auxiliary variables of the (at most two) children of t to the bag of t as well, resulting in an overall increase of the treewidth by 3c+3.

The second auxiliary encoding is a treewidth-preserving conversion from cnfs to dnfs.

Lemma 13.

There is a polynomial-time algorithm that, given a cnf ψ and a width-k tree decomposition of Gψ, produce a dnf ψ and a width-(k+4) tree decomposition of Gψ such that for any αvars(ψ), ψ|α= iff ψ|α is a tautology (¬(ψ|α) is unsatisfiable).

Sketch of Proof.

For every clause C we add a variable fC that is true iff C is satisfied. Satisfiability is encoded along the tree by variables ft indicating that ψ is satisfied in the subtree rooted at t via tV(T)¬[ftCλ(t)fCtchildren(t)ft].

4.2 Indicator Variables for the Quantifiers

To prove Lemma 11 we construct a qbf for a given mso sentence φ, structure 𝒮, and tree decomposition of 𝒮. We first define the primary variables of ψ, i.e., the prefix of ψ (primary here refers to the fact that we will also need some auxiliary variables later). For every second-order quantifier X or X we introduce, as we did in the introduction, an indicator variable Xu for every element uU(𝒮) with the semantic that Xu is true iff uX. These variables are either existentially or universally quantified, depending on the second-order quantifier. If there are multiple quantifiers (say XY), the order in which the variables are quantified is the same as the order of the second-order quantifiers. For first-order quantifiers x or x we do the same construction, i.e., we add variables xu for all uU(𝒮) with the semantics that xu is true iff x was assigned to u. Of course, of these variables we have to set exactly one to true, which we enforce by adding card=1({xuuU(𝒮)}) using Lemma 12.

4.3 Evaluation of Atoms

The last ingredient of our qbf encoding is the evaluation of the atoms in the mso sentence φ. An atom is Rx1,,xa for a relational symbol R from the vocabulary of arity a, containment in a second-order variable Xu, equality x=y, and the negation of the aforementioned. For every atom ι that appears in φ we introduce variables ptι and ptι for all tV(T) that indicate that ι is true in bag t or somewhere in the subtree rooted at t, respectively. Note that the same atom can occur multiple times in φ, for instance in

xyz(x=yx=z)(x=yy=z)

there are two atoms x=y. However, since φ is in prenex normal form (and, thus, variables cannot be rebound), these always evaluate in exactly the same way. Hence, it is sufficient to consider the set of atoms, which we denote by atoms(φ). We can propagate information about the atoms along the tree decomposition with:

tV(T)ιatoms(φ)[ptι(ptιtchildren(t)ptι)].

This encoding introduces two variables per atom ι per bag t (namely ptι and ptι), which increases the treewidth by at most 2|atoms(φ)|. To synchronize with the two children t and t′′, we add ptι and pt′′ι to χ(t), yielding a total treewidth of at most 4|atoms(φ)|.

An easy atom to evaluate is x=y, since if x and y are equal (i.e., they both got assigned to the same element uU(𝒮)), we can conclude this fact within a bag that contains u:

tV(T)[ptx=yuχ(t)(xuyu)].

For every uU(𝒮) and every quantifier x (or x), we add the propositional variable xu to all bags containing u. We increase the treewidth by at most the quantifier rank and, in return, cover constraints as the above trivially. Similarly, if there is a second-order variable X and a first-order variable x, the atom Xx can be evaluated locally in every bag:

tV(T)[ptXxuχ(t)(Xuxu)].

We have to evaluate atoms corresponding to relational symbols R of the vocabulary. For each such symbol of arity a we encode:

tV(T)[ptR(x1,x2,,xa)u1,,uaχ(t)(u1,,ua)R𝒮((x1)u1(x2)u2(xa)ua)].

Here “R(x1,x2,,xa)” is an atom in which R is a relational symbol and x1,x2,,xa are quantified first-order variables. In the inner “big-or” we consider all u1,,ua in χ(t), i.e., elements u1,,uaU(𝒮) that are in the relation (u1,,ua)R𝒮. Then “(xi)ui” is a variable that describes that xi gets assigned to ui. Note that all tuples in R𝒮 appear together in at least one bag of the tree decomposition and, hence, there is at least one bag t for which ptR(x1,x2,,xa) can be evaluated to true. The propagation ensures that, for every ιatoms(φ), the variable proot(T)ι will be true iff ι is true. Since the quantifier-free part of φ is a cnf j=1pψj, we can encode it by replacing every occurrence of ι in ψj with proot(T)ι.

4.4 The Full Encoding in one Figure

For the readers convenience, we compiled the encoding into Figure 1. Combining the insights of the last sections proves Lemma 11, but if the inner-most quantifier is universal, existentially projecting the encoding variables would produce a qbf with one more block. This can, however, be circumvent using Lemma 13. We formally prove that “combining the insights” indeed leads to a sound proof of Lemma 11 in the technical report.

Figure 1: The reduction msoqsat(φ,𝒮,𝒯) that takes as input an mso formula in prenex normal form φ=Q1S1Qq1Sq1QqsqQsψ and a structure 𝒮 with a TD 𝒯=(T,χ) of 𝒮 of width k. It obtains a QBF φ=Q1S1QSEψ, where ψ is the conjunction of Equations (1)–(11), Si={(Si)uuU(𝒮)} and E=vars(ψ)(i=1Si). Formula ψ can be easily converted into cnf of width linear in k (for constant-size mso formulas φ).

5 Fagin Definability via Automated Reasoning

In this section we prove the remaining two items of Theorem 3, i.e., a treewidth-aware encoding of the optimization version of Courcelle’s Theorem to maxsat; and a #sat encoding of the counting version of the theorem. The general approach is as follows: We obtain a mso formula φ(X) with a free set variable X as input (rather than a mso sentence as in Lemma 11). The objective of the model-checking problems adds requirements to this variable (for fd(mso) we seek a SU(𝒮) of minimum size such that 𝒮φ(S); for #fd(mso) we want to count the number of sets SU(𝒮) with 𝒮φ(S)). The “trick” is to rewrite φ(X)=ξ as φ=Xξ and apply Lemma 11 to φ in order to obtain a propositional formula ψ. Observe that the quantifier alternation of φ may be one larger than the one of φ.

Lemma 14 ().

There is an algorithm that, given a structure 𝒮 with weights wi:U(𝒮) for i{1,,}, a width-k tree decomposition of 𝒮, and an mso formula φ(X1,,X) in prenex normal form, produces in time tower(qa(φ)+1,(k+9)|φ|+3.92) a wcnf ψ and a tree decomposition of width tower(qa(φ)+1,(k+9)|φ|+3.92) of Gψ such that the maximum weight of any model of ψ equals the maximum value of i=1sSiwi(s) under S1,,SU(𝒮) with 𝒮φ(S1,,S).

Sketch of Proof.

Consider ψuU(𝒮)(¬Xu) such that the clauses in ψ are hard and the added clauses are soft. A model maximizing the soft clauses will minimize the number of Xu variables set to true, i.e., corresponds to a minimum-size set S with 𝒮φ(S).

Lemma 15 ().

There is an algorithm that, given a relational structure 𝒮, a width-k tree decomposition of 𝒮, and an mso formula φ(X1,,X) in prenex normal form, produces in time tower(qa(φ)+1,(k+9)|φ|+3.92) a cnf ψ and a tree decomposition of width tower(qa(φ)+1,(k+9)|φ|+3.92) of Gψ such that the number of models of ψ equals the number of sets S1,,SU(𝒮) with 𝒮φ(S1,,S).

Sketch of Proof.

We need to compute the number of models of ψ projected to the Xu variables. In other words, it is sufficient to solve the projected model counting problem on the instance generated with Lemma 11 using Lemma 10.

6 Lower Bounds for the Encoding Size of Model Checking Problems

We companion our sat encodings for mc(mso) with lower bounds on the achievable encoding size under ETH. The first lower bound (Theorem 5) is obtained by an encoding from qsat into mc(mso) that implies that sat encodings of mc(mso) lead to faster qsat algorithms.

Lemma 16 ().

There is a polynomial-time algorithm that, given a qsat sentence ψ, outputs a structure 𝒮 and an mso sentence φ with tw(𝒮)tw(ψ)+1 and qa(φ)qa(ψ)+2 such that 𝒮φ iff ψ evaluates to true.

Sketch of Proof.

The structure 𝒮 is the incidence graph of ψ (the graph containing a node for every variable and every clause that connects variables to the clauses containing them) with some additional labels. The sentence φ uses qa(ψ) second-order quantifier to guess the assignment of ψ, and one additional xy-block to evaluate it.

Proof of Theorem 5.

Combine Lemma 16 with Fact 5.

6.1 An Encoding for Compressing Treewidth

For qsat one can “move” complexity from the quantifier rank of the formula to its treewidth and vice versa [16]. By Lemma 16, this means that any reduction from qsat to mc(mso) may produce an instance with small treewidth or quantifier alternation while increasing the other. We show that one can also decrease the treewidth by increasing the block size.

Lemma 17 ().

For every c>0 there is a polynomial-time algorithm that, on input of a cnf ψ and a width-k tree decomposition of Gψ, outputs a constant-size mso sentence φ with qa(φ)=2 and bs(φ)=c, and a structure 𝒮 with tw(𝒮)k+1c such that ψsat𝒮φ.

Sketch of Proof.

The idea of the proof is to (i) encode the input’s formula as an incidence graph over which we reason with an mso sentence; we then (ii) replace this structure by its tree decomposition with additional “sync edges”; and finally we (iii) contract vertices in the tree decomposition to lower the treewidth, while we encode statements like xS (for a set variable S) by defining new set variables S1,,Sc and by interpreting ySi as “the ith vertex contracted to y is in S”.

Proof of Theorem 6.

We obtain the Trade-off Theorem by combining the proof strategy of Lemma 17 with the reduction from qsat to mc(mso) of Lemma 16. The result is a polynomial-time algorithm for every c>0 that, on input of a qbf ψ and a width-k tree decomposition of Gψ, outputs a constant-size mso sentence φ with qa(φ)qa(ψ)+2 and bs(φ)=c, and a structure 𝒮 with tw(𝒮)k+1c such that ψ is valid iff 𝒮φ.

It is out of the scope of this article, but worth mentioning, that the proofs of Lemma 17 and Theorem 6 can be generalized to the following finite-model theoretic result:

Proposition 18.

For every c>0 there is a polynomial-time algorithm that, given a relational structure 𝒮, a width-k tree decomposition of 𝒮, and an mso sentence φ, outputs a structure 𝒮 and a sentence φ such that:

  1. 1.

    𝒮φ𝒮φ;

  2. 2.

    tw(𝒮)k+1c;

  3. 3.

    bs(φ)cbs(φ).

7 Conclusion and Further Research

We studied structure-guided automated reasoning, where we utilize the input’s structure in propositional encodings. The scientific question we asked was whether we can encode every mso definable problem on structures of bounded treewidth into sat formulas of bounded treewidth. We proved this in the affirmative, implying an alternative proof of Courcelle’s Theorem. The most valuable aspects are, in our opinion, the simplicity of the proof (it is “just” an encoding into propositional logic) and the potential advantages in practice for formulas of small quantifier alternation (sat solvers are known to perform well on instances of small treewidth, even if they do not actively apply techniques such as dynamic programming). Another advantage is the surprisingly simple generalization to the optimization and counting version of Courcelle’s Theorem – we can directly “plug in” maxsat or #sat and obtain the corresponding results. As a byproduct, we also obtain new proofs showing (purely as encodings into propositional logic) that qsat parameterized by the input’s treewidth plus quantifier alternation is fixed-parameter tractable (improving a complex dynamic program with nested tables) and that pmc parameterized by treewidth is fixed-parameter tractable (improving a multi-pass dynamic program). Table 1 provides an overview of the encodings presented within this article.

Table 1: We summarize the encodings presented within this article. An encoding maps from one problem to another. The third and fourth columns define the treewidth and size of the encoding, whereby we assume that c>0 is a constant, a width-k tree decomposition is given, ψ is a propositional formula, and φ is a fixed mso formula.
Encoding…
From To Treewidth Size Reference
qsat sat tower(qa(ψ),k+3.92) tower(qa(ψ),k+3.92) Theorem 1
pmc #sat tower(1,k+3.59) tower(1,k+3.59) Theorem 2
cardc(X) sat k+3c+3 O(c|ψ|) Lemma 12
cnf dnf k+4 O(|ψ|) Lemma 13
mc(mso) sat tower(qa(φ),(9k+9)|φ|+3.92) tower(qa(φ),(9k+9)|φ|+3.92) Lemma 11
fd(mso) maxsat tower(qa(φ)+1,(9k+9)|φ|+3.92) tower(qa(φ)+1,(9k+9)|φ|+3.92) Lemma 14
#fd(mso) #sat tower(qa(φ)+1,(9k+9)|φ|+3.92) tower(qa(φ)+1,(9k+9)|φ|+3.92) Lemma 15
sat mc(mso) k+1c O(k|ψ|) Lemma 17
qsat mc(mso) k+1c O(k|ψ|) Theorem 6

Our encodings are exponentially smaller than the best known running time for mc(mso), i.e., when we solve the instances using Fact 1, we obtain the same runtime. We complemented this finding with new ETH-based lower bounds. Further research will be concerned with closing the remaining gap in the height of the tower between the lower and upper bounds. We show in an upcoming paper that the terms “qa(φ)” in Theorem 3 and “qa(φ)2” in Theorem 5 can be replaced by “qa2(φ)” on guarded formulas, i.e., formulas in which there are only two first-order quantifers that are only allowed to quantify edges. Here, qa2(φ) refers to the quantifier alternation of the second-order quantifers only. Hence, on such guarded formulas (e.g., on all examples in the introduction), the bounds are tight. Another task that remains for further research is to evaluate the encodings in practice. This would also be interesting for the auxiliary encodings, e.g., can a treewidth-aware cardinality constraint compete with classical cardinality constraint?

References

  • [1] Michael Alekhnovich and Alexander A. Razborov. Satisfiability, Branch-Width and Tseitin Tautologies. Comput. Complex., 20(4):649–678, 2011. doi:10.1007/S00037-011-0033-1.
  • [2] Stefan Arnborg and Andrzej Proskurowski. Problems on Graphs with Bounded Decomposability. Bull. EATCS, 25:7–10, 1985.
  • [3] Albert Atserias and Sergi Oliva. Bounded-width QBF is PSPACE-complete. Journal of Computer and System Sciences, 80(7):1415–1429, 2014. doi:10.1016/j.jcss.2014.04.014.
  • [4] Fahiem Bacchus, Shannon Dalmao, and Toniann Pitassi. Algorithms and Complexity Results for #SAT and Bayesian Inference. In 44th Symposium on Foundations of Computer Science (FOCS 2003), 11-14 October 2003, Cambridge, MA, USA, Proceedings, pages 340–351, 2003. doi:10.1109/SFCS.2003.1238208.
  • [5] Max Bannach, Malte Skambath, and Till Tantau. On the Parallel Parameterized Complexity of MaxSAT Variants. In 25th International Conference on Theory and Applications of Satisfiability Testing, SAT 2022, August 2-5, 2022, Haifa, Israel, pages 19:1–19:19, 2022. doi:10.4230/LIPIcs.SAT.2022.19.
  • [6] Umberto Bertelè and Francesco Brioschi. On Non-serial Dynamic Programming. J. Comb. Theory, Ser. A, 14(2):137–148, 1973. doi:10.1016/0097-3165(73)90016-2.
  • [7] Armin Biere, Marijn Heule, Hans van Maaren, and Toby Walsh, editors. Handbook of Satisfiability, Second Edition. IOS Press, 2021. doi:10.3233/FAIA336.
  • [8] Bernhard Bliem, Reinhard Pichler, and Stefan Woltran. Declarative Dynamic Programming as an Alternative Realization of Courcelle’s Theorem. In Parameterized and Exact Computation – 8th International Symposium, IPEC 2013, Sophia Antipolis, France, September 4-6, 2013, Revised Selected Papers, pages 28–40, 2013. doi:10.1007/978-3-319-03898-8_4.
  • [9] J. Richard Büchi. Weak Second-Order Arithmetic and Finite Automata. Zeitschrift für mathematische Logik und Grundlagen der Mathematik, 6(1-6):66–92, 1960.
  • [10] Florent Capelli and Stefan Mengel. Tractable QBF by Knowledge Compilation. In 36th International Symposium on Theoretical Aspects of Computer Science, STACS 2019, March 13-16, 2019, Berlin, Germany, pages 18:1–18:16, 2019. doi:10.4230/LIPICS.STACS.2019.18.
  • [11] Hubie Chen. Quantified Constraint Satisfaction and Bounded Treewidth. In Proceedings of the 16th Eureopean Conference on Artificial Intelligence, ECAI’2004, including Prestigious Applicants of Intelligent Systems, PAIS 2004, Valencia, Spain, August 22-27, 2004, pages 161–165, 2004.
  • [12] Bruno Courcelle. The Monadic Second-Order Logic of Graphs. I. Recognizable Sets of Finite Graphs. Inf. Comput., 85(1):12–75, 1990. doi:10.1016/0890-5401(90)90043-H.
  • [13] Bruno Courcelle and Joost Engelfriet. Graph Structure and Monadic Second-Order Logic – A Language-Theoretic Approach, volume 138 of Encyclopedia of mathematics and its applications. Cambridge University Press, 2012.
  • [14] Adnan Darwiche. Decomposable Negation Normal Form. J. ACM, 48(4):608–647, 2001. doi:10.1145/502090.502091.
  • [15] Johannes Klaus Fichte, Markus Hecher, Michael Morak, Patrick Thier, and Stefan Woltran. Solving Projected Model Counting by Utilizing Treewidth and its Limits. Artif. Intell., 314:103810, 2023. doi:10.1016/j.artint.2022.103810.
  • [16] Johannes Klaus Fichte, Markus Hecher, and Andreas Pfandler. Lower Bounds for QBFs of Bounded Treewidth. In LICS ’20: 35th Annual ACM/IEEE Symposium on Logic in Computer Science, Saarbrücken, Germany, July 8-11, 2020, pages 410–424, 2020. doi:10.1145/3373718.3394756.
  • [17] Jörg Flum and Martin Grohe. Parameterized Complexity Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2006. doi:10.1007/3-540-29953-X.
  • [18] Georg Gottlob, Reinhard Pichler, and Fang Wei. Monadic Datalog Over Finite Structures of Bounded Treewidth. ACM Trans. Comput. Log., 12(1):3:1–3:48, 2010. doi:10.1145/1838552.1838555.
  • [19] Rudolf Halin. S-functions For Graphs. Journal of geometry, 8(1):171–186, 1976.
  • [20] Petr Hlinený, Sang-il Oum, Detlef Seese, and Georg Gottlob. Width Parameters Beyond Tree-width and their Applications. Comput. J., 51(3):326–362, 2008. doi:10.1093/comjnl/bxm052.
  • [21] Neil Immerman. Descriptive Complexity. Graduate texts in computer science. Springer, 1999. doi:10.1007/978-1-4612-0539-5.
  • [22] Bart M. P. Jansen and Stefan Kratsch. A Structural Approach to Kernels for ILPs: Treewidth and Total Unimodularity. In Algorithms – ESA 2015 – 23rd Annual European Symposium, Patras, Greece, September 14-16, 2015, Proceedings, pages 779–791, 2015. doi:10.1007/978-3-662-48350-3_65.
  • [23] Donald E. Knuth. The Art of Computer Programming, volume 4, Fascicle 6. Addison-Wesley, 2016.
  • [24] Tuukka Korhonen and Matti Järvisalo. Integrating Tree Decompositions into Decision Heuristics of Propositional Model Counters (Short Paper). In 27th International Conference on Principles and Practice of Constraint Programming, CP 2021, Montpellier, France (Virtual Conference), October 25-29, 2021, pages 8:1–8:11, 2021. doi:10.4230/LIPICS.CP.2021.8.
  • [25] Stephan Kreutzer. Algorithmic meta-theorems. In Finite and Algorithmic Model Theory, pages 177–270. Cambridge University Press, 2011.
  • [26] Michael Lampis, Stefan Mengel, and Valia Mitsou. QBF as an Alternative to Courcelle’s Theorem. In Theory and Applications of Satisfiability Testing – SAT 2018 – 21st International Conference, SAT 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 9-12, 2018, Proceedings, pages 235–252, 2018. doi:10.1007/978-3-319-94144-8_15.
  • [27] Ruiming Li, Dian Zhou, and Donglei Du. Satisfiability and Integer Pprogramming as Complementary Tools. In Proceedings of the 2004 Conference on Asia South Pacific Design Automation: Electronic Design and Solution Fair 2004, Yokohama, Japan, January 27-30, 2004, pages 879–882, 2004. doi:10.1109/ASPDAC.2004.178.
  • [28] Neil Robertson and Paul D. Seymour. Graph Minors. II. Algorithmic Aspects of Tree-width. Journal of Algorithms, 7(3):309–322, 1986. doi:10.1016/0196-6774(86)90023-4.
  • [29] Sigve Hortemo Sæther, Jan Arne Telle, and Martin Vatshelle. Solving #SAT and MAXSAT by Dynamic Programming. J. Artif. Intell. Res., 54:59–82, 2015. doi:10.1613/jair.4831.
  • [30] Marko Samer and Stefan Szeider. Algorithms for Propositional Model Counting. J. Discrete Algorithms, 8(1):50–64, 2010. doi:10.1016/j.jda.2009.06.002.
  • [31] Carsten Sinz. Towards an Optimal CNF Encoding of Boolean Cardinality Constraints. In Principles and Practice of Constraint Programming – CP 2005, 11th International Conference, CP 2005, Sitges, Spain, October 1-5, 2005, Proceedings, pages 827–831, 2005. doi:10.1007/11564751_73.