On Compiling Structured CNFs to OBDDs

19  Download (0)

Full text


DOI 10.1007/s00224-016-9715-z

On Compiling Structured CNFs to OBDDs

Simone Bova1·Friedrich Slivovsky1

© The Author(s) 2016. This article is published with open access at Springerlink.com

Abstract We present new results on the size of OBDD representations of structurally characterized classes of CNF formulas. First, we prove thatvariable convexformulas (that is, formulas with incidence graphs that are convex with respect to the set of vari-ables) have polynomial OBDD size. Second, we prove an exponential lower bound on the OBDD size of a family of CNF formulas with incidence graphs of bounded degree. We obtain the first result by identifying a simple sufficient condition—which we call thefew subtermsproperty—for a class of CNF formulas to have polynomial OBDD size, and show that variable convex formulas satisfy this condition. To prove the second result, we exploit the combinatorial properties of expander graphs; this approach allows us to establish an exponential lower bound on the OBDD size of formulas satisfying strong syntactic restrictions.

Keywords Knowledge compilation·Ordered binary decision diagram· Conjunctive normal form·Expander graphs

1 Introduction

The goal ofknowledge compilationis to succinctly represent propositional knowl-edge bases in a format that supports a number of queries in polynomial time [8].

Friedrich Slivovsky fslivovsky@gmail.com Simone Bova bova@ac.tuwien.ac.at


Choosing a representation language generally involves a trade-off between succinct-ness and the range of queries that can be efficiently answered. In this paper, we study ordered binary decision diagram (OBDD) representations of propositional the-ories given as formulas in conjunctive normal form (CNF). Binary decision diagrams (also known as branching programs) and their variants are widely used and well-studied representation languages for Boolean functions [25]. OBDDs in particular enjoy properties, such as polynomial-time equivalence testing, that make them the data structure of choice for a range of applications.

The question of which classes of CNFs can be represented as (orcompiled into, in the jargon of knowledge representation) OBDDs of polynomial size is largely unexplored [25, Chapter 4]. We approach this classification problem by considering structurallycharacterized CNF classes, more specifically, classes of CNF formulas defined in terms of properties of theirincidence graphs(the incidence graph of a for-mula is the bipartite graph on clauses and variables where a variable is adjacent to the clauses it occurs in). Figure1depicts a hierarchy of well-studied bipartite graph classes as considered by Lozin and Rautenbach [20, Fig. 2]. This hierarchy is par-ticularly well-suited for our classification project as it includes prominent cases such as beta acyclic CNFs [5] and bounded clique-width CNFs. When located within this hierarchy, the known bounds on the OBDD size of structural CNF classes leave a large gap (depictedon the leftof Fig.1):

– On the one hand, we have a polynomial upper bound on the OBDD size of bounded treewidth CNF classes proved recently by Razgon [23]. The corre-sponding graph classes are located at the bottom of the hierarchy.

– On the other hand, there is an exponential lower bound for the OBDD size of general CNFs, proved two decades ago by Devadas [9]. The corresponding graph

Fig. 1 The diagram depicts a hierarchy of classes of bipartite graphs under the inclusion relation (thin edges).B,H,Dk,C,Cv, andCcdenote, respectively, bipartite graphs, chordal bipartite graphs

(corre-sponding to beta acyclic CNFs), bipartite graphs of degree at mostk(k≥3), convex graphs,left(variable) convex graphs, andright(clause) convex graphs. The classCvCcof biconvex graphs and the classDkof

bipartite graphs of degree at mostkhave unbounded clique-width. The classHDkof chordal bipartite

graphs of degree at mostkhas bounded treewidth. Thegreenandred curved linesenclose, respectively, classes of incidence graphs whose CNFs have polynomial time OBDD compilation, and classes of inci-dence graphs whose CNFs have exponential size OBDD representations; the right hand picture shows the compilability frontier, updated in light of Results 1 and 2


class is not chordal bipartite, has unbounded degree and unbounded clique-width, and hence is located at the top of the hierarchy.

Contribution In this paper, we tighten this gap as illustratedon the rightin Fig.1. More specifically, we prove new bounds for two structural classes of CNFs.

Result 1 CNF formulas with variable convex incidence graphs have polynomial OBDD size (Theorem 7).

Convexity is a property of bipartite graphs that has been extensively studied in the area of combinatorial optimization [14,15,24], and that can be detected in linear time [4,19].

To prove Result 1, we identify a property of CNF classes—called thefew sub-terms property—that is sufficient for polynomial-size compilability (Theorem 4), and then prove that CNFs with variable convex incidence graphs have this property (Lemma 6). The few subterms property naturally arises as a sufficient condition for polynomial size compilability when considering OBDD representations of CNF for-mulas (cf. Oztok and Darwiche’s recent work onCV-width[22], which explores a similar idea). Aside from its role in proving polynomial-size compilation for variable convex CNFs, the few subterms property can also be used to explain the (known) fact that classes of CNFs with incidence graphs ofbounded treewidthhave OBDD repre-sentations of polynomial size (Lemma 10), and as such offers a unifying perspective on these results. Both the result on variable convex CNFs and the result on bounded treewidth CNFs can be improved to polynomialtimecompilation by appealing to a stronger version of the few subterms property (Theorems 7 and 11).

In an attempt to push the few subterms property further, we adopt the language of parameterized complexityto formally capture the idea that CNFs “close” to a class with few subterms have “small” OBDD representations. More precisely, defining thedeletion distanceof a CNF from a CNF class as the number of its variables or clauses that have to be deleted in order for the resulting formula to be in the class, we prove that CNFs have fixed-parameter tractable OBDD size parameterized by the deletion distance from a CNF class with few subterms (Theorem 13). This result can again be improved to fixed-parametertimecompilation under additional assumptions (Theorem 14), yielding for instance fixed-parameter tractable time compilation of CNFs into OBDDs parameterized by thefeedback vertex setsize (Corollary 15).

On the negative side, we prove that some structurally characterized classes of CNF formulas do not have small OBDD representations:

Result 2 There is a class of CNF formulas with incidence graphs of bounded degree such that every formula F in this class has OBDD size at least 2(size(F ))

(Theorem 19).1


This substantially improves a 2(√size(F ))lower bound for the OBDD size of a class of CNFs by Devadas [9]. Moreover, we establish this bound for a class that sat-isfies strong syntactic restrictions: every clause contains exactly two positive literals and each variable occurs at most 3 times.

The heavy lifting in our proof of this result is done by a family ofexpander graphs. Expander graphs have found applications in many areas of mathematics and com-puter science [16,21], including circuit and proof complexity [17]. In this paper, we show how they can be used to derive lower bounds for OBDDs.

Organization The remainder of this paper is organized as follows. In Section2, we introduce basic notation and terminology. In Section3, we prove that formulas with few subterms have polynomial OBDD size and show that variable-convex CNFs (as well as bounded treewidth CNFs) enjoy the few subterms property. Fixed-parameter tractable size and time compilability results based on the few subterms property are presented in Section3.4. In Section4, we prove a strongly exponential lower bound on the OBDD size of CNF formulas based on expander graphs. We conclude in Section5.

2 Preliminaries

Formulas LetXbe a countable set ofvariables. Aliteralis a variablexor a negated variable¬x. Ifxis a variable we letvar(x)=var(¬x)=x. Aclauseis a finite set of literals. For a clausecwe definevar(c)= {var(l)|lc}. If a clause contains a literal negated as well as unnegated it istautological. Aconjunctive normal form (CNF) is a finite set of non-tautological clauses. IfF is a CNF formula we letvar(F ) =

cFvar(c). Thesize of a clause cis |c|, and the size of a CNFF issize(F ) =

cF|c|. Anassignmentis a mappingf:X→ {0,1}, whereXX. We identify

f with the set{¬x|xX, f (x)=0} ∪ {x|xX, f (x)=1}. An assignmentf satisfiesa clauseciffc= ∅; for a CNFF, we letF[f]denote the CNF containing the clauses inF not satisfied byf, restricted to variables inX \var(f ), that is, F[f] = {c\ {x,¬x|x∈var(f )} |cF, fc= ∅}; then,f satisfiesF ifF[f] =

∅, that is, if it satisfies all clauses inF. IfF is a CNF withvar(F )= {x1, . . . , xn}we

define the Boolean functionF (x1, . . . , xn)computed byF asF (b1, . . . , bn)=1 if

and only if the assignmentf(b1,...,bn) :var(F )→ {0,1}given byf(b1,...,bn)(xi)=bi satisfies the CNFF.

Binary Decision Diagrams A binary decision diagram (BDD) D on variables {x1, . . . , xn}is a labelled directed acyclic graph satisfying the following conditions:

Dhas at at most two vertices without outgoing edges, called sinksofD. Sinks of Dare labelled with 0 or 1; if there are exactly two sinks, one is labelled with 0 and the other is labelled with 1. Moreover,Dhas exactly one vertex without incoming edges, called thesourceofD. Each non-sink node ofDis labelled by a variablexi,

and has exactly two outgoing edges, one labelled 0 and the other labelled 1. Each nodev ofD represents a Boolean functionFv = Fv(x1, . . . , xn)in the following


(b1, . . . , bn)activatesan outgoing edge ofwlabelled withb∈ {0,1}ifbi =b. Since

(b1, . . . , bn)activates exactly one outgoing edge of each non-sink node, there is a

unique sink that can be reached fromvalong edges activated by(b1, . . . , bn). We let

Fv(b1, . . . , bn)=b, whereb∈ {0,1}is the label of this sink. The functioncomputed

byDisFs, wheresdenotes the (unique) source node ofD. Thesizeof a BDD is the

number of its nodes.

Anordering σ of a set{x1, . . . , xn}is a total order on{x1, . . . , xn}. If σ is an

ordering of {x1, . . . , xn} we let var(σ ) = {x1, . . . , xn}. Letσ be the ordering of {x1, . . . , xn}given byxi1< xi2<· · ·< xin. For every integer 0< jn, thelength

jprefixofσis the ordering of{xi1, . . . , xij}given byxi1<· · ·< xij. Aprefixofσis a lengthjprefix ofσfor some integer 0< jn. For orderingsσ =xi1<· · ·< xin of{x1, . . . , xn}andρ = yi1 < · · · < yim of{y1, . . . , ym}, we let σρ denote the ordering of{x1, . . . , xn, y1, . . . , ym}given byxi1 <· · ·< xin < yi1 < · · ·< yim. LetDbe a BDD on variables{x1, . . . , xn}and letσ =xi1<· · ·< xinbe an ordering of{x1, . . . , xn}. The BDDDis aσ-ordered binary decision diagram (σ-OBDD) if

xi < xj (with respect toσ) wheneverDcontains an edge from a node labelled with

xi to a node labelled with xj. A BDDD on variables {x1, . . . , xn} is anordered

binary decision diagram (OBDD)if there is an orderingσ of{x1, . . . , xn}such that

Dis aσ-OBDD. For a Boolean functionF =F (x1, . . . , xn), theOBDD sizeofF is

the size of the smallest OBDD on{x1, . . . , xn}computingF.

We say that a classF of CNFs haspolynomial-time compilation into OBDDsif there is a polynomial-time algorithm that, given a CNFFF, returns an OBDD computing the same Boolean function asF. We say that a class F of CNFs has polynomial size compilation into OBDDsif there exists a polynomialp: N → N such that, for all CNFsFF, there exists an OBDD of size at mostp(size(F ))that computes the same function asF.

Graphs For standard graph theoretic terminology, see [10]. LetG = (V , E)be a graph. The(open) neighborhood of W inG, in symbols neigh(W, G), is defined by

neigh(W, G)= {vV \W |there existswWsuch thatvwE}. We freely use neigh(v, G) as a shorthand for neigh({v}, G), and we write neigh(W )instead ofneigh(W, G)if the graphGis clear from the context. A graph G=(V , E)isbipartiteif its vertex setV can be partitioned into two blocksVand Vsuch that, for every edgevwE, we either havevVandwV, orvV andwV. In this case we may writeG=(V, V, E). Theincidencegraph of a CNFF, in symbolsinc(F ), is the bipartite graph(var(F ), F, E)such thatvcEif and only ifv ∈ var(F ),cF, andv ∈var(c); that is, the blocks are the variables and clauses ofF, and a variable is adjacent to a clause if and only if the variable occurs in the clause.

A bipartite graphG=(V , W, E)isleft convexif there exists an orderingσ ofV such that the following holds: ifwvandwvare edges ofGandv < v< v(with respect to the orderingσ) thenwvis an edge ofG. The orderingσis said towitness left convexity ofG. A CNFF isvariable convexifinc(F )=(var(F ), F, E)is left convex.


For an integerd, a CNFF hasdegreedifinc(F )has degree at mostd. A classF of CNFs hasbounded degreeif there exists an integerd such that every CNF inF has degreed.

3 Polynomial Time Compilability

In this section, we introduce thefew subtermsproperty, a sufficient condition for a class of CNFs to admit polynomial size compilation into OBDDs (Section3.1). We prove that the classes of variable convex CNFs and bounded treewidth CNFs have the few subterms property (Sections3.2and3.3). Finally, we establish fixed-parameter tractable size and time OBDD compilation results for CNFs, where the parameter is the deletion distance to a few subterms CNF class (Section3.4).

3.1 The Few Subterms Property

Definition 1(Subterm width) LetF be a CNF formula and letV ⊆ var(F ). The set ofV- subterms ofF is defined

st(F, V )= {F[f] |f:V → {0,1}}.

Given an orderingσ ofvar(F ), thesubtermwidth ofF with respect toσ is stw(F, σ )=max{|st(F,var(π ))| |πis a prefix ofσ}.

Thesubterm widthofF is the minimum subterm width ofF with respect to an ordering ofvar(F ).

We now state a few simple properties of subterms that will be used throughout the paper. LetV be a set of variables and letF be a CNF.

1. Trivially,|st(F, V )| ≤2|V|.

2. EachV-subterm ofF is the restriction of a subset ofF, so|st(F, V )| ≤2|F|. 3. IfF = FF thenF[f] = F[f] ∪F[f]for every variable assignment

f :V → {0,1}, so|st(F, V )| ≤ |st(F, V )| · |st(F, V )|.

Definition 2 (Subterm Bound) Let F be a class of CNF formulas. A function b: N → Nis asubterm boundofF if, for allFF, the subterm width ofF is bounded from above byb(size(F )). Letb:N → Nbe a subterm bound of F, let FF, and letσbe an ordering ofvar(F ). We callσ awitnessof the subterm bound bwith respect toF ifstw(F, σ )b(size(F )).

Definition 3(Few Subterms) A classFof CNF formulas hasfew subtermsif it has a polynomial subterm boundp: N→N; if, in addition, for allFF, an ordering σofvar(F )witnessingpwith respect toF can be computed in polynomial time,F is said to haveconstructive few subterms.


The few subterms property naturally presents itself as a sufficient condition for a polynomial size construction of OBDDs from CNFs.

Theorem 4 There exists an algorithm that, given a CNF F and an ordering σ ofvar(F ), returns a σ-OBDD for F of size at most |var(F )| ·stw(F, σ ) in time polynomial in|var(F )|andstw(F, σ ).

Proof LetF be a CNF and σ = x1 < · · · < xn be an ordering of var(F ). The

algorithm computes aσ-OBDDDforF as follows.

At stepi =1, create the source ofD, labelled byF, at level 0 of the diagram; if ∅ ∈F (respectively,F = ∅), then identify the source with the 0-sink (respectively, 1-sink) of the diagram, otherwise make the source anx1-node.

At stepi+1 fori=1, . . . , n−1, letv1, . . . , vlbe thexi-nodes at leveli−1 of the

diagram, respectively labelledF1, . . . , Fl. Forj =1, . . . , landb =0,1, compute

Fj[xi =b], wherexi =bdenotes the assignmentf: {xi} → {0,1}mappingxito

b. IfFj[xi =b]is equal to some label of anxi+1-nodevalready created at leveli, then direct theb-edge leaving thexi-node labelledFj tov; otherwise, create a new

xi+1-nodevat leveli, labelledFj[xi=b], and direct theb-edge leaving thexi-node

labelledFj tov. If∅ ∈ Fj[xi = b], then identifyv with the 0-sink ofD, and if ∅ =Fj[xi=b], then identifyvwith the 1-sink ofD.

At termination, the diagram obtained computesF and respects σ. We analyze the runtime. At stepi+1 (0 ≤ i < n), the nodes created at leveli are labelled by CNFs of the formF[f], where f ranges over all assignments of {x1, . . . , xi}

not falsifyingF; that is, these nodes correspond exactly to the{x1, . . . , xi}-subterms st(F,{x1, . . . , xi})ofF not containing the empty clause, whose number is bounded

above bystw(F, σ ). As leveliis processed in time bounded above by its size times the size of leveli−1, and|var(F )|levels are processed, the diagramDhas size at most|var(F )| ·stw(F, σ )and is constructed in time bounded above by a polynomial in|var(F )|andstw(F, σ ).

Corollary 5 A class of CNFs with the constructive few subterms property admits polynomial time compilation into OBDDs.

Proof LetF be a class of CNF formulas with constructive few subterms and let p:N → Nbe a polynomial subterm bound of F. The algorithm, given a CNFF, computes in polynomial time an ordering ofvar(F )witnessingpwith respect toF, and invokes the algorithm of Theorem 4, which runs in time polynomial in|var(F )| andstw(F, σ ). Since stw(F, σ )p(size(F )) the overall runtime is polynomial insize(F ).

3.2 Variable Convex CNF formulas

In this section, we prove that the class of variable convex CNFs has the constructive few subterms property (Lemma 6), and hence admits polynomial time compilation into OBDDs (Theorem 7); as a special case, CNFs whose incidence graphs are cographs admit polynomial time compilation into OBDDs (Example 8).


Lemma 6 The classF of variable convex CNFs has the constructive few subterms property.

Proof LetFF, so thatinc(F )is left convex, and letσ be an ordering ofvar(F ) witnessing the left convexity ofinc(F ). Letπbe any prefix ofσ. Call a clausecF π-activeinF ifvar(c)∩var(π ) = ∅andvar(c)(var(F )\var(π )) = ∅. LetA denote the set ofπ-active clauses ofF. For allcA, letvarπ(c)=var(c)∩var(π ).

Claim Letc, cA. Then,varπ(c)⊆varπ(c)orvarπ(c)⊆varπ(c).

Proof of Claim Letc, cA. Assume for a contradiction that the statement does not hold, that is, there exist variablesv, v ∈ var(π ),v = v, such thatv ∈ varπ(c)\ varπ(c)andv ∈ varπ(c)\varπ(c). Assume thatσ (v) < σ (v); the other case is

symmetric. Sincecisπ-active, by definition there exists a variablew ∈ var(F )\

var(π )such that w ∈ var(c). It follows that σ (v) < σ (w). Therefore, we have σ (v) < σ (v) < σ (w), wherev, w ∈ var(c)andv ∈var(c), contradicting the fact thatσwitnesses the left convexity ofinc(F ).

We now argue that there is a functiongwith domainAsuch that the image ofA undergcontains the set{A[f]|f does not satisfyA}of terms induced by assignments not satisfyingA. LetL = {x,¬x|x ∈var(π )}denote the set of literals associated with variables invar(π ). The functiongis defined as follows. ForcA, we let

g(c)= {c\L|cA, cLcL}.

Letf :var(π )→ {0,1}be an assignment that does not satisfyA. LetcAbe a clause not satisfied byf such thatvarπ(c)is maximal with respect to inclusion. We

claim thatg(c)=A[f]. To see this, letcAbe an arbitrary clause. It follows from the claim proved above that eithervarπ(c)varπ(c)orvarπ(c)⊆varπ(c). In the

first case,cis satisfied by choice ofc. In the second case,cis not satisfied byf if and only ifcLcL. The formulaA[f]is precisely the set of clauses inA not satisfied byf, restricted to variables not invar(π ), sog(c)=A[f]as claimed. Taking into account that an assignment might satisfyA, this implies

|st(A,var(π ))| ≤ |A| +1≤size(F )+1.

LetA = {cF |var(c) ⊆ var(π )}andA = {cF |var(c)∩var(π )= ∅}, so thatF = AAA. For every assignment f : var(π ) → {0,1}we have A[f] =Aand eitherA[f] = ∅orA[f] = {∅}, so the number of subterms ofF under assignments tovar(π )is bounded as

|st(F,var(π ))| ≤2·(size(F )+1).

This proves that the class of variable convex CNFs has few subterms. Moreover, an ordering witnessing the left convexity ofinc(F )can be computed in polynomial (even linear) time [4,19], so the class of variable convex CNFs even has the constructive few subterms property.

Theorem 7 The class of variable convex CNF formulas has polynomial time compilation into OBDDs.


Proof Immediate from Corollary 5 and Lemma 6.

Example 8(Bipartite Cographs) Let F be a CNF such that inc(F ) is a cograph. Note that inc(F ) is a complete bipartite graph. Indeed, cographs are character-ized as graphs of clique-width at most 2 [7], and it is readily verified that if a bipartite graph has clique-width at most 2, then it is a complete bipartite graph. A complete bipartite graph is trivially left convex. Then Theorem 7 implies that CNFs whose incidence graphs are cographs have polynomial time compilation into OBDDs.

3.3 Bounded Treewidth CNF Formulas

In this section, we prove that if a class of CNFs hasbounded treewidth, then it has the constructive few subterms property (Lemma 10), and hence admits polynomial time compilation into OBDDs (Theorem 11).

LetGbe a graph. Atree decomposition ofGis a tripleT = (T , χ , r), where T =(V (T ), E(T ))is a tree rooted atrandχ :V (T )→ 2V (G)is a labeling of the vertices ofT by subsets ofV (G)(calledbags) such that

1. tV (T )χ (t)=V (G),

2. for each edgeuvE(G), there is a nodetV (T )with{u, v} ⊆χ (t), and 3. for each vertexvV (G), the set of nodest withvχ (t)forms a connected

subtree ofT.

The width of a tree decomposition (T , χ , r) is the size of a largest bag χ (t) minus 1. ThetreewidthofGis the minimum width of a tree decomposition ofG. The pathwidthofGis the minimum width of a tree decomposition(T , χ , r)such thatT is a path.

LetF be a CNF. We say thatinc(F )=(var(F ), F, E)has treewidth (respectively, pathwidth)k if the graph(var(F )F, E) has treewidth (respectively, pathwidth) k. We identify the pathwidth (respectively, treewidth) of a CNF with the pathwidth (respectively, treewidth) of its incidence graph.

LetF be a CNF formula. Ifinc(F )has pathwidthk, then an orderingσ ofvar(F ) is called aforget orderingforF if, with respect to an arbitrary linearization of some path decomposition of widthkforinc(F ), if the first bag containingvis less than or equal to the first bag containingvwheneverσ (v) < σ (v). A proof of the following lemma already appears, in essence, in works by Ferrara et al. [12, Theorem 2.1] and Razgon [23, Lemma 5].

Lemma 9 LetF be a CNF of pathwidthk−1, and letσbe a forget ordering forF. Thenstw(F, σ )2k+1.

Proof LetFbe a CNF such thatinc(F )has pathwidthk−1, letσbe a forget ordering forF, and letπbe any prefix ofσ.

Let v be the last variable in var(π ) relative to the ordering σ, and let B be the first bag (in the linearization of P) that contains v. A clause cF is calledπ-active in F if var(c)∩var(π ) = ∅ and var(c)(var(F )\var(π )) =


∅. Let ac(F,var(π )) denote the CNF containing the π-active clauses of F. Let

C = ac(F,var(π ))B,

C = {c∈ac(F,var(π ))|cBonly ifB> B inP};

in words,Ccontainsπ-active clauses in the bagB, andCcontainsπ-active clauses occurring only in bags strictly larger thanBin the total order ofP. Clearly,CC=


Claim ac(F,var(π ))=CC.

Proof of Claim First observe that a π-active clause c cannot occur only in bags strictly smaller thanBin the total order ofP. For otherwise, sincevar(c)(var(F )\

var(π ))= ∅, letv ∈ var(c)(var(F )\var(π )); ifBis the first bag that contains v, then BB(by the choice of v), hencev is not contained in any bag strictly smaller thanB, and the edgecvis not witnessed inP, a contradiction.

Thusπ-active clauses either occur inB(including the case where they occur inB and in bags smaller or larger thanBinP), or occur only in bags strictly larger than BinP. Thus,ac(F,var(π ))CC; the other inclusion holds by definition.

From the claim, we get

|st(ac(F,var(π )),var(π ))| ≤ |st(C,var(π ))| · |st(C,var(π ))|;

thus, it suffices to bound above the size of the two sets on the right so that the product of the individual bounds is at most 2k. Letk = |C|. Obviously, we have |st(C,var(π ))| ≤2k. LetV=cCvar(c)∩var(π )and letk= |V|.

Claim VB.

Proof of Claim Letcbe aπ-active clause occurring only in bags strictly larger than BinP. Letv ∈var(c)∩var(π ). By the choice ofvand the properties of the forget orderingσ, it holds that the first bag containingvis less than or equal toB. SinceB is the first bag that containsv, it holds thatvB by the properties ofP (the edge cvis witnessed in a bag strictly larger thanBinP).

Claim |st(C,var(π ))| ≤2k.

Proof of Claim Define an equivalence relation on var(π )-assignments as follows: For allf, f:var(π )→ {0,1},ffif and only if, for allvV,f (v)=f(v). Since|V| = k, the equivalence relation has 2k many equivalence classes.

More-over, if ff, then C[f] = C[f], because var(C)V. The claim follows.

SinceC, VBandCV= ∅, it holds thatk+k= |C| + |V| ≤ |B| ≤k. Hence,


Note thatFis the disjoint union ofac(F,var(π )), clausesDF whose variables are all invar(π ), and clausesDF whose variables are all outsidevar(π ). Also, st(D,var(π ))⊆ {∅,{∅}}, andst(D,var(π ))= {D}. It follows that

|st(F,var(π ))| ≤ |st(ac(F,var(π )),var(π ))| · |st(D,var(π ))| · |st(D,var(π ))|

≤ 2k+1, and the statement is proved.

Lemma 10 Let F be a class of CNFs of bounded treewidth. Then F has the constructive few subterms property.

Proof Letc−1 be the treewidth bound ofFand letFF, so that the treewidth ofinc(F )is at mostc−1. We can compute a widthc−1 tree decomposition of inc(F )in linear time O(size(F ))[3]. From this decomposition, we can compute a path decomposition ofinc(F )of width at most (c−1)·log|var(F )F| ≤ c· log|var(F )F| −1 [2, Corollary 24] and a corresponding forget ordering ofvar(F ) in polynomial time. By Lemma 9, the subterm width ofF with respect toσis at most 2c·log|var(F )F| = |var(F )F|cO(size(F )c). ThusF has a polynomial subterm bound, and a witnessing orderingσ can be computed for eachFFin polynomial time. We conclude thatFhas the constructive few subterms property.

Theorem 11 Let F be a class of CNFs of bounded treewidth. Then, F has polynomial time compilation into OBDDs.

Proof Immediate from Lemma 10 and Corollary 5. 3.4 Almost Few Subterms

In this section, we use the language ofparameterized complexity to formalize the observation that CNF classes “close” to CNF classes with few subterms have “small” OBDD representations [11,13].

LetF be a CNF andDa set of variables and clauses ofF. LetEbe the formula obtained by deletingDfromF, that is,

E= {c\ {lc|var(l)D} |cF \D}; we callDadeletion setofF with respect toE.

The following lemma shows that adding a few variables and clauses does not increase the subterm width of a formula too much.

Lemma 12 LetF andEbe CNFs such that Dis a deletion set ofF with respect toE. Letπ be an ordering ofvar(E)and letσ be an ordering ofvar(F )D. Then stw(F, σ π )2k·stw(E, π ), wherek= |D|.

Proof LetV =D∩var(F )andC =DF, and letk = |V|andk = |C|. Letρ be a prefix ofσ πandX=var(ρ). FromF =C(F \C)we get


By definition,

st(F \C, X)= {(F\C)[f] |f ∈ {0,1}X}. Splitting the assignmentsf into two parts, we can write this as

st(F\C, X)= {(F \C)[f][f] |f∈ {0,1}VX, f∈ {0,1}X\V}. (2) Letf ∈ {0,1}VXbe an assignment. The formulaEis obtained fromF \C by deleting variables inV. It follows that(F \C)[f] ⊆Eand thus

(F \C)[f][f] ⊆E[f] for any assignmentf∈ {0,1}X\V. This yields

|{(F\C)[f][f] |f∈ {0,1}X\V}| ≤ |{E[f] |f∈ {0,1}X\V}|, (3) and the right hand side of this inequality corresponds to|st(E, X\V )|. Combining this with (2), we obtain

|st(F\C, X)| = |{(F\C)[f][f] |f∈ {0,1}VX, f∈ {0,1}X\V}| ≤ 2k|{E[f] |f∈ {0,1}X\V}| =2k· |st(E, X\V )|

≤ 2k·stw(E, π ). Inserting into (1), we get

|st(F, X)| ≤ |st(C, X)| · |st(F \C, X)| ≤2k·2k·stw(E, π )=2k·stw(E, π ), and the lemma is proved.

In this section, the standard of efficiency we appeal to comes from the frame-work ofparameterized complexity [11,13]. The parameter we consider is defined as follows. LetF be a class of CNF formulas. We say thatFisclosed under vari-able and clause deletionifEF wheneverEis obtained by deleting variables or clauses fromFF. LetF be a CNF class closed under variable and clause dele-tion. TheF-deletion distance ofF is the minimum size of a deletion set ofF from any EF. AnF-deletion set of F is a deletion set ofF with respect to some EF.

Let F be a class of CNF formulas with few subterms closed under variable and clause deletion. We say that CNFs havefixed-parameter tractable OBDD size, parameterized byF-deletion distance, if there is a computable functionf :N→N and a polynomialp : N → Nsuch that a CNFF withF-deletion distance k has OBDD size at mostf (k) p(size(F )).

Theorem 13 Let F be a class of CNF formulas with few subterms closed under variable and clause deletion. CNFs have fixed-parameter tractable OBDD size, parameterized byF-deletion distance.

Proof LetF be a class of CNF formulas with few subterms closed under variable and clause deletion. SinceFhas few subterms, it has a polynomial subterm bound p : N→ N. Letkbe theF-deletion distance ofF. LetEF be a formula such that the deletion distance ofF fromEisk, and letDa deletion set ofF with respect


toE. Letπ be an ordering ofvar(E)witnessingp forE, and letσ be an ordering ofvar(F )D. By Lemma 12, the subterm width ofF with respect toρ =σ π is at most 2kp(size(E)), so by Theorem 4 there is aρ-OBDD forF of size at most 2kp(size(E))|var(F )|.

The requirement thatFbe closed under variable and clause deletion ensures that the deletion distance fromFis defined for every CNF. For our purposes, this can be assumed without loss of generality, as it is readily verified that ifFhas few subterms with polynomial subterm boundp : N→ N, then the closure ofF under variable and clause deletion has few subterms with the same polynomial subterm bound.

Analogously, we say that CNFs havefixed-parameter tractable time computable OBDDs(respectively,F-deletion sets), parameterized byF-deletion distance, if an OBDD (respectively, aF-deletion set) for a given CNFF ofF-deletion distancek is computable in timef (k) p(size(F )).

Theorem 14 LetF be a class of CNFs closed under variable and clause deletion satisfying the following:

Fhas the constructive few subterms property.

CNFs have fixed-parameter tractable time computableF-deletion sets, parame-terized byF-deletion distance.

Then CNFs have fixed-parameter tractable time computable OBDDs, parameterized byF-deletion distance.

Proof Given an input formulaF, the algorithm first computes a smallestF-deletion setD ofF. LetE be the formula obtained fromF by deletingD. The algorithm computes a variable orderingπ ofE witnessing a polynomial subterm boundp :

N→NofF. SinceFhas the constructive few subterms property, this can be done in polynomial time. Next, the algorithm chooses an arbitrary orderingσ ofvar(F )D. By Lemma 12 we havestw(F, σ π )≤ 2|D|stw(E, π ) 2k p(size(E)), wherekis

theF-deletion distance ofF. Invoking the algorithm of Theorem 4, our algorithm computes and returns an OBDD forF in time polynomial in 2kp(size(E))|var(F )|. Sincesize(E)≤size(F )there is a polynomialq :N→N(independent ofF) such that the last expression is bounded by 2kq(size(F )).

Corollary 15(Feedback Vertex Set) LetFbe the class of formulas whose incidence graphs are forests. CNFs have fixed-parameter tractable time computable OBDDs parameterized byF-deletion distance.

Proof Given a graphG=(V , E), a setDV is called afeedback vertex setofGif the graphG\Dis a forest; here,G\Dis the graph(V\D, E)such thatvwEif and only ifvwEandv, wV\D. For any CNFF, a subsetDof its variables and clauses is a feedback vertex set of the incidence graphinc(F )if and only if it is aF -deletion set, so a smallest feedback vertex set ofinc(F )is a smallestF-deletion set. There is a fixed-parameter tractable algorithm that, given a graphGand a parameter k, computes a feedback vertex setDofGsuch that|D| ≤kor reports that no such set


exists [6]. It follows that there is a fixed-parameter tractable algorithm, parameterized by theF-deletion distance, for computing a smallestF-deletion set of an input CNF. Moreover, the incidence graphs of formulas inF have treewidth 1, so F has the constructive few subterms property by Lemma 10. Clearly,Fis closed under variable and clause deletion. Hence, applying Theorem 14, we conclude that CNFs have fixed-parameter tractable time computable OBDDs fixed-parameterized byF-deletion distance.

4 Polynomial Size Incompilability

In this section, we introduce thesubfunction widthof a graph CNF, to which the OBDD size of the graph CNF is exponentially related (Section4.1), and prove that expander graphsyield classes of graph CNFs ofbounded degreewith linear subfunc-tion width, thus obtaining an exponential lower bound on the OBDD size for graph CNFs in such classes (Section4.2).

4.1 Many Subfunctions

In this section, we introduce thesubfunction widthof a graph CNF (Definition 16), and prove that the OBDD size of a graph CNF is bounded below by an exponential function of its subfunction width (Theorem 17).

Agraph CNF is a CNF F such thatF = {{u, v} | uvE}for some graph G=(V , E)without isolated vertices.

Definition 16(Subfunction Width) Let F be a graph CNF. Letσ be an ordering ofvar(F )and letπ be a prefix ofσ. We say that a subset{c1, . . . , ce}of clauses in

F issubfunction productiverelative to π if there exist{a1, . . . , ae} ⊆ var(π )and {u1, . . . , ue} ⊆ var(F )\var(π )such that for alli, j ∈ {1, . . . , e},i = j, and all


ci= {ai, ui};

c= {ai, aj}andc= {ai, uj}.

Thesubfunction widthofF, in symbolssfw(F ), is defined by sfw(F )=min

σ maxπ {|M| |Mis subfunction productive relative toπ},

whereσ ranges over all orderings ofvar(F )andπranges over all prefixes ofσ. Intuitively, in the graphGunderlying the graph CNFF in Definition 16, there is a matching of the formaiuiwithai∈var(π )andui∈var(F )\var(π ),i∈ {1, . . . , e};

such a matching is “almost” induced, in thatGcan contain edges of the formuiuj,

but no edges of the formaiaj oraiuj,i, j∈ {1, . . . , e},i=j.


Proof LetF be a graph CNF. LetDbe any OBDD computingF, letσbe the order-ing ofvar(F )respected byD, and letπ be a prefix ofσ such that{c1, . . . , ce} ⊆F

is subfunction productive relative toσ andπ ande ≥ sfw(F ). Let{a1, . . . , ae} ⊆ var(π )and{u1, . . . , ue} ⊆var(F )\var(π )be as in Definition 16, so that in particular

ci= {ai, ui},i∈ {1, . . . , e}. Let

L= {f: var(π )→ {0,1} |f (v)=1 for allv∈ {a1, . . . , ae}}; (4)

in words,Lis the set containing, for each assignment of{a1, . . . , ae}, its extension

tovar(π )that sends all variables invar(π )\ {a1, . . . , ae}to 1.

Claim LetfLand letcF be such thatc⊆var(π ). Then,f satisfiesc. Proof of Claim Otherwise, sinceF is a graph CNF and by (4) the only variables sent to 0 byfare in{a1, . . . , ae}, it is the case thatc= {ai, aj}for somei, j ∈ {1, . . . , e},

i=j, which is impossible by the second item in Definition 16.

Claim Letf andgbe distinct assignments in L. Then, f andglead to different nodes inD.

Proof of Claim Letf andgbe distinct assignments inL. By the previous claim,f andg satisfy each clause inF whose variables are contained invar(π ). Thus, the computation paths activated byf andginDlead to some nodes inDdistinct from the 0-sink ofD.

Sincef andg are distinct assignments inL, they differ on at least one variable in{a1, . . . , ae}; say without loss of generality thatf (a1) = 0 = 1 = g(a1). Let

h:var(F )\var(π )→ {0,1}be such thath(v)=0 if and only ifv=u1. We show that thatfhdoes not satisfyF, butghsatisfiesF; it follows thatf andglead to different nodes inD.

Clearly,fhdoes not satisfyF, because by Definition 16 the clausec1= {a1, u1} is inF, and by construction f (a1) = h(u1) = 0. We show that gh


LetcF. Ifc⊆var(π ), thengsatisfiescby the previous claim. Ifc⊆var(F )\

var(π ), thenhsatisfiesc, becauseccontains two distinct variables, hence at least one of its variables differs fromu1and is assigned to 1 byh. Otherwise,c∩var(π )= ∅ andc(var(F )\var(π )) = ∅. Ifccontains a variable invar(F )\var(π )distinct fromu1, thenhsatisfiesc. Otherwise,c= {a, u1}for somea∈var(π ). In this case, ifa ∈ {a1, . . . , ae}, thena= a1by Definition 16, andgsatisfiescviag(a1)=1. Else,a ∈ var(π )\ {a1, . . . , ae}and by definition ofLwe haveg(a) = 1, so that


It is readily observed that|L| = 2e. Then, by the above claims, the computation paths activated by the assignments inLlead to 2edifferent nodes inD. We observed thate≥sfw(F ). ThenDhas size at least 2sfw(F ). It follows that the OBDD size ofF is at least 2sfw(F ).


4.2 Bounded Degree

In this section, we use the existence of a family of expander graphs to obtain a class of graph CNFs with linear subfunction width (Lemma 18), thus obtaining an exponential lower bound on the OBDD size of a class of CNFs ofbounded degree (Theorem 19).

Letnanddbe positive integers,d≥3, and let <1 be a positive real. A graph G=(V , E)is a(n, d, )-expanderifGhasnvertices, degree at mostd, and for all subsetsWV such that|W| ≤n/2, the inequality

|neigh(W )| ≥|W| (5) holds. It is known that for all integersd≥3, there exists a real 0< , and a sequence

{Gi|i∈N} (6)

such thatGi=(Vi, Ei)is an(ni, d, )-expander (i∈N), andnitends to infinity as

itends to infinity [1, Section 9.2].

Lemma 18 LetF be a graph CNF whose underlying graph is an(n, d, )-expander, wheren≥2, >0, andd≥3. Then

sfw(F )

16d n.

Proof Letσ be any ordering ofvar(F )and letπbe the lengthn/2prefix ofσ. Claim There exists a subset{c1, . . . , cl}of clauses of F, subfunction productive

relative toπ, such thatl16dn.

Proof of Claim We will construct a sequence(a1, b1), . . . , (al, bl)of pairs(ai, bi)∈ var(π )×(var(F )\var(π )) of vertices such that ai/ neigh(aj), and such that {ai, bj} ∈F if and only ifi=j, for 1≤i, jl. Lettingci= {ai, bi}for 1≤il,

this yields a set{c1, . . . , cl}of clauses that are subfunction productive relative to

π. Assume we have chosen a (possibly empty) sequence (a1, b1), . . . , (aj, bj)of

such pairs. For a vertexvin the underlying graph ofF, letN[v] = {v} ∪neigh(v) denote its solid neighborhood. LetV =ji=1(N[ai] ∪N[bi])andA=var(π )\V.

Then |A| ≤ n/2 and we can use the expansion property (5) to conclude that |neigh(A)| ≥|A|. LetB =neigh(A)\V. If bothAandB are nonempty we pick (aj+1, bj+1)A×Bso thataj+1bj+1is an edge. We haveA⊆var(π )as well as

B⊆var(F )\(AV )⊆var(F )\var(π ), so(aj+1, bj+1)∈var(π )×(var(F )\var(π )). By construction, {aj+1, bj+1} is a clause in F; moreover, ai/ neigh(bj+1) as well as bi/ neigh(aj+1), for 1 ≤ ij. We conclude that the sequence

(a1, b1), . . . , (aj+1, bj+1)has the desired properties. Otherwise, if either of the sets

AorBis empty, we stop.

We now give a lower bound on the length l of a sequence constructed in this manner. Let(a1, b1), . . . , (aj, bj)be such that one of the setsAandBas defined in


graph is bounded byd, we have|V| ≤2dj and|A| ≥ n/2 −2dj. IfAis empty, we must have 2djn/2and thus

jn 2 1 2dn−1 4dn 8d, (7)

where the last inequality follows fromn ≥ 2. Now supposeB is empty. We have |B| ≥|A| − |V|, so

0≥(n/2 −2dj )−2dj=(n/2)−2dj (1+). From this, we get

j(n−1) 4d(1+)(n−1) 8dn 16d. (8)

Here, the last inequality again follows fromn≥2. Recalling that <1 and taking the minimum of the bounds in (7) and (8), we obtain the lower bound stated in the claim.

The lemma is an immediate consequence of the above claim.

Theorem 19 There exist a classFof CNF formulas and a constantc >0such that, for everyFF, the OBDD size ofF is at least2c·size(F ). In fact,F is a class of read 3 times, monotone, 2-CNF formulas.

Proof LetG = {Gi | i ∈ N}be a family of graphs as in (6), so that for alli ∈ N

the graph Gi = (Vi, Ei)is a (ni, d, )-expander (ni ≥ 2, d = 3, > 0) and

ni → ∞asi → ∞. Using the expansion property, it is readily verified that each

graph inG is connected; in particular, it does not have isolated vertices. Therefore F= {Ei:i∈N}is a class of graph CNFs; in fact, a class of read 3 times, monotone,

2-CNF formulas. By Lemma 18 eachFFsatisfies sfw(F )

16d |var(F )|.

Since the underlying graph ofF has degree at mostdand|var(F )|vertices, the formula F contains at most d|var(F )| clauses (each variable occurs in at most d clauses), and each clause contains at most 2 literals. That is, 2d|var(F )| ≥ sizeF, and thus sfw(F ) 16d |var(F )| = 32d2 2d|var(F )| ≥ 32d2sizeF.

Settingc = /32d2, it follows from Theorem 17 that the OBDD size ofF is at least 2c·|sizeF|.

5 Conclusion

In closing, we briefly explain why completing the classification task laid out in this paper (and thus closing the gap depicted in Fig.1) seems to require new ideas.


On the one hand, our upper bound for variable convex CNFs appears to push the few subterms property to its limits – natural variable orderings cannot be used to witness few subterms for (clause) convex CNFs and CNF classes of bounded clique-width. On the other hand, our lower bound technique based on expander graphs essentially requires bounded degree, but the candidate classes for improv-ing lower bounds in our hierarchy, bounded clique-width CNFs and beta acyclic CNFs, have unbounded degree. In both cases, imposing a degree bound leads to classes of bounded treewidth [18] and thus polynomial bounds on the size of OBDD representations.

Acknowledgments Open access funding provided by TU Wien, Vienna, Austria. This research was supported by the European Research Council (Complex Reason, 239962) and the FWF Austrian Science Fund (Parameterized Compilation, P26200).

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, dis-tribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.


1. Alon, N., Spencer, J.H.: The Probabilistic Method. Wiley (2000)

2. Bodlaender, H.L.: A partialk-arboretum of graphs with bounded treewidth. Theor. Comput. Sci.

209(1–2), 1–45 (1998)

3. Bodlaender, H.L., Kloks, T.: Efficient and constructive algorithms for the pathwidth and treewidth of graphs. J. Algorithms21(2), 358–402 (1996)

4. Booth, K.S., Lueker, G.S.: Testing for the consecutive ones property, interval graphs, and graph planarity using pq-tree algorithms. J. Comput. Syst. Sci.13(3), 335–379 (1976)

5. Brault-Baron, J., Capelli, F., Mengel, S.: Understanding model counting forβ-acyclic CNF-formulas. In: Proceedings of STACS (2015)

6. Chen, J., Fomin, F.V., Liu, Y., Lu, S., Villanger, Y.: Improved algorithms for feedback vertex set problems. J. Comput. Syst. Sci.74(7), 1188–1198 (2008)

7. Courcelle, B., Olariu, S.: Upper bounds to the clique-width of graphs. Discr. Appl. Math.101(1–3), 77–114 (2000)

8. Darwiche, A., Marquis, P.: A Knowledge Compilation Map. J. Artif. Intell. Res.17, 229–264 (2002) 9. Devadas, S.: Comparing two-level and ordered binary decision diagram representations of logic

functions. IEEE Trans. Comput. Aided Design12(5), 722–723 (1993) 10. Diestel, R.: Graph Theory. Springer (2000)

11. Downey, R.G., Fellows, M.R.: Fundamentals of Parameterized Complexity. Springer (2013) 12. Ferrara, A., Pan, G., Vardi, M.Y.: Treewidth in verification: Local vs. global. In: Proceedings of LPAR


13. Flum, J., Grohe, M.: Parameterized Complexity Theory. Springer (2006)

14. Gallo, G.: AnO(nlogn)algorithm for the convex bipartite matching problem. Oper. Res. Lett.3(1), 31–34 (1984)

15. Glover, F.: Maximum matching in a convex bipartite graph. Naval Res. Logis. Q.14(3), 313–316 (1967)

16. Hoory, S., Linial, N., Wigderson, A.: Expander graphs and their applications. Bull. Am. Math. Soc.

43(4), 439–561 (2006)

17. Jukna, S.: Boolean Function Complexity - Advances and Frontiers. Springer (2012)

18. Kaminski, M., Lozin, V.V., Milanic, M.: Recent developments on graphs of bounded clique-width. Discr. Appl. Math.157(12), 2747–2761 (2009)


19. K¨obler, J., Kuhnert, S., Laubner, B., Verbitsky, O.: Interval graphs: Canonical representations in logspace. SIAM J. Comput.40(5), 1292–1315 (2011)

20. Lozin, V., Rautenbach, D.: Chordal bipartite graphs of bounded tree- and clique-width. Discrete Math.

283(1–3), 151–158 (2004)

21. Lubotzky, A.: Expander graphs in pure and applied mathematics. Bull. Am. Math. Soc.49(1), 113– 162 (2012)

22. Oztok, U., Darwiche, A.: CV-width: A new complexity parameter for CNFs. In: Proceedings of ECAI (2014)

23. Razgon, I.: On OBDDs for CNFs of bounded treewidth. In: Proceedings of KR (2014)

24. Steiner, G., Yeomans, S.: Level schedules for mixed-model, just-in-time processes. Manag. Sci.39(6), 728–735 (1993)


Fig. 1 The diagram depicts a hierarchy of classes of bipartite graphs under the inclusion relation (thin edges)
Fig. 1 The diagram depicts a hierarchy of classes of bipartite graphs under the inclusion relation (thin edges) p.2


Related subjects :