Graph Width Measures for CNF-Encodings with Auxiliary Variables
GGraph Width Measures for CNF-Encodings withAuxiliary Variables
Stefan Mengel ∗ Romain Wallon † January 23, 2020
Abstract
We consider bounded width CNF-formulas where the width is mea-sured by popular graph width measures on graphs associated to CNF-formulas. Such restricted graph classes, in particular those of boundedtreewidth, have been extensively studied for their uses in the design ofalgorithms for various computational problems on CNF-formulas. Herewe consider the expressivity of these formulas in the model of clausal en-codings with auxiliary variables. We first show that bounding the widthfor many of the measures from the literature leads to a dramatic lossof expressivity, restricting the formulas to those of low communicationcomplexity. We then show that the width of optimal encodings with re-spect to different measures is strongly linked: there are two classes ofwidth measures, one containing primal treewidth and the other incidencecliquewidth, such that in each class the width of optimal encodings onlydiffers by constant factors. Moreover, between the two classes the widthdiffers at most by a factor logarithmic in the number of variables. Boththese results are in stark contrast to the setting without auxiliary variableswhere all width measures we consider here differ by more than constantfactors and in many cases even by linear factors.
Graph width measures like treewidth and cliquewidth have been studied exten-sively in the context of propositional satisfiability. The general idea is to assigngraphs to CNF-formulas and compute their width with respect to different widthmeasures. Then, if the resulting width is small, there are algorithms that solveSAT, but also more complex problems like ∗ CRIL, CNRS † CRIL, Univ. Artois and CNRS a r X i v : . [ c s . CC ] J a n uriously, however, there seems to be very little work on the natural ques-tion of what we can actually encode with these restricted CNF-formulas. Thisquestion is pertinent because good algorithms for problems are less attractive ifthey cannot deal with interesting instances. We make two main contributionson the expressivity of bounded width CNF-formulas here.As a first main contribution, we show, for a wide class of width measures,that one can give width lower bounds of any encoding of a function by meansof communication complexity (Theorem 9). Such lower bounds were known fortreewidth [9], but with our general approach, we extend them for many differentwidth measures, in particular (signed and unsigned) cliquewidth [18, 43], mod-ular treewidth [35] and MIM-width [38]. As a consequence, in a sense, for allthese measures, formulas of bounded width can only encode simple functions.All these lower bounds not only work for representations of functions asCNF-formulas but also on clausal encodings , i.e. CNF-formulas using auxiliaryvariables. It is folklore that adding auxiliary variables can decrease the sizeof an encoding: for example the parity function has no subexponential CNF-representations but there is an easy linear size encoding using auxiliary variables.We here observe a similar effect for the example of treewidth: we show that anyCNF-representation of the AtMostOne n -function of n inputs without auxiliaryvariables has primal treewidth n − AtMostOne n can be computed withformulas of bounded treewidth easily. This shows that lower bounds for clausalencodings are far stronger than those of CNF-representations. Considering that AtMostOne n is arguably a very easy function, we feel that encodings withauxiliary variables are the more interesting notion in our setting so we focus onthem here.We remark that this is of course not the first time that communicationcomplexity has been used to show lower bounds on the size or width of rep-resentations for Boolean functions. In fact, this is one of the motivations forthe development of the area and there is a large literature on this, see e.g. thetextbooks [30, 25, 27]. In particular, there are many results for showing lowerbounds on different forms of branching programs by means of communicationcomplexity, see e.g. [45, 16]. More recently, this approach has been generalizedto more general languages considered in knowledge compilation [37, 6]. How-ever, beyond the already discussed lower bounds on treewidth in [9], we arenot aware of any use of communication complexity to show bounds on widthmeasures of CNF-formulas.In a second main contribution, we focus on the relative expressive powerof different graph width measures for clausal encodings. For the graph widthmeasures studied in the literature, it is known that without auxiliary variablesthe expressivity of bounded width CNF-formulas is different for all notions andthey form a partial order with so-called MIM-width as the most general notion,see e.g. [8, Section 5]. Somewhat surprisingly, the situation changes completelywhen one allows auxiliary variables: in this setting, the commonly consideredwidth notions are all up to constant factors equivalent to either primal treewidthor to incidence cliquewidth (Theorem 23). This is true for every individualfunction. We remark that for the parameters primal treewidth, dual treewidthand incidence treewidth, it was already known that the width of encodingsminimizing the respective width measures differs only by constant factors [40,9, 31]. All other relationships are new. 2e also show that, assuming that an optimal encoding of a function hasat least primal treewidth log( n ) where n is the number of variables, incidencecliquewidth and primal treewidth differ exactly by a factor of Θ(log( n )) for op-timal encodings. So, up to a logarithmic scaling, in fact all the width measuresin [39, 18, 43, 35, 38] coincide when allowing auxiliary variables. Note thatthis scaling exactly corresponds to the runtime differences of many algorithms:while treewidth based algorithms often have runtimes of the type 2 O ( k ) n c fortreewidth k and a constant c , cliquewidth based algorithms typically give run-times roughly n O ( k (cid:48) ) for cliquewidth k (cid:48) . These runtimes coincide exactly whentreewidth and cliquewidth differ by a logarithmic factor which, as we show here,they do generally for encodings with auxiliary variables.We finally use our main results for several applications. In particular, weanswer an open question of [9] on the cliquewidth of the permutation function PERM n and generalize a classical theorem on planar circuits from [32], seeSection 6 for details.Most of our results use machinery recently developed in the area of knowl-edge compilation. In particular, we use a combination of the algorithm in [5],the width notion for DNNF developed in [10] and the lower bound techniquesfrom [37, 6]. Relying on these building blocks, most of our proofs become rathersimple. We use standard notations for CNF-formulas as it can e.g. be found in [4].Let X be a set of variables. A CNF-representation of a Boolean function f in variables X is a CNF-formula F on the variable set X that has as modelsexactly the assignments on which f evaluates to true. A clausal encoding of f is a CNF-formula F (cid:48) on a variable set X ∪ Y such that • for every assignment a : X → { , } on which f evaluates to true, there isan extension a (cid:48) of a to Y that is a model of F (cid:48) , and • for every assignment a : X → { , } on which f evaluates to false, noextension a (cid:48) of a to Y is a model of F (cid:48) .The variables in Y are called auxiliary variables . An auxiliary variable y iscalled dependent if and only if in the first item above all extensions a (cid:48) satisfying F (cid:48) take the same value on y [22]. We say that a clausal encoding has dependentauxiliary variables if all its auxiliary variables are dependent. Note that for suchan encoding the extension a (cid:48) is unique.We use standard notations from graph theory and assume the reader to havea basic background in the area [15]. By N ( v ) we denote the open neighborhoodof a vertex in a graph.In some parts of this paper, we will also deal with Boolean circuits. Weassume that the reader is familiar with basic definitions in the area. As itis common when considering circuits with structurally restricted underlyinggraphs, we assume that every input variable appears in only one input gate.This property is sometimes called the read-once property .3 x x x x x x x x x C C C C Figure 1: Graphs associated to the CNF-formula F in Example 1: primal graph(left) and incidence graph (right).To every CNF-formula F , we assign two graphs. The primal graph of F hasas vertices the variables of F and two variables x, y are connected by an edge ifand only if there is a clause C such that a literal in x and a literal in y appearin C . The incidence graph of F has as vertex set the union of the variable setand the clause set of F . Edges in the incidence graph are exactly the pairs x, C where x is a variable and C a clause that contains a literal in x . Example 1.
Let us consider the clauses C := x ∨ ¬ x , C := x ∨ x ∨ ¬ x ∨¬ x , C := ¬ x ∨ x and C := x ∨ x , and let the CNF-formula F be definedas F := C ∧ C ∧ C ∧ C . Its primal and incidence graphs are given in Figure 1. In this section, we will introduce several graph width measures we will considerthroughout this paper. A tree decomposition ( T, ( B t ) t ∈ V ( T ) ) of a graph G =( V, E ) consists of a tree T and, for every node t of T , a set B t ⊆ V called bag such that: • (cid:83) t ∈ V ( T ) B t = V , • for every edge uv ∈ E , there is a bag B t such that { u, v } ⊆ B t , and • for every v ∈ V , the set { t ∈ V ( T ) | v ∈ B t } is connected in T .The width of a tree decomposition is defined as max {| B t | | t ∈ V ( T ) } − treewidth tw ( G ) of G is defined as the minimum width taken over all treedecompositions of G . The primal treewidth tw p ( F ) of a CNF-formula F isdefined as the treewidth of its primal graph and the incidence treewidth tw i ( F )of F is defined as that of the incidence graph. Example 2.
Let us again consider the formula F of Example 1. Figure 2shows a tree decomposition of the primal graph and the incidence graph of F .Both of these decompositions are optimal: it is well-known that for every treedecomposition of a graph G , the vertices of every clique must be contained ina common bag. So, in this case, x , x , x , x must be in one bag for everytree decomposition of the primal graph of F and thus tw p ( F ) ≥ tw p ( F ) = 3. Concerning thetreewidth of the incidence graph, remark that this graph has a cycle and is thusnot a tree. Since trees are well-known to be the only graphs of treewidth 1, itfollows that tw i ( F ) ≥ tw i ( F ) = 2. 4 , x x , x , x , x x , C x , C x , C x , C x , x , C x , x , C x , x , C Figure 2: Tree decompositions of the graphs associated to the CNF-formula F in Example 2: primal graph (left) and incidence graph (right). x x x x C C C Figure 3: A contraction of the incidence graph of the CNF-formula F in Exam-ple 3. In the original graph, x and x have the same neighborhood type, asdo C and C . We thus get the shown contraction by deleting x and C . Notethat the obtained graph is a tree.We say that two vertices u , v in a graph G = ( V, E ) have the same neighbor-hood type if and only if N ( u ) \ { v } = N ( v ) \ { u } . It can be shown that havingthe same neighborhood type is an equivalence relation on V . A generalizationof treewidth is modular treewidth which is defined as follows: from a graph G we construct a new graph G (cid:48) by contracting all vertices sharing a neighborhoodtype, i.e., from every equivalence class we delete all vertices but one. The mod-ular treewidth of G is then defined to be the treewidth of G (cid:48) . The modulartreewidth mtw ( F ) of a CNF-formula F is defined as the modular treewidth ofits incidence graph. Example 3.
Let us consider again the formula F from Example 1. Figure 3shows a contraction of all vertices sharing a neighborhood type in the incidencegraph of F . This contraction resulting in a tree, we have that mtw ( F ) = 1.The cliquewidth cw ( G ) of a graph G is defined as the minimum number oflabels needed to construct G with the following operations: • creating a new vertex with label i , • taking the disjoint union of two labeled graphs,5 joining all vertices with a label i to all vertices with a label j for i (cid:54) = j ,and • renaming a label i to j for i (cid:54) = j .The incidence cliquewidth cw ( F ) of a formula F is defined as the cliquewidthof the incidence graph of F [43].Finally, we consider the adaption of cliquewidth to signed graphs. To thisend, let us make some additional definitions. The signed incidence graph G (cid:48) ofa CNF-formula F is the graph we get from the incidence graph G = ( V, E ) bylabeling the edges with { + , −} as follows: • every edge xC such that x appears positively in C is labeled by +, and • every edge xC such that x appears negatively in C is labeled by − .The signed cliquewidth of a graph G (cid:48) is defined as the minimum number oflabels needed to construct G (cid:48) with the following operations: • creating a new vertex with label i , • taking the disjoint union of two labeled graphs, • joining all vertices with a label i to all vertices with a label j for i (cid:54) = j byan edge with label +, • joining all vertices with a label i to all vertices with a label j for i (cid:54) = j byan edge with label − , and • renaming a label i to j for i (cid:54) = j .The signed incidence cliquewidth scw ( F ) of F is defined as the signed cliquewidthof its signed incidence graph [18].We will deal with several other graph width measures for a CNF-formula inthe remainder of this paper, in particular dual treewidth tw d ( F ) and MIM-width mimw ( F ). Since for those notions we will only use some of their properties, wewill refrain from overwhelming the reader by giving their definitions and referto the literature, e.g. [39, 18, 44, 38, 43].We also consider the treewidth tw ( C ) and the cliquewidth cw ( C ) of Booleancircuits C . Here we give some very basic notions of communication complexity, focusingonly on so-called combinatorial rectangles, which are an important object in thefield. For more details, the reader is referred to the very readable textbook [30].Let X be a set of variables and Π = ( Y, Z ) a partition of X . A combinatorialrectangle respecting Π is a Boolean function r ( X ) that can be written as aconjunction r ( X ) = r ( Y ) ∧ r ( Z ). For a Boolean function f on X , a rectanglecover of size s respecting Π is defined to be a representation f ( X ) = s (cid:95) i =1 r i ( X ) = s (cid:95) i =1 r i ( Y ) ∧ r i ( Z ) , r i ( X ) = r i ( Y ) ∧ r i ( Z ) are combinatorial rectangles respecting Π.The non-deterministic communication complexity cc ( f, Π) = cc ( f, ( Y, Z )) of f is defined as log( s min ) where s min is the minimum size of any rectangle coverof f respecting Π. Example 4.
By definition, all formulas in disjunctive normal forms are rectan-gle covers of the functions they compute respecting all possible partitions. Forexample, F = ( ¬ x ∧ ¬ y ∧ z ) ∨ ( x ∧ y ∧ z ) ∨ ( x ∧ ¬ y ∧ ¬ z )is a rectangle cover of size 3 respecting every partition of { x, y, z } . However, forexample for the partition ( { x, y } , { z } ), there is the smaller rectangle cover((( ¬ x ∧ ¬ y ) ∨ ( x ∧ y )) ∧ z ) ∨ ( x ∧ ¬ y ∧ ¬ z )of size 2. It is not hard to see that there is no smaller rectangle cover of F forthis partition.The best-case non-deterministic communication complexity with -balance cc / ( f ) is defined as cc / ( f ) := min Π ( cc ( f, Π)) where the minimum is over allpartitions Π = (
Y, Z ) of X with min( | Y | , | Z | ) ≥ | X | / Example 5.
Consider the function EQ n ( x , . . . x n , y , . . . , y n ) which is trueif and only if for every i ∈ [ n ] we have x i = y i . It is well-known that forthe partition Π = ( { x , . . . , x n } , { y , . . . , y n } ) we have cc ( EQ n , Π ) = n , seee.g. [30, Chapter 2]. However, for the partitionΠ = ( { x , y , . . . , x (cid:100) n/ (cid:101) , y (cid:100) n/ (cid:101) } , { x (cid:100) n/ (cid:101) +1 , y (cid:100) n/ (cid:101) +1 , . . . , x n , y n } )we have that EQ n ( x , . . . x n , y , . . . , y n ) = (cid:100) n/ (cid:101) (cid:94) i =1 x i = y i ∧ n (cid:94) i = (cid:100) n/ (cid:101) x i = y i is a rectangle cover of size 1 respecting Π . Thus, we have cc / ( EQ n ) = cc ( EQ n , Π ) = 0. Out of the rich landscape of representations from knowledge compilation, seee.g. [13, 36], we only introduce one that we will use in the remainder of thispaper. For all circuits in this section, we assume that ∧ -gates have exactly twoinputs while the number of ∨ -gates may be arbitrary.A v-tree T for a variable set X is a full binary tree whose leaves are inbijection with X . We call the variable assigned by this bijection to a leaf v the label of v . For a node t ∈ T , we denote by T t the subtree of T that has t as itsroot and by var ( T t ) the variables that are labels of leaves in T t . Example 6.
We give a v-tree for the variable set { x, y, z } on the left of Figure 4.We give some definitions from [10]. A complete structured DNNF D struc-tured by a v-tree T is a Boolean circuit with the following properties: there isa labeling µ of the nodes in T with subsets of gates of D such that:7 x zy b ∨ a ∧ a ∧ axx ¬ xx ∨ b ∨ b ∧ b ∧ b ∧ byy ¬ yy zz ¬ zz Figure 4: A v-tree on the left and a complete structured DNNF structured bythis v-tree. For the internal nodes of the v-tree, we give node names on the rightof the nodes whereas for leaves we assume that the name is the label. All gatesof the complete structured DNNF show the operation of the gate (on top) andthe name t of the node in the v-tree for which this gate is in µ ( t ) (on bottom). • For every gate g of D there is a unique node t g of T with g ∈ µ ( t g ). • If t is a leaf labeled by a variable x , then µ ( t ) may only contain x and ¬ x .Moreover, for every input gate g , the node t g is a leaf. • For every ∨ -gate g , all inputs are ∧ -gates in µ ( t g ). • Every ∧ -gate g has exactly two inputs g , g that are both ∨ -gates or inputgates. Moreover, t g and t g are the children of t g in T and in particular t g (cid:54) = t g .The width wi ( D ) of D is defined as the maximal number of ∨ -gates in anyset µ ( t ). We often speak of complete structured DNNF without mentioningthe v-tree by which it is structured in cases where the form of the v-tree isunsubstantial. Intuitively, a complete structured DNNF is a Boolean circuit innegation normal form in which the gates are organized into blocks λ ( t ) whichform a tree shape. In every block one then computes a 2-DNF whose inputs aregates from the blocks that are the children of λ ( t ) in the tree shape. Example 7.
On the right side of Figure 4, we give a complete structured DNNFstructured by the v-tree of Example 6. There are 3 ∨ -gates in µ ( b ), so the widthof the given complete structured DNNF is 3.A complete structured DNNF is called deterministic if and only if for everyassignment and for every ∨ -gate, at most one input evaluates to true. Note thatwe do not allow constant input gates here. We remark that if we allowed those,we could always get rid of them in the circuit by propagation without changingany other properties of the circuit, see [10, Section 4]. We also remark that ina complete structured DNNF D , we can forget a variable x , i.e., construct acomplete structured DNNF D (cid:48) computing ∃ xD , by setting all occurrences of x and ¬ x to 1 and propagating the constants in the obvious way. This operationdoes not increase the width, see [10]. However, if D is deterministic, this isgenerally not the case for D (cid:48) . 8 The Effect of Auxiliary Variables
In this section, we will motivate the use of auxiliary variables when consideringwidth measures of CNF-encodings. To this end, we will show with an exam-ple that auxiliary variables may arbitrarily reduce the treewidth of encodings.Note that this is not very surprising since it is not too hard to see that CNF-representations of, say, the parity function, are of high treewidth. However, inthis case the size of the representation is exponential, so in a sense parity is ahard function for CNF-representations anyway. Here we will show that even forfunctions that have small CNF-representations there can be a large gap betweenthe treewidth of representations and clausal encodings with auxiliary variables.That is why we think it is useful to systematically study width measures forclausal encodings.As an example for a function where auxiliary variables have a dramaticimpact on width, consider the
AtMostOne n -function on variables x , . . . , x n which accepts exactly those assignments in which at most one variable is as-signed to 1. There is an obvious quadratic size representation as AtMostOne n ( x , . . . , x n ) = (cid:94) i,j ∈ [ n ] ,i 1. We will see that in fact there is no representation of AtMo-stOne n that is of smaller primal treewidth unless one adds auxiliary variables,in which case there is a simple encoding of primal treewidth 2. Theorem 1. Any CNF-representation of the AtMostOne n -function of n in-puts without auxiliary variables has primal treewidth n − . However, there is aclausal encoding of AtMostOne n of primal treewidth . To prove Theorem 1, we split the statement into two lemmas. Lemma 2. Any CNF-representation of the AtMostOne n -function of n inputswithout auxiliary variables has primal treewidth n − .Proof. Let x , . . . , x n be the variables of AtMostOne n . We proceed with twoclaims. Claim 3. Every non-tautological clause C of any CNF-representation of AtMostOne n must contain at least the negation of two variables from x , . . . , x n .Proof. Suppose that a clause C does not contain two such literals. Then, thereare two possible cases: either C contains no negated variables, or exactly one.In the first case, the model of AtMostOne n setting all variables to 0 does notsatisfy C , so C cannot be part of the CNF-representation. In the second case,let x i be the (only) variable of AtMostOne n appearing negatively in C . Then,the model of AtMostOne n setting only x i to 1 and all other variables to 0 doesnot satisfy C , so C cannot be part of the CNF-representation, either. Hence,at least two negated variables must appear in C .From Claim 3, we will deduce that all pairs of variables must appear con-jointly in at least one clause. 9 laim 4. For each pair of variables x i , x j from x , . . . , x n with i (cid:54) = j , there isa clause in the CNF-representation of AtMostOne n containing both ¬ x i and ¬ x j .Proof. Suppose that, for a pair x i , x j , such a clause does not exist. Let a bethe assignment that sets exactly the variables x i , x j to 1 and all other variablesto 0. Let C be a clause from the CNF-representation. By our previous claim, C contains two negated variables from x , . . . , x n . Because of our assumption, atleast one of these literals is neither ¬ x i nor ¬ x j , and this literal is satisfied by a .Thus C is satisfied by a . Since this is true for every clause C , it follows that a satisfies all the clauses of the representation, so it is one of its models. However, a is not a model of AtMostOne n . As a consequence, a clause containing both ¬ x i and ¬ x j must exist, which is also true for every pair x i , x j .Claim 4 shows that for each pair of variables, there is a clause containingboth of them. It follows that all variables are connected to all other variablesin the primal graph of the representation. So the primal graph is a clique whichhas treewidth n − Lemma 5. There is a clausal encoding of AtMostOne n of primal treewidth .Proof. We use the well-known ladder encoding from [21], see also [4, Section2.2.5]. We introduce the auxiliary variables y , . . . , y n . The encoding consistsof the following clauses, for every i ∈ [ n ]. : • the validity clauses ¬ y i − ∨ y i , and • clauses representing the constraint x i ↔ ( ¬ y i − ∧ y i )It is easy to see that this encoding is correct: the auxiliary variables y i encodeif one of the variables x j for j ≤ i is assigned to 1. Concerning the treewidthbound, we construct for every index i ∈ [ n ] the bag B i := { y i − , y i , x i } . Then( P n , ( B i ) i ∈ [ n ] ) where P n has nodes [ n ] and edges { ( i, i + 1) | i ∈ [ n − } is a treedecomposition of the encoding of width 2. In this section, we show that from communication complexity we get lowerbounds for the various width notions of Boolean functions. The main buildingblock is the following result that is an application of the main result of [37] tocomplete structured DNNF. Theorem 6. Let D be a complete structured DNNF structured by a v-tree T computing a function f in variables X . Let t be a node of T and let Y := var ( T t ) and Z = X \ var ( T t ) . Finally, let (cid:96) be the number of ∨ -gates in µ ( t ) . Then thereis a rectangle cover of f respecting ( Y, Z ) of size at most (cid:96) . Note that in [37] the considered models are structured DNNF that are notnecessarily complete, a slightly more general model than ours. Thus the state-ment in [37] is slightly different. However, it is easy to see that in our restricted10etting, their proof shows the statement we give above, see also the discus-sion in [6, Section 5]. Since Theorem 6 is somewhat technical, it will be moreconvenient here to use the following easy consequence. Proposition 7. Let D be a complete structured DNNF structured by a v-tree T computing a function f in variables X . Let t be a node of T and let Y := var ( T t ) and Z = X \ var ( T t ) . Then log( wi ( D )) ≥ cc ( f, ( Y, Z )) . Proof. From Theorem 6 and the definition of width, it follows directly that thesize of any rectangle cover of f respecting ( Y, Z ) is upper bounded by the widthof D . Taking the logarithm on both sides yields the claim.In many cases, instead of considering explicit v-trees, it is more convenientto simply use best-case communication complexity. Corollary 8. Let f be a Boolean function in variables X . Then, for everycomplete structured DNNF computing f , we have wi ( D ) ≥ cc / ( f ) . Proof. Note that for every v-tree with X on the leaves, there is a node t suchthat | X | / ≤ | var ( T t ) | ≤ | X | / 3. Plugging this into Proposition 7 directly yieldsthe result.We will use Corollary 8 to turn compilation algorithms that produce com-plete structured DNNF based on a parameter of the input as in [2, 7] into in-expressivity bounds based on this parameter. We first give an abstract versionof this result that we will instantiate for concrete measures later on. Theorem 9. Let C be a (fully expressive) representation language for Booleanfunctions. Let p be a parameter p : C → N . Assume that there is for everyBoolean function f and every C ∈ C that encodes f a complete structured DNNFwith wi ( D ) ≤ p ( C ) . Then we have p ( C ) ≥ cc / ( f ) . Proof. From the assumption, we get p ( C ) ≥ log( wi ( D )). Then we apply Corol-lary 8 to directly get the result.Intuitively, it is exactly the algorithmic usefulness of parameters that makesthe resulting instances inexpressive. Note that it is not surprising that instanceswhose expressiveness is severely restricted allow for good algorithmic properties.However, here we see that the inverse of this statement is also true in a quiteharsh way: if a parameter has good algorithmic properties allowing efficientcompilation into DNNF, then this parameter puts strong restrictions on thecomplexity of the expressible functions.Note that instead of Corollary 8 we could have used Proposition 7 in theproof of Theorem 9 to get a slightly stronger result. We chose to go witha simpler statement here but note that we will use the extended strength ofProposition 7 later on in Section 6. 11rom Theorem 9, we directly get lower bounds for the width measures stud-ied in [34, 39, 18, 43, 38]. The first result considers the parameters with respectto which SAT is fixed-parameter tractable. Corollary 10. There is a constant b > such that for every Boolean function f and every CNF C encoding f we have min { tw i ( C ) , tw p ( C ) , tw d ( C ) , scw ( C ) } ≥ b · cc / ( f ) . Proof. This follows directly from Theorem 9 and the fact that for all theseparameters there are algorithms that, given an input CNF of parameter value k , construct an equivalent complete structured DNNF of width 2 O ( k ) .Using the compilation algorithm from [2, 3], we get essentially the sameresult for circuit representations. Corollary 11. There is a constant b > such that for every Boolean function f and every circuit C encoding f we have min { tw ( C ) , cw ( C ) } ≥ b · cc / ( f ) . We remark that for treewidth 1 the circuits of Corollary 11 boil down toso-called read-once functions which have been studied extensively, see e.g. [23].Finally, we give a version for parameters that allow polynomial time algo-rithms when fixed but no fixed-parameter algorithms. Corollary 12. There is a constant b > such that for every Boolean function f in n variables and every CNF C encoding f we have min { mimw ( C ) , cw ( C ) , mtw ( C ) } ≥ b · cc / ( f )log( n ) . Proof. All of the width measures in the statement allow compilation into com-plete structured DNNF of size – and thus also width – n O ( k ) for parametervalue k and n variables [5]. Thus, with Theorem 9, for each measure there is aconstant b (cid:48) with log( n k ) = k log( n ) ≥ b (cid:48) cc / ( f ) which completes the proof.Note that the bounds of Corollary 12 are lower by a factor of log( n ) thanthose of Corollary 10. We will see in the next section that in a sense thisdifference is unavoidable. In this section, we will show that the different width measures for optimalclausal encodings are strongly related. To this end, in different subsections,we will show the relation of treewidth to all other width measures we consider.We will then combine these relationships between treewidth and other widthmeasures to analyze the relationships between all width measures we consider.12 .1 From Treewidth to Modular Treewidth and Cliquewidth We will start by proving that primal treewidth bounds imply bounds for modulartreewidth and cliquewidth. Theorem 13. Let k be a positive integer and f be a Boolean function of n variables that has a CNF-encoding F of primal treewidth at most k log( n ) . Then f also has a CNF-encoding F (cid:48) of modular incidence treewidth and cliquewidth O ( k ) . Moreover, if F has dependent auxiliary variables, then so has F (cid:48) . Before we prove Theorem 13, let us here discuss this result a little. It iswell known that the modular treewidth and the cliquewidth of a CNF formulacan be much smaller than its treewidth [43]. Theorem 13 strengthens this bysaying essentially that for every function we can gain a factor logarithmic in thenumber of variables.In particular, this shows that the lower bounds we can get from Corollary 12are the best possible: the maximal lower bounds we can show are of the form n/ log( n ) and since there is always an encoding of every function of treewidth n ,by Theorem 13 there is always an encoding of cliquewidth roughly n/ log( n ).Thus the maximal lower bounds of Corollary 12 are tight up to constants.Note that for Theorem 13, it is important that we are allowed to changethe encoding. For example, the primal graph of the formula F = (cid:86) i,j ∈ [ n ] ( x i,j ∨ x i +1 ,j ) ∧ ( x i,j ∨ x i,j +1 ) has the n × n -grid as a minor and thus treewidth n ,see e.g. [15, Chapter 12]. But the incidence graph of F has no modules andalso has the n × n -grid as a minor, so F has modular incidence treewidth atleast n as well. So we gain nothing by going from primal treewidth to modulartreewidth without changing the encoding. What Theorem 13 tells us is thatthere is a different formula F (cid:48) that encodes the function of F , potentially withsome additional variables, such that the treewidth of F (cid:48) is at most O ( n/ log( n )).Let us note that encodings with dependent auxiliary variables are often use-ful, e.g. when considering counting problems. In fact, for such clausal encodings,the number of models is the same as for the function they encode. It is thusinteresting to see that dependence of the auxiliary variables can be maintainedby the construction of Theorem 13. We will see that this is also the case formost other constructions we make. Proof (of Theorem 13). The basic idea is that we do not treat the variables inthe bags of the tree decomposition individually but organize them in groups ofsize log( n ). We then simulate the clauses of the original formula by clauses thatwork on the groups. Since for every group there are only a linear number ofassignments, all encoding sizes stay polynomial. We now give the details of theproof.Let ( T, ( B t ) t ∈ T ) be a tree decomposition of F of width at most k log( n ). Forevery clause C of F there is a bag λ ( C ) that contains the variables of C . Byadding some copies of bags, we may assume w.l.o.g. that for every bag B thereis at most one clause with λ ( C ) = B and call this clause λ − ( B ).In a first step, we construct a coloring µ : var ( F ) → [ k + 1] such that inevery bag there are at most log( n ) variables of every color. This can be doneiteratively as follows: first split the bag B r at the root r into color classes asrequired. Since there are at most k log( n ) + 1 variables in B r by assumption, wecan split them into k +1 color classes of size at most log( n ) arbitrarily. Now let t 13e a node of T with parent t (cid:48) . By the coloring of the variables in B t (cid:48) , some of thevariables in B t are already colored. We simply add the variables not appearingin B t (cid:48) arbitrarily to color classes such that no color class is too big. Again, since B t contains at most k log( n )+1 variables, this is always possible. Moreover, dueto the connectivity condition, there is for every variable x a unique node t x thatis closest to the root under the bags containing x . Consequently, we can makeno contradictory decisions during this coloring process, so µ is well-defined.We now construct F (cid:48) . To this end, we first introduce for every variable x and every node t such that x ∈ B t a new variable x t . Now for every node t with parent t (cid:48) and every color i , we add a set C t (cid:48) ,t,i of clauses in all variables x t , x t (cid:48) with µ ( x ) = i . We construct these clauses in such a way that they aresatisfied by exactly the assignments in which for each pair x t , x t (cid:48) such thatboth these variables exist, both variables take the same value. Note that theclauses in C t,t (cid:48) ,i have at most 2 log( n ) variables, so there are at most n of them.Moreover, they contain all the same variables. The result is a formula in whichall x t for a variable x take the same value in all satisfying assignments.In a next step, we do for each clause C the following: let t = λ ( C ). Forevery color i , we define X i,t to be the set of variables x t such that µ ( x ) = i .We add a fresh variable y C,i and clauses C C,i in the variables X i,t ∪ { y C,i } thataccept exactly the assignments a with • a ( y C,i ) = 1 and there is an x t ∈ X i,t such that setting x to a ( x t ) satisfies C , or • a ( y C,i ) = 0 and there is no x t ∈ X i,t such that setting x to a ( x t ) satisfies C .Next, we add the clause C (cid:48) = (cid:87) i ∈ [ k +1] y C,i . Finally, for every variable x , renameone arbitrary variable x t to x . This completes the construction of F (cid:48) .We claim that F (cid:48) is an encoding of f . To see this, first note that, as discussedbefore, for every variable x of F , in the satisfying assignments of F (cid:48) , all x t and x take the same value. So, we define for every assignment a of F a partialassignment a (cid:48) of F (cid:48) as an extension of a by setting a (cid:48) ( x t ) = a ( x ) for every x t . a satisfies a clause C if and only if there is at least one variable x of C suchthat a ( x ) makes C true. Let µ ( x ) = i , then a satisfies C if and only if C C,i issatisfied by the extension of a (cid:48) that sets y C,i to 1. So a satisfies C if and only ifthere is an extension of a (cid:48) that satisfies C C,i . Consequently, a satisfies F if andonly if there is an extension a (cid:48)(cid:48) of a that satisfies F (cid:48) , so F (cid:48) is an encoding of f as claimed.To see that the construction maintains dependence of auxiliary variables,observe first that the auxiliary variables already present in F are still in F (cid:48) andthey are still dependent. We claim that all the new variables depend on thoseof F . For the variables x t , this is immediate since they must take the samevalue as x in every model. Moreover, the variables y C,i depend on the x t bydefinition. As a consequence, all auxiliary variables are dependentWe now show that the modular treewidth of F (cid:48) is at most O ( k ). First notethat all sets X i,t are modules as are the clause sets C t,t (cid:48) ,i and C C,i . W.l.o.g. wemay assume that for every t , there is at most one clause C with λ ( C ) = t andthat T is a binary tree. We construct a tree decomposition ( T, ( B t ) t ∈ V ( T ) ) asfollows: we put a representant of X i,t , C t,t (cid:48) ,i , C t (cid:48) ,t,i and C C,i into B (cid:48) t . More-14ver, we add y C,i and C (cid:48) to B (cid:48) t . It is easy to see that constructed like this,( T, ( B t ) t ∈ V ( T ) ) is a tree decomposition of width at most O ( k ).Finally, we will show that the incidence graph of the formula i can be con-structed with O ( k ) labels. In this construction, the relabeling operation willonly ever be used to forget labels, i.e., we change a label i into a global dummylabel d such that vertices labeled by d are never used in joining operations.In a first step, we color T with 4 colors such that for every node t , the node t , its at most two children and its parent all have different colors. We denotethe color of t by η ( t ). Then, for every t individually, we create the nodes in C C,i , X t,i where C is such that λ ( C ) = t . The clauses in C C,I get label ( i, η ( t ) , X t,i get label ( i, η ( t ) , i, η ( t ) , 0) with those with ( i, η ( t ) , X t,i with theclauses in C C,i . We then create the y C,i , each with individual labels and connectthem to the clauses with label ( i, η, C (cid:48) with an individual label and connect it to the y C,i . We then forget the labels ofall vertices except the X t,i . We call the resulting graph G t .Note that at this point, the only thing that remains to do is to introduce theclauses in the C t,t (cid:48) ,i and connect them to the variables in G t and G t (cid:48) . To do so,we work in a bottom-up fashion along T . For the leaves of T , there is nothingto do. So let t be an internal node of T with children t , t ; the case in which t only has one child is treated analogously. By induction, we assume that wehave graphs G (cid:48) t and G (cid:48) t containing G t and G t as respective subgraphs suchthat: • all variables appearing in G (cid:48) t j are already connected to all clauses, exceptthe variables in the X t j ,i which are not yet connected to the clauses C t,t ,i , • all vertices in G (cid:48) t j except for those in the X t i have the dummy label d .We proceed as follows: we make a disjoint union of G t , G (cid:48) t and G (cid:48) t . Then wecreate nodes for all clauses in the C t,t ,i giving them the label ( i, η ( t ) , i, η ( t ) , 1) to those with label ( i, η ( t ) , X t ,i with the clauses in C t,t ,i . Then we connect all nodeswith label ( i, η ( t ) , 1) to those with label ( i, η ( t ) , X t,i with the clauses in C t,t ,i . We proceed analogously with t . Finally, weforget all labels but those for the X t,i . This completes the construction.Verifying the clauses in F (cid:48) , one can see that the resulting graph is indeedthe incidence graph of F (cid:48) . Moreover, we have only used O ( k ) clauses by con-struction. This completes the proof. We now show that the reverse of Theorem 13 is also true: upper bounds for manywidth measures imply also bounds for the primal treewidth of clausal encodings.Note that this is at first sight surprising since without auxiliary variables manyof those width measures are known to be far stronger than primal treewidth. Theorem 14. Let f be a Boolean function of n variables.a) If F has a clausal encoding of modular treewidth, cliquewidth or mim-width k then f also has a clausal encoding F (cid:48) of primal treewidth O ( k log( n )) with O ( kn log( n )) auxiliary variables and n O ( k ) clauses. ) If F has a clausal encoding of incidence treewidth, dual treewidth, or signedincidence cliquewidth k , then f also has a clausal encoding F (cid:48) of primaltreewidth O ( k ) with O ( nk ) auxiliary variables and O ( k ) n clauses. To show Theorem 14 and several similar results for other width measures inthis section, we make a detour through DNNF. The idea is to show that fromcertain DNNF representations of functions, we can get clausal encondings ofprimal treewidth strongly related to the width of the DNNF. Since many widthmeasures can be used to construct small width DNNFs, we get small widthclausal encodings for these width measures. We now give a precise statement ofthe relation between DNNF and treewidth of clausal encodings. Lemma 15. Let f be a Boolean function in n variables that is computed by acomplete structured DNNF of width k . Then f has a clausal encoding F of pri-mal treewidth k ) with O ( n log( k )) variables and O ( nk ) clauses. Moreover,if D is deterministic then F has dependent auxiliary variables. The proof of Lemma 15 will rely on so-called proof trees in DNNF, a conceptthat has found wide application in circuit complexity and in particular also inknowledge compilation. To this end, we make the following definition: a prooftree T of a complete structured DNNF D is a circuit constructed as follows:1. The output gate of D belongs to T .2. Whenever T contains an ∨ -gate, we add exactly one of its inputs.3. Whenever T contains an ∧ -gate, we add both of its inputs.4. No other gates are added to T .Note that the choice in Step 2 is non-deterministic, so there are in general manyproof trees for D . Observe also that due to the structure of D given by itsv-tree, every proof tree is in fact a tree which justifies the name. Moreover,letting T be the v-tree of D , every proof tree of D has exactly one ∨ -gate andone ∧ -gate in the set µ ( t ) for every non-leaf node t of T . For every leaf t , everyproof tree contains an input gate x or ¬ x where x is the label of t in T .The following simple observation that can easily be shown by using distribu-tivity is the main reason for the usefulness of proof trees. Observation 16. Let D be a complete structured DNNF and a an assignmentto its variables. Then a satisfies D if and only if it satisfies one of its prooftrees. Moreover, if D is deterministic, then every assignment a that satisfies D satisfies exactly one proof tree of D .Proof (of Lemma 15). Let D be the complete structured DNNF computing f and let T be the v-tree of D . The idea of the proof is to use auxiliary variablesto “guess” for every t an ∨ -gate and an ∧ -gate. Then we use clauses along thev-tree T to verify that the guessed gates in fact form a proof tree and check inthe leaves of T if the assignment to the variables of f satisfies the encoded prooftree. We now give the details of the construction.We first note that, as shown in [10], in complete structured DNNF of width k , one may assume that every set µ ( t ) contains at most k ∧ -gates so we assumethis to be the case for D . For every node t of T , we introduce a set X t of 3 log( k )16uxiliary variables to encode one ∨ -gate and one ∧ -gate of µ ( t ) if t is an internalnode. If t is a leaf, X t encodes one of the at most 2 input gates in µ ( t ). We nowadd clauses that verify that the gates chosen by the variables X t encode a prooftree by doing the following for every t that is not a leaf: first, add clauses in X t that check if the chosen ∧ -gate is in fact an input of the chosen ∨ -gate. Since X t has at most 3 log( k ) variables, this introduces at most k clauses. Let t and t be the children of t in T . Then we add clauses that verify if the ∧ -gate chosenin t has as input either the ∨ -gate chosen in t if t is not a leaf, or the inputgate chosen in t if t is a leaf. Finally, we add analogous clauses for t . Each ofthese clause sets is again in 3 log( k ) variables, so there are at most 2 k clausesin them overall. The result is a CNF-formula that accepts an assignment if andonly if it encodes a proof tree of D .We now show how to verify if the chosen proof tree is satisfied by an as-signment to f . To this end, for every leaf t of T labeled by a variable x , addclauses that check if an assignment to x satisfies the corresponding input gateof D . Since µ ( t ) contains at most 2 gates, this only requires at most 4 clauses.This completes the construction of the clausal encoding. Overall, since T has n internal nodes, the CNF has n (3 log( k ) + 1) variables and 3 nk + 4 n clauses.It remains to show the bound on the primal treewidth. To this end, weconstruct a tree decomposition ( T, ( B t ) t ∈ V ( T ) ) with the v-tree T as underlyingtree as follows: for every internal node t ∈ V ( T ), we set B t := X t ∪ X t ∪ X t where t and t are the children of t . Note that for every clause that isused for checking if the chosen nodes form a proof tree, the variables are thusin a bag B t . For every leaf t , set B t := X t ∪ { x } where x is the variablethat is the label of t . This covers the remaining clauses. It follows that alledges of the primal graph are covered. To check the third condition of thedefinition of a tree decomposition, note that every auxiliary variable in a set X t appears only in B t and potentially in B t (cid:48) where t (cid:48) is the parent of t in T . Thus( T, ( B t ) t ∈ V ( T ) ) constructed in this way is a tree decomposition of the primalgraph of C . Obviously, the width is bounded by 9 log( k ) since every X t has size3 log( k ), which completes the proof. Proof (of Theorem 14). We first show a). By [5], whenever the function f has aclausal encoding F with one of the width measures from this statement boundedby k , then there is also a complete structured DNNF D of width n O ( k ) comput-ing F . Now forget all auxiliary variables of F to get a DNNF representation D (cid:48) of f . Note that since forgetting does not increase the width, see [10], D (cid:48) alsohas width at most n O ( k ) . We then simply apply Lemma 15 to get the result.To see b), just observe that, following the same construction, the width of D is 2 O ( k ) for all considered width measures [5].Remark that the construction of Theorem 14 has a surprising property: thesize and the number of auxiliary variables of the constructed encoding F (cid:48) does not depend on the size of the initial encoding at all. Both depend only on thenumber of variables in f and the width.To maintain dependence of the auxiliary variables in the above construction,we have to work some more than for Theorem 14. We start with some definitions.We call a complete structured DNNF reduced if from every gate there is adirected path to the output gate. Note that every complete structured DNNFcan be turned into a reduced DNNF in linear time by a simple graph traversal17nd that this transformation maintains determinism and structuredness by thesame v-tree. The following property will be useful. Lemma 17. Let D be a reduced complete structured DNNF and let g be a gatein D . Let a g be an assignment to var ( g ) , the variables in the subcircuit rootedin g , that satisfies g . Then, a g can be extended to an assignment a that satisfies D .Proof. We use the fact that an assignment to D is satisfying if and only if thereis a proof-tree that witnesses this. So let T g be a proof tree that witnesses a g satisfying g . We extend it to a proof tree for an extension a of a g as follows:first add a path from g to the output gate to T g and then iteratively add moregates as required by the definition of proof trees where the choices in ∨ -gatesare performed arbitrarily. The result is an extension T of T g which witnessesthat an assignment a that extends a g satisfies D .Let f be a function in variables X ∪ { z } . We say that z is definable in X with respect to f if there is a function g such that for all assignments a with f ( a ) = 1 we have a ( z ) = g ( a | X ) where a | X is the restriction of a to X . Lemma 18. Let f be a function in variables X ∪ { z } such that z is definablein X with respect to f . Let D be a reduced complete structured deterministic DN N F computing f . Then the complete structured DNNF D (cid:48) we get from D by forgetting z is deterministic as well.Proof. By way of contradiction, assume this were not the case. Then there isan ∨ -gate g in D (cid:48) and an assignment a (cid:48) to X such that two children g and g are satisfied by a (cid:48) . By Lemma 17, we may assume that a (cid:48) satisfies D (cid:48) . Thenthere are extensions a and a of a that assign a value to z such that a satisfies g and a satisfies g in D . Note that both a and a satisfy D and thus, bydefinability, a and a assign the same value to z . So a = a and hence a satisfies both g and g in D which contradicts the determinism of D . Theorem 19. Let f be a Boolean function of n variables.a) If F has a clausal encoding with dependent auxiliary variables of modulartreewidth, cliquewidth or mim-width k then f also has a clausal encoding F (cid:48) with dependent auxiliary variables of primal treewidth O ( k log( n )) with O ( kn log( n )) auxiliary variables and n O ( k ) clauses.b) If F has a clausal encoding with dependent auxiliary variables of incidencetreewidth, dual treewidth, or signed incidence cliquewidth k , then f alsohas a clausal encoding F (cid:48) with dependent auxiliary variables of primaltreewidth O ( k ) with O ( nk ) auxiliary variables and k n clauses.Proof. The proof is essentially the same as that of Theorem 14 with some addi-tional twists. First observe that the complete structured DNNF D constructedwith [5] is deterministic. Then we use Lemma 18 when forgetting the auxiliaryvariables and get a D (cid:48) that is deterministic without increasing the width. Then,since D (cid:48) is deterministic, we can construct a clausal encoding with dependentauxiliary variables using Lemma 15. 18ext we will show that signed incidence cliquewidth is linearly related toprimal treewidth when allowing auxiliary variables. We will state a result similarto Lemma 15.To do so, we will start with a special case for which we introduce somemore definitions: a special tree decomposition of a graph G is defined as atree decomposition ( T, ( B t ) t ∈ V ( T ) ) in which for every vertex x ∈ V ( G ) the set { t ∈ V ( T ) | x ∈ B t } lies on a leaf-root path in T [12]. The special treewidth isdefined as the smallest width of any special tree decomposition of G . Finally, wedefine the primal special treewidth of a CNF-formula as the special treewidthof its primal graph. Lemma 20. Every CNF-formula of primal special treewidth k has signed inci-dence cliquewidth at most k + 1 .Proof. Let ( T, ( B t ) t ∈ V ( T ) ) be a special tree decomposition of the primal graphof F . It is well known that for every clause C there is a node t = λ ( C ) of T such that all variables of C are in B t . By adding copies of some bags B t alonga root-leaf path in T , we may assume that λ ( C ) (cid:54) = λ ( C (cid:48) ) for every pair C, C (cid:48) ofclauses with C (cid:54) = C (cid:48) .We will show how to construct the signed incidence graph G (cid:48) of F with theoperations in the definition of signed cliquewidth along the tree T . In a firststep, we label every variable x of F with a color µ ( x ) from { , . . . , k + 1 } suchthat in every bag B t there are no two variables with the same label µ ( x ). Thiscan be done similarly to the first step of the proof of Theorem 13 by descendingfrom the root to the leaves and labeling the variables in the bags along thisway. The label µ ( x ) will be the label that the variable gets when it is createdin the construction of G (cid:48) . As in the proof of Theorem 13, the only renamingsof labels that we will perform will be forget operations, i.e., renaming a label toa dummy label d .For the construction of G (cid:48) , we will iteratively construct for every t ∈ V ( T )a graph G t that contains all variables in S t := (cid:83) t (cid:48) ∈ V ( T t ) B t where T t is thesubtree of T rooted in t . Moreover, G t contains all clauses such that λ ( C ) liesin T t and all signed edges connecting them to their variables.If t is a leaf, then we create all variables in B t and if there is a clause C with λ ( C ) = t , we introduce it with color k + 2. Since all variables of C have differentcolors, we can then introduce all signed edges individually. This completes theconstruction for the leaf case.Let now t be an internal node with children t , . . . , t (cid:96) . By assumption, wehave already constructed G t , . . . , G t (cid:96) . Note that for every i the variables in G t i that are not in B t are by construction already connected to all their clauses in G t i , so we can safely forget their label in a first step. Now we take the disjointunion of all G t i . Note that this union is in fact disjoint, because, since we startfrom a special tree decomposition, no node appears in more than one G t i . Nowwe create the variables which appear in B t but not in any G t i . Note that atthis point the vertices with non-dummy labels are exactly those in B t . If thereis no clause C with λ ( C ) = t , we are done. Otherwise, we create C and connectit to all its variables by signed edges as in the leaf case. This completes theconstruction of G t .For the root r of T we have G r = G (cid:48) by definition. Moreover, we have usedat most k + 2 labels. This completes the proof.19ith Lemma 20, we can give a version of Lemma 15 for signed incidencecliquewidth easily. Lemma 21. Let f be a Boolean function in n variables that is computed bya structured DNNF of width k . Then f has a clausal encoding F of signedincidence cliquewidth and primal special treewidth O (log( k )) with O ( n log( k )) variables and O ( nk ) clauses. Moreover, if D is deterministic then F has de-pendent auxiliary variables.Proof. We only have to observe that in fact the tree decomposition in the proofof Lemma 15 is special and apply Lemma 20. Corollary 22. Let f be a function with a CNF-representation of primal tree-width k . Then f has a clausal encoding of signed incidence cliquewidth andspecial treewidth O ( k ) . We can now state the main result of this section. Theorem 23. Let A = { tw p , tw d , tw i , scw } and B = { mtw , cw , mimw } . Let f be a Boolean function in n variables.a) Let w ∈ A and w ∈ B . Then there are constants c and c such thatthe following holds: let F and F be clausal representations for f withminimal w -width and w -width, respectively. Then w ( F ) ≤ k log( n ) ⇒ w ( F ) ≤ c k and w ( F ) ≤ k ⇒ w ( F ) ≤ c k log( n ) . b) Let w ∈ A and w ∈ A or w ∈ B and w ∈ B . Then there are constants c and c such that the following holds: let F and F be clausal represen-tations for f of minimal w -width and w -width, respectively. Then w ( F ) ≤ k ⇒ w ( F ) ≤ c k and w ( F ) ≤ k ⇒ w ( F ) ≤ c k. Proof. Assume first that w = tw p . For a) we get the second statement directlyfrom Theorem 14 a). For cw and mtw we get the first statement by Theorem 13.For mimw it follows by the fact that for every graph mimw ( G ) ≤ c · cw ( G ) forsome absolute constant c , see [44, Section 4].For b), the second statement is Theorem 14 b). Since for every formula F wehave tw i ( F ) ≤ tw p ( F ) + 1, see e.g. [18], the first statement for tw i is immediate.For scw it is shown in Corollary 22, while for tw d it can be found in [40].All other combinations of w and w can now be shown by an intermediatestep using tw p . 20 Applications In this section, we consider cardinality constraints, i.e., constraints of the form (cid:80) i ∈ [ n ] x i ≤ k in the Boolean variables x , . . . , x n . The value k is commonlycalled the degree or the threshold of the constraint. Let us denote by C kn thecardinality constraint with n variables and degree k . Cardinality constraintshave been studied extensively and many encodings are known, see e.g. [41]. Herewe add another perspective on cardinality constraint encodings by determiningtheir optimal treewidth. We remark that we could have studied cardinalityconstraints in which the relation is ≥ instead of ≤ with essentially the sameresults.We start with an easy observation: Observation 24. C kn has an encoding of primal treewidth O (log(min( k, n − k ))) Proof. First assume that k < n/ 2. We iteratively compute the partial sums of S j := (cid:80) i ∈ [ j ] x i and encode their values in log( k )+1 bits Y j := { y j , . . . , y j log( k )+1 } .We cut these sums off at k + 1 (if we have seen at least k + 1 variables set to1, this is sufficient to compute the output). In the end we encode a comparatorcomparing the last sum S n to k .Since the computation of S j +1 can be done from S j and x j +1 , we can com-pute the partial sums with clauses containing only the variables in Y j ∪ Y j +1 ∪{ x j +1 } , so O (log( k )) variables. The resulting CNF-formula can easily be seento be of treewidth O (log( k )).If k > n/ 2, we proceed similarly but count variables assigned to 0 instead ofthose set to 1.We remark that our construction is that described as the basic approachin [4, Section 8.6.7]. It has some similarity with the sequential counter intro-duced in [42]. The main difference is that we encode the partial sums S j inbinary whereas in the sequential counter, they are encoded in unary. This lat-ter encoding has better properties with respect to unit propagation, whereasour encoding has smaller treewidth, which is the parameter we are optimizingfor. We now show that Observation 24 is essentially optimal. Proposition 25. Let k < n/ . Then cc / ( C kn ) = Ω(log(min( k, n/ . Proof. Let s = min( k, n ). Consider an arbitrary partition Y, Z with n ≤ | Y | ≤ n . We show that every rectangle cover of C kn must have s rectangles. Tothis end, choose assignments ( a , b ) , . . . , ( a s , b s ) such that a i : Y → { , } assigns i variables to 1 and b i : Z → { , } assigns k − i variables to 1. Notethat every ( a i , b i ) satisfies C kn . We claim that no rectangle r ( Y ) ∧ r ( Z ) in arectangle cover of C kn can have models ( a i , b i ) and ( a j , b j ) for i (cid:54) = j . To seethis, assume that such a model exists and that i < j . Then the assignment( a j , b i ) is also a model of the rectangle since a j satisfies r ( Y ) and b i satisfies r ( Z ). But ( a j , b i ) contains more than k variables assigned to 1, so the rectangle r ( Y ) ∧ r ( Z ) cannot appear in a rectangle cover of C kn . Thus, every rectanglecover of C kn must have a different rectangle for every model ( a i , b i ) and thus atleast s rectangles. This completes the proof for this case.21 symmetric argument shows that for k > n/ cc / ( C kn ) = Ω(log(min( n − k, n/ k < n for non-trivialcardinality constraints, we get the following from Theorem 6. Corollary 26. Clausal encodings of smallest primal treewidth for C kn have pri-mal treewidth Θ(log( s )) for s = min( k, n − k ) . The same statement is true fordual and incidence treewidth and signed incidence cliquewidth. For incidencecliquewidth, modular treewidth and mim-width, there are clausal encodings of C kn of constant width. We now consider the permutation function PERM n which has the n inputvariables X n = { x ij | i, j ∈ [ n ] } thought of as a matrix in these variables. PERM n evaluates to 1 on an input a if and only if a is a permutation matrix,i.e., in every row and in every column of a there is exactly one 1. Example 8. The function PERM has the variables x , x , x , x whichwe interpret organized as the matrix (cid:18) x x x x (cid:19) . The only inputs on which PERM evaluates to 1 are (cid:18) (cid:19) and (cid:18) (cid:19) . Inputs on which PERM evaluates to 0 are for example (cid:18) (cid:19) (the first row has more than one 1-entry)and (cid:18) (cid:19) (the first column has no 1-entry). PERM n is known to be hard in several versions of branching programs,see [45]. In [9], it was shown that clausal encodings of PERM n require tree-width Ω( n/ log( n )). We here give an improvement by a logarithmic factor. Lemma 27. For every v-tree T on variables X n , there is a node t of T suchthat cc ( PERM n , Y, Z ) = Ω( n ) where Y = var ( T t ) and Z = X \ Y .Proof. The proof is a variation of arguments in [9] and in [29], see also [45,Section 4.12]. Since all models of PERM n assign exactly n variables to 1, forevery model a of PERM n there is a node t a in T such that T t contains between n/ n/ a . Since T has n internal nodes and PERM n has n ! models, there must be a node t such that for at least ( n − a we have t = t a . We will show in the remainder that t has thedesired property.Denote by A the set of models of PERM n for which t a = t . Let Y = var ( T t )and Z = X n \ Y as in the statement of the lemma. Every model a of PERM n corresponds to a permutation π a on [ n ] that assigns every i ∈ [ n ] to the j suchthat a ( x ij ) = 1. Note that because of the properties of a , π a is well-defined andindeed a permutation.Let R ( X ) = r ( Y ) ∧ r ( Z ) be a rectangle in a rectangle cover of PERM n with partition ( Y, Z ). We will show that R ( X ) contains few models from A . Tothis end, fix a model a ∈ A of R ( X ) and define I ( a ) = { i | x i,π a ( i ) ∈ Y } . Note22hat k := | I ( a ) | is the number of variables in Y that are assigned to 1 by a andthus n/ ≤ k ≤ n/ 3. Let a (cid:48) be another model of R ( X ). Then I ( a (cid:48) ) = I ( a )because otherwise a | Y ∪ a (cid:48) | Z does not encode a permutation where a | Y denotesthe restriction of a to Y and a (cid:48) | Z that of a (cid:48) to Z . Letting I (cid:48) ( a ) = { π a ( i ) | i ∈ I ( a ) } , we get similarly that for all models a (cid:48) of R ( X ) we have I (cid:48) ( a ) = I (cid:48) ( a (cid:48) ). Itfollows that the models of r ( Y ) are all bijections between I ( a ) and I (cid:48) ( a ) andthus r ( Y ) has at most k ! models.By a symmetric argument, one sees that r ( Z ) has at most ( n − k )! models.Thus, the number of models of R is bounded by k !( n − k )! ≤ (cid:0) n (cid:1) ! (cid:0) n (cid:1) !. As aconsequence, to cover all ( n − a , one needs at least( n − (cid:0) n (cid:1) ! (cid:0) n (cid:1) ! = 1 n (cid:18) n n (cid:19) ≥ n (cid:18) n n (cid:19) n = 1 n √ n rectangles, which completes the proof.As a consequence of Lemma 27, we get an asymptotically tight treewidthbound for encodings of PERM n . Corollary 28. Clausal encodings of smallest primal treewidth for C kn have pri-mal treewidth Θ( n ) .Proof (sketch). The lower bound follows by using Lemma 27 and Proposition 7and then arguing as in the proof of Theorem 9.For the upper bound, observe that checking if out of n variables exactly onehas the value 1 can easily be done with n variables. We apply this for every rowin a bag of a tree decomposition. We perform these checks for one row afterthe other and additionally use variables for the columns that remember if in acolumn we have seen a variable assigned 1 so far. Overall, to implement this,one needs O ( n ) auxiliary variables and gets a formula of treewidth O ( n ).From Corollary 28 we get the following bound by applying Theorem 13. Thisanswers an open problem from [9] which showed only conditional lower boundsfor the incidence cliquewidth of encodings of PERM n . Corollary 29. Clausal encodings of smallest incidence cliquewidth for C kn havewidth Θ( n/log ( n )) . In this section, we show how our approach can be used to improve lower boundsfor structurally restricted classes of circuits. We recall that a minor H of agraph G is a graph that we can get from G by deleting vertices, deleting edgesand contracting edges. For a graph H , the class of H -minor-free graphs isdefined as the class of graphs consisting of all graphs that do not have H as aminor. H -minor-free graphs have been studied extensively. In particular, it isknown that for planar graphs, and more generally for all graphs embeddable ina fixed surface, there is a graph H such that those graphs are H -minor free. Forexample, planar graphs are K -minor-free and K , -minor-free.We say that a Boolean circuit C is H -minor-free if the underlying undirectedgraph of C is H -minor-free. Remember that we assume that every input variableis the label of at most one input gate. There have long been quadratic lower23ounds for planar circuits [32]. Those were generalized to almost quadratic lowerbounds of the order Ω( n / log( n ) ) for H -minor-free circuits in [14]. We showhere that with our techniques it is easy to improve these bounds to quadraticlower bounds.As in [14], the basic building block for our lower bound will be the followingresult on the treewidth of H -minor-free graphs. Theorem 30 ([1]) . For every graph H there is a constant h such that every H -minor-free graph G has treewidth at most h (cid:112) | V ( G ) | . Corollary 31. For every graph H there is a constant h (cid:48) such that for everyfunction f , every H -minor-free circuit C computing f has at least cc / ( f ) gates.Proof. By Corollary 11, any circuit computing f must have treewidth Ω( cc / ( f )).By Theorem 30, the treewidth of C is at most √ s where s is the number of gatesin C . Thus √ s ≥ cc / ( f ) and the claim follows.To show a quadratic lower bound, consider the function (cid:52) -free n in variables X ij with 1 ≤ i < j ≤ n which is defined as follows: interpret the input as theadjacency matrix of a graph G and return 1 if and only if G does not have atriangle as a subgraph. We note that (cid:52) -free n is a classical function, consideredin communication complexity essentially since the creation of the field [33].Here, we will use the following result: Theorem 32 ([28]) . The best-case non-deterministic communication complex-ity with -balance of (cid:52) -free n is quadratic in n , i.e., cc / ( (cid:52) -free n ) = Ω( n ) . We directly get the following generalization of the quadratic lower boundin [32], which improves that in [14]. Theorem 33. For every fixed graph H there is a constant h (cid:48) such that every H -minor-free circuit computing (cid:52) -free n has Ω( n ) gates, i.e., quadratic in thenumber of inputs. We have shown several results on the expressivity of clausal encodings withrestricted underlying graphs. In particular, we have seen that many graphwidth measures from the literature put strong restrictions on the expressivityof encodings. We have also seen that, contrary to the case of representationsby CNF-formulas, in the case where auxiliary variables are allowed, all widthmeasures we have considered are strongly related to primal treewidth and neverdiffer by more than a logarithmic factor. Moreover, most of our results are alsotrue while maintaining dependence of auxiliary variables.From a practical standpoint, one point of our results might be that formulassolved with width-based algorithms as those from the theoretical literature canlikely only deal with quite simple formulas. Otherwise, for example if formulascontain big cardinality constraints or pseudo-Boolean constraints, the width of24he formulas might be infeasibly high. This is because all those algorithmsare at least exponential in the width of the input. An implementation of suchalgorithms would thus likely have to implement heuristics and optimizationsnot presented in the theory literature. For example, in [17], it was shown thatone can use parallelism of GPUs to improve the efficiency of treewidth-basedcounting and thus scale to higher treewidth.To close the paper, let us discuss several questions. First, the number ofclauses of the encodings guaranteed by Theorem 14 is very high. In particular,it is exponential in the width k . It would be interesting to understand if thiscan be avoided, i.e., if there are encodings of roughly the same primal treewidthwhose size is polynomial in k .It would also be interesting to see if our results can be extended to otherclasses of CNF-formulas on which SAT is tractable. Interesting classes to con-sider would e.g. be the classes in [19]. In this paper, the authors define anothergraph for CNF-formulas for which bounded treewidth yields tractable modelcounting. It is not clear if the classes characterized that way allow small com-plete structured DNNF so our framework does not apply directly. It would stillbe interesting to see if one can show similar expressivity results to those here.Other interesting classes one could consider are those defined by backdoors, seee.g. [20]. Acknowledgements. The authors are grateful to the anonymous reviewersfor their comments, which greatly helped to improve the presentation of thepaper. The first author would like to thank David Mitchell for asking the rightquestion at the right moment. This paper grew largely out of an answer to thisquestion. References [1] N. Alon, P. D. Seymour, and R. Thomas. A separator theorem for graphswith an excluded minor and its applications. In Proceedings of the 22ndAnnual ACM Symposium on Theory of Computing, STOC 1990 , 1990. 24[2] A. Amarilli, F. Capelli, M. Monet, and P. Senellart. Connecting knowledgecompilation classes and width parameters. CoRR , abs/1811.02944, 2018.11, 12[3] A. Amarilli, M. Monet, and P. Senellart. Connecting width and structurein knowledge compilation. In , 2018. 12[4] A. Biere, M. Heule, H. van Maaren, and T. Walsh, editors. Handbook ofSatisfiability , volume 185 of Frontiers in Artificial Intelligence and Appli-cations . IOS Press, 2009. 3, 10, 21[5] S. Bova, F. Capelli, S. Mengel, and F. Slivovsky. On Compiling CNFs intoStructured Deterministic DNNFs. In Theory and Applications of Satisfia-bility Testing - SAT 2015 - 18th International Conference , 2015. 3, 12, 17,18 256] S. Bova, F. Capelli, S. Mengel, and F. Slivovsky. Knowledge compilationmeets communication complexity. In Proceedings of the Twenty-Fifth In-ternational Joint Conference on Artificial Intelligence, IJCAI 2016 , 2016.2, 3, 11[7] S. Bova and S. Szeider. Circuit treewidth, sentential decision, and querycompilation. In Proceedings of the 36th ACM SIGMOD-SIGACT-SIGAISymposium on Principles of Database Systems, PODS 2017 , pages 233–246,2017. 11[8] J. Brault-Baron, F. Capelli, and S. Mengel. Understanding model countingfor β -acyclic CNF-formulas. CoRR , abs/1405.6043, 2014. 2[9] I. Briquel, P. Koiran, and K. Meer. On the expressive power of CNFformulas of bounded tree- and clique-width. Discrete Applied Mathematics ,159(1):1–14, 2011. 2, 3, 22, 23[10] F. Capelli and S. Mengel. Tractable QBF by knowledge compilation. In , volume 126, pages 18:1–18:16, 2019. 3, 7, 8, 16, 17[11] H. Chen. Quantified constraint satisfaction and bounded treewidth. In Proceedings of the 16th Eureopean Conference on Artificial Intelligence,ECAI 2004 , 2004. 1[12] B. Courcelle. On the model-checking of monadic second-order formulaswith edge set quantifications. Discrete Applied Mathematics , 160(6):866–887, 2012. 19[13] A. Darwiche and P. Marquis. A knowledge compilation map. J. Artif.Intell. Res. , 17:229–264, 2002. 7[14] M. de Oliveira Oliveira. Size-treewidth tradeoffs for circuits computing theelement distinctness function. Theory Comput. Syst. , 62(1):136–161, 2018.24[15] R. Diestel. Graph Theory, 4th Edition , volume 173 of Graduate texts inmathematics . Springer, 2012. 3, 13[16] P. Duris, J. Hromkovic, S. Jukna, M. Sauerhoff, and G. Schnitger. Onmulti-partition communication complexity. Inf. Comput. , 194(1):49–75,2004. 2[17] J. K. Fichte, M. Hecher, and M. Zisser. An Improved GPU-Based SATModel Counter. In T. Schiex and S. de Givry, editors, Principles and Prac-tice of Constraint Programming - 25th International Conference, CP 2019,Stamford, CT, USA, September 30 - October 4, 2019, Proceedings , vol-ume 11802 of Lecture Notes in Computer Science , pages 491–509. Springer,2019. 25[18] E. Fischer, J. Makowsky, and E. Ravve. Counting truth assignments offormulas of bounded tree-width or clique-width. Discrete Applied Mathe-matics , 156(4):511–529, 2008. 1, 2, 3, 6, 12, 202619] R. Ganian and S. Szeider. New width parameters for model counting.In , 2017. 25[20] S. Gaspers and S. Szeider. Strong backdoors to bounded treewidth SAT.In , 2013. 25[21] I. P. Gent and P. Nightingale. A new encoding of alldifferent into SAT. In International Workshop on Modelling and Reformulating Constraint Satis-faction Problems , 2004. 10[22] E. Giunchiglia, M. Maratea, and A. Tacchella. Dependent and independentvariables in propositional satisfiability. In Logics in Artificial Intelligence,JELIA 2002 , 2002. 3[23] M. C. Golumbic and V. Gurvich. Read-once functions. Boolean Functions:Theory, Algorithms and Applications , pages 519–560, 2011. 12[24] G. Gottlob, R. Pichler, and F. Wei. Bounded treewidth as a key to tractabil-ity of knowledge representation and reasoning. Artif. Intell. , 174(1):105–132, 2010. 1[25] J. Hromkovic. Communication Complexity and Parallel Computing . Textsin Theoretical Computer Science. An EATCS Series. Springer, 1997. 2[26] M. Jakl, R. Pichler, and S. Woltran. Answer-set programming withbounded treewidth. In Proceedings of the 21st International Joint Con-ference on Artificial Intelligence, IJCAI 2009 , 2009. 1[27] S. Jukna. Boolean Function Complexity - Advances and Frontiers , vol-ume 27 of Algorithms and combinatorics . Springer, 2012. 2[28] S. Jukna and G. Schnitger. Triangle-freeness is hard to detect. Combina-torics, Probability & Computing , 11(6):549–569, 2002. 24[29] M. Krause. Exponential lower bounds on the complexity of local and real-time branching programs. Elektronische Informationsverarbeitung und Ky-bernetik , 24(3):99–110, 1988. 22[30] E. Kushilevitz and N. Nisan. Communication complexity . Cambridge Uni-versity Press, 1997. 2, 6, 7[31] M. Lampis, S. Mengel, and V. Mitsou. QBF as an alternative to cour-celle’s theorem. In , 2018. 2[32] R. J. Lipton and R. E. Tarjan. Applications of a planar separator theorem. SIAM J. Comput. , 9(3):615–627, 1980. 3, 24[33] C. H. Papadimitriou and M. Sipser. Communication complexity. J. Com-put. Syst. Sci. , 28(2):260–269, 1984. 24[34] D. Paulusma, F. Slivovsky, and S. Szeider. Model Counting for CNF For-mulas of Bounded Modular Treewidth. In , 2013. 122735] D. Paulusma, F. Slivovsky, and S. Szeider. Model counting for CNF for-mulas of bounded modular treewidth. Algorithmica , 76(1):168–194, 2016.1, 2, 3[36] K. Pipatsrisawat and A. Darwiche. New compilation languages based onstructured decomposability. In Proceedings of the Twenty-Third AAAIConference on Artificial Intelligence, AAAI 2008 , 2008. 7[37] T. Pipatsrisawat and A. Darwiche. A lower bound on the size of decom-posable negation normal form. In Proceedings of the Twenty-Fourth AAAIConference on Artificial Intelligence, AAAI 2010 , 2010. 2, 3, 10[38] S. H. Sæther, J. A. Telle, and M. Vatshelle. Solving J. Artif. Intell. Res. , 54:59–82, 2015. 1, 2, 3, 6,12[39] M. Samer and S. Szeider. Algorithms for propositional model counting. J.Discrete Algorithms , 8(1):50–64, 2010. 1, 3, 6, 12[40] M. Samer and S. Szeider. Constraint satisfaction with bounded treewidthrevisited. J. Comput. Syst. Sci. , 76(2):103–114, 2010. 2, 20[41] C. Sinz. Towards an optimal CNF encoding of boolean cardinality con-straints. In Principles and Practice of Constraint Programming - CP 2005,11th International Conference, CP 2005 , 2005. 21[42] C. Sinz. Towards an Optimal CNF Encoding of Boolean Cardinality Con-straints. In Proceedings of the 11th International Conference on Principlesand Practice of Constraint Programming , CP’05, pages 827–831, Berlin,Heidelberg, 2005. Springer-Verlag. 21[43] F. Slivovsky and S. Szeider. Model counting for formulas of bounded clique-width. In Algorithms and Computation - 24th International Symposium,ISAAC 2013 , 2013. 1, 2, 3, 6, 12, 13[44] M. Vatshelle. New Width Parameters of Graphs . PhD thesis, University ofBergen, 2012. 6, 20[45] I. Wegener.