• Aucun résultat trouvé

Knowledge Compilation for Model Counting: Affine Decision Trees

N/A
N/A
Protected

Academic year: 2022

Partager "Knowledge Compilation for Model Counting: Affine Decision Trees"

Copied!
10
0
0

Texte intégral

(1)

Knowledge Compilation for Model Counting: Affine Decision Trees

Fr´ed´eric Koriche

1

, Jean-Marie Lagniez

2

, Pierre Marquis

1

, Samuel Thomas

1

1

CRIL-CNRS, Universit´e d’Artois, Lens, France

2

FMV, Johannes Kepler University, Linz, Austria

{koriche,marquis,thomas}@cril.fr [email protected]

Abstract

Counting the models of a propositional formula is a key issue for a number of AI problems, but few propositional languages offer the possibility to count models efficiently. In order to fill the gap, we introduce the language EADTof (extended) affine decision trees. An extended affine decision tree simply is a tree with affine decision nodes and some specific decomposable conjunction or disjunction nodes. Unlike standard decision trees, the deci- sion nodes of anEADTformula are not labeled by variables but by affine clauses. We study EADT, and several subsets of it along the lines of the knowledge compilation map. We also describe a CNF-to-EADT compiler and present some experi- mental results. Those results show that theEADT compilation-based approach is competitive with (and in some cases is able to outperform) the model counter Cachet and the d-DNNF compilation- based approach to model counting.

1 Introduction

Model counting is a key issue in a number of AI prob- lems, including inference in Bayesian networks and contin- gency planning [Littmanet al., 2001; Bacchuset al., 2003;

Sanget al., 2005; Darwiche, 2009]. However, this problem is computationally hard (#P-complete) [Valiant, 1979]. Ac- cordingly, few propositional languages offer the possibility to count modelsexactlyin an efficient way [Roth, 1996].

The knowledge compilation (KC) map, introduced by Dar- wiche and Marquis [2002] and enriched by several authors (see among others [Wachter and Haenni, 2006; Subbarayanet al., 2007; Mateescuet al., 2008; Fargier and Marquis, 2008;

Darwiche, 2011; Marquis, 2011; Bordeaux et al., 2012]) is a multi criteria evaluation of languages, where languages are compared according to the queries and the transformations they support in polynomial time, as well as their relative suc- cinctness (i.e., their ability to represent information using lit- tle space).

This work is partially supported by FWF, NFN Grant S11408- N23 (RiSE), and by the project BR4CP ANR-11-BS02-008 of the French National Agency for Research.

Among the languages which have been studied and clas- sified according to the KC map, only the languaged-DNNF of formulae in deterministic decomposable negation normal form [Darwiche, 2001], together with is subsets OBDD<

[Bryant, 1986],FBDD[Gergov and Meinel, 1994], andSDD [Darwiche, 2011], satisfy the CTquery (model counting).

Yet, another interesting language which satisfiesCTisAFF, the set of all affine formulae [Schaefer, 1978], defined as fi- nite conjunctions of affine clauses (aka XOR-clauses). Un- fortunately, AFFis not acomplete language, because some propositional formulae (e.g. the clausex∨y) cannot be rep- resented into conjunctions of affine clauses.

By coupling ideas from affine formulae and decision trees, this paper introduces a new family of propositional languages that are complete and satisfyCT. The blueprint of our fam- ily is the class EADTof extended affine decision trees. In essence, an extended affine decision tree is a tree with deci- sion nodes and some specific decomposable conjunction or disjunction nodes. Unlike usual decision trees, the decision nodes in anEADTare labeled by affine clauses instead of vari- ables. Our family covers several subsets ofEADT, including ADT(the set of affine decision trees where conjunction or dis- junction nodes are prohibited),EDT(the set of extended de- cision trees where decomposable conjunction or disjunction nodes are allowed but decision nodes are mainly restricted to standard ones), andDT, the intersection ofADTandEDT.

Following the lines of the KC map, we prove that ADT and its subclassDTsatisfy all queries and transformations of- fered by ordered binary decision diagrams (OBDD<). Analo- gously,EADTand its subclassEDTsatisfy all queries offered byd-DNNFand more transformations (¬Cis not satisfied by d-DNNF). Importantly, we also show that none ofOBDD<, CNF, andDNFis at least as succinct as any ofADTorEADT, and thatEADTis strictly more succinct thanADT.

Finally, we describe aCNF-to-EADTcompiler (which can be downsized to a compiler targetingADT,EDTorDT). We used this program to compile a number of benchmarks from different domains. This empirical evaluation aimed at ad- dressing two practical issues: (1) how challenging is anEADT compilation-based approach to model counting, compared to a direct, uncompiled method using a state-of-the-art model counter? (2) how does theEADTcompilation-based approach perform compared to ad-DNNFcompilation-based method?

Our experimental results show that the EADT compilation-

(2)

based approach is competitive with both methods and, in some cases, it really outperforms them.

The rest of the paper is organized as follows. After in- troducing some background in Section 2,EADTand its sub- sets are defined and examined along the lines of the KC map in Section 3. In Section 4, our compiler is described and, in Section 5, some empirical results are presented and dis- cussed. Finally, Section 6 concludes the paper. The run- time code of our compiler can be downloaded at http:

//www.cril.fr/ADT/

2 Preliminaries

We assume the reader familiar with propositional logic (in- cluding the notions of model, consistency, validity, entail- ment, and equivalence). All languages examined in this study are defined over a finite setPS of Boolean variables, and the constants>(true) and⊥(false).

Affine Formulae. LetPS be a denumerable set of proposi- tional variables. A literal (overPS) is an elementx ∈ PS (a positive literal) or a negated one¬x(a negative literal), or a Boolean constant>(true) or⊥(false). Anaffine clause (aka XOR-clause)δis a finite XOR-disjunction of literals (the XOR connective is denoted by⊕). var(δ)is the set of vari- ables occurring inδ.δisunarywhen it contains precisely one literal. Obviously enough, each affine clause can be rewritten in linear time as asimplifiedaffine clause, i.e., a finite XOR- disjunction of positive literals occurring once in the formula, plus possibly one occurrence of>(just take advantage of the fact that⊕is associative and commutative, and of the equiv- alences¬x ≡ x⊕ >,x⊕x ≡ ⊥,x⊕ ⊥ ≡ x, viewed as rewrite rules, left-to-right oriented). For instance, the affine clause¬x⊕x⊕ ¬y⊕ ¬zcan be turned in linear time into the equivalent simplified affine clausey⊕z⊕ >. Anaffine formulais a finite conjunction of affine clauses.

Knowledge Compilation. For space reasons, we assume the reader has a basic familiarity with the languages CNF, DNF,OBDD<, SDD,BDD, FBDD, d-DNNFT, d-DNNF, and DAG-NNF, which are considered in the following (see [Dar- wiche and Marquis, 2002; Pipatsrisawat and Darwiche, 2008;

Darwiche, 2011] for formal definitions). The basic queries considered in the KC map include tests for consistencyCO, validity VA, implicates (clausal entailment) CE, implicants IM, equivalenceEQ, sentential entailmentSE, model count- ingCT, and model enumerationME. The basic transforma- tions are conditioning (CD), (possibly bounded) closures un- der the connectives (∧C,∧BC,∨C,∨BC,¬C), and forget- ting (FO,SFO).

Finally, letL1andL2be two propositional languages.

• L1 is at least as succinct as L2, denoted L1s L2, iff there exists a polynomial psuch that for every for- mulaφ∈ L2, there exists an equivalent formulaψ∈ L1

where|ψ| ≤p(|φ|).

• L1 is polynomially translatableinto L2, notedL1p

L2, iff there exists a polynomial-time algorithmf such that for everyφ∈ L1,f(φ)∈ L2andf(φ)≡φ.

<sis the asymmetric part of≤s, i.e.,L1<sL2iffL1s

L2andL26≤sL1. WhenL1pL2holds, every query which is supported in polynomial time inL2 also is supported in polynomial time inL1; conversely, every query which is not supported in polynomial time inL1 unless P = NP is not supported in polynomial time inL2, unlessP=NP.

3 The Affine Family

All propositional languages in our family are subsets of the very general language ofaffine decision networks:

Definition 1 ADNis the set of all affine decision networks, defined as single-rooted finite DAGs where leaves are la- beled by a Boolean constant (>or ⊥), and internal nodes are∧nodes or∨nodes (with arbitrarily many children) or affine decision nodes, i.e., binary nodes of the formN = hδ, N, N+iwhereδis the affine clause labelingN andN (resp.N+) is the left (resp. right) child ofN.

The size|∆|of anADNformula∆is the sum of number of arcs in it, plus the cumulated size of the affine clauses used as labels in it. For every nodeNin anADNformula∆,Var(N) is defined inductively as follows:

• ifN is a leaf node, thenVar(N) =∅;

• ifN is an affine decision nodeN =hδ, N, N+i, then Var(N) =var(δ)∪Var(N)∪Var(N+);

• ifNis a∧node (resp.∨node) with childrenN1,. . ., Nk, thenVar(N) =Sk

i=1Var(Ni).

Clearly,Var(∆) =Var(R)(whereRis the root of∆) can be computed in time linear in the size of∆. EveryADN formula∆is interpreted as a propositional formulaI(∆)over Var(∆), whereI(∆) =I(R)is defined inductively as:

• ifN is a leaf node labeled by>(resp.⊥), thenI(N) =

>(resp.⊥);

• ifN is an affine decision nodeN =hδ, N, N+i, then I(N) = ((δ⊕ >)∧I(N))∨(δ∧I(N+));

• ifNis a∧node (resp.∨node) with childrenN1,. . . ,Nk, thenI(N) =Vk

i=1I(Ni)(resp.Wk

i=1I(Ni)).

Finally, k∆k represents the number of models of theADN formula∆overVar(∆).

The DAG-NNF language considered in [Darwiche and Marquis, 2002] is polynomially translatable into a subset of ADN, where decision nodes have leaf nodes as children. In- deed, every leaf node labeled by a positive literal x(resp.

negative literal¬x) in aDAG-NNFformula is equivalent to the affine decision nodeN labeled byδ = xand such that N=⊥(resp.=>) andN+=>(resp.=⊥). Thus,ADN is a highly succinct yet intractable representation language;

especially, it does not satisfy theCTquery unlessP= NP.

To this point, we need to focus on tractable subsets ofADN.

Let us start with the EADT language, a class of tree- structured formulae defined in term of affine decomposability.

Formally, a∧(resp.∨) nodeN with childrenN1, . . . , Nkin anADN∆is said to beaffine decomposableif and only if:

(1) for any i, j ∈ 1,. . . , k, if i 6= j, then Var(Ni) ∩ Var(Nj) =∅, and

(3)

x1⊕x2⊕ ¬x3

∧ x2⊕x4

x1⊕ ¬x4 x5 ⊥ x1⊕x3⊕ ¬x5

> ⊥ ⊥ > > ⊥

Figure 1: AnEADTformula. Every dotted (resp. plain) arc links its sourceN toN(resp. N+). The formula rooted at the node labeled byx2⊕x4is anADTformula.

(2) for every affine decision node N0 of ∆ which is a parent node of N and which is labelled by the affine clause δN0, at most one child Ni of N is such that var(δN0)∩Var(Ni)6=∅.

If only the first condition holds, then the nodeNis said to be (classically) decomposable.

Definition 2 EADTis the set of allextended affine decision trees, defined as finite trees where leaves are labeled by a Boolean constant (>or⊥), and internal nodes are affine de- cision nodes, or affine decomposable∧nodes, or affine de- composable∨nodes.

An example ofEADTformula is given at Figure 1. Some relevant subclasses ofEADTare defined as follows:

Definition 3

• ADTis the set of allaffine decision trees, i.e., the sub- set of EADTconsisting of finite trees where leaves are labeled by a Boolean constant (>or⊥), and internal nodes are affine decision nodes.

• EDT is the set of allextended decision trees, i.e., the subset ofEADTwhere affine decision nodes are labeled by unary affine clauses.1

• DT, the set of all decision trees, is the intersection of ADTandEDT.

Based on this family, it is easy to check that the language TEof all terms and the languageCLof all clauses are linearly translatable intoDT, and hence, into each ofADT,EDT, and EADT. Furthermore, the languageAFFis also polynomially translatable intoADT(hence into its supersetEADT).

In contrast toTE,CL, andAFF, the classDTand its su- persetsADT,EDT, andEADTarecompletepropositional lan- guages. The completeness property also holds for ODT<, which is the subset ofDTconsisting of formulae∆in which every path from the root of∆to a leaf respects the given, to- tal, strict ordering<(i.e., the variables labeling the decision

1The affine decomposability condition can be given up forEDT formulae since everyEDTformula can be translated in linear time into an equivalentEDTformula which is read-once (i.e., for every path from the root of the tree to a leaf, the list of all variables labeling the decision nodes of the path contains at most one occurrence of each variable).

nodes in the path are ordered in a way which is compatible with <). Clearly, ODT< also is a subset ofOBDD< (to be more precise, ODT< is the intersection ofDTandOBDD<), and bothCLandTEare polynomially translatable to it.

We are now in position to explain how anyEADTformula

∆ can be translated in linear time into a tree T(∆)where internal nodes are decomposable∧nodes or decomposable

∨nodes or deterministic binary∨nodes, and the leaves are labeled with affine formulae. The translationT consists in rewriting∆by parsing it in a top-down way, and collecting sets of affine clauses (those sets are the values of an inherited attributeadefined for each nodeN of∆) along the paths of

∆during the translation. T proceeds recursively as follows starting withN =Randa(R) =∅:

• ifN =hδ, N, N+i, thenT(N) = T(N)∨T(N+), a(N) =a(N)∪ {δ⊕ >}, anda(N+) =a(N)∪ {δ};

• if N = Vk

i=1Ni, thenT(N) = Vk

i=1T(Ni), and for everyi ∈ 1, . . . , k,a(Ni) = {δ ∈ a(N) | var(δ)∩ Var(Ni)6=∅};

• if N = Wk

i=1Ni, thenT(N) = Wk

i=1T(Ni), and for everyi ∈ 1, . . . , k,a(Ni) = {δ ∈ a(N) | var(δ)∩ Var(Ni)6=∅};

• ifN =>, thenT(N) =V

δ∈a(N)δ;

• ifN =⊥, thenT(N) =⊥.

By construction, the translationT consists in replacing ev- ery affine decision node by a deterministic binary∨ node, every affine decomposable∧(resp.∨) node by a (classically) decomposable∧(resp. ∨) node. Thus, when∆ is anADT formula,T(∆)simply is a deterministic disjunction of affine formulae, and when∆ is a DT formula, T(∆)simply is a deterministicDNFformula.

With this translation in hand, it is easy to show thatEADT satisfies CT. The proof is by structural induction on φ = T(∆). First,kφkcan be computed in polynomial time when φis an affine formula, sinceφcan be viewed as a finite sys- tem of linear equations modulo 2. Indeed,φcan be turned in polynomial time into its equivalentreduced row echelon form φr, and whenVar(φr)containsnvariables andφrcontains kaffine clauses,kφkis equal to2n−k. This solves the base case. As to the inductive step, it is enough to check that:

• ifφ=Vk

i=1φi(whereV

is a decomposable∧node),

kφk=

k

Y

i=1

ik

• ifφ=Wk

i=1φi(whereWis a decomposable∨node), kφk= 2|Var(φ)|

k

Y

i=1

(2|Var(φi)|− kφik)

• ifφ=φ1∨φ2(where∨is a deterministic∨node), then kφk=kφ1k×2|Var(φ2)\Var(φ1)|+kφ2k×2|Var(φ1)\Var(φ2)|

More generally, our results concerning queries and trans- formations of the KC map are summarized in Proposition 1.

Languagesd-DNNFandOBDD< (which are not subsets of EADT) are reported for the comparison matter.

(4)

L CO VA CE IM EQ SE CT ME

EADT

?

EDT

?

ADT

DT

ODT<

d-DNNF

?

OBDD<

Table 1: Queries.√

means “satisfies” and◦means “does not satisfy unlessP = NP.”

L CD FO SFO ∧C ∧BC ∨C ∨BC ¬C EADT

EDT

ADT

DT

ODT<

d-DNNF

?

OBDD<

Table 2: Transformations. √

means “satisfies,” while ◦ means “does not satisfy unlessP=NP”.

Proposition 1 The results given in Tables 1 and 2 hold.

In a nutshell, ADTand its subclass DT are equivalent to OBDD< with respect to queries and transformations. Simi- larly,EADTand its subclassEDTare essentially equivalent to d-DNNFwith respect to queries and transformations. In par- ticular, EDT,EADT, and d-DNNFdo not satisfySEunless P= NP, and it is unknown whether they satisfyEQ. It is also unknown whetherd-DNNFsatisfies¬C, but this trans- formation can be done in linear time for bothEADTandEDT.

The inclusion graph of the different languages is given in Figure 2. In light of this inclusion graph and the fact thatDT (resp.EDT) does not satisfy more queries or transformations thanADT(resp.EADT), it follows thatDT(resp.EDT) cannot prove a better choice thanADT(resp. EADT) from the KC point of view. This is why we focus onADTandEADTin the following. For these languages, we obtained the following succinctness results:

Proposition 2 CNF6≤sADT,DNF6≤sADT,OBDD<6≤sADT, d-DNNFT 6≤sADT, andEADT<sADT.

Based on these results, it turns out that OBDD< does not dominateADTfrom the KC point of view (i.e., it does not offer any query/transformation not supported byADT, and is not strictly more succinct thanADT). This, together with the fact thatADT⊆EADTimplies thatOBDD< does not domi- nateEADT. Our succinctness results also reveal that none of the ”flat” languagesCNFandDNFis at least as succinct as any ofADTorEADT. Although we ignore howd-DNNFand EADTcompare w.r.t. succinctness, we know that the subclass d-DNNFT does not dominate any ofADTorEADT.

4 A CNF-to-EADT Compiler

A natural approach for compiling an arbitrary propositional formula into anEADTformula is to exploit a generalized form of Shannon expansion. Given two formulae∆andδ, and a variablex, we denote by ∆ |x←δ the formula obtained by

EADT ADT EDT

DT

ODT<

OBDD<

d-DNNFT d-DNNF

Figure 2: Inclusion graph.L1→ L2indicates thatL1⊆ L2.

replacing every occurrence ofxin∆byδ. With this notation in hand, thegeneralized Shannon expansionstates that for every propositional formulae∆ andδand every variablex, we have:

∆≡((x⇔ ¬δ)∧∆|x←¬δ)∨((x⇔δ)∧∆|x←δ) Observe that the standard expansion introduced by Shan- non [1949] is recovered by consideringδ =>. The validity of the generalized expansion comes from the fact that∆ is equivalent to((x⇔ ¬δ)∧∆)∨((x⇔δ)∧∆), and the fact that, for every propositional formulaδ(or its negation), the expression(x⇔δ)∧∆is equivalent to(x⇔δ)∧∆|x←δ. In our setting, ∆ is anECNFformula and δ is an affine clause.ECNF, the language of extendedCNF, is the set of all finite conjunctions of extended clauses, where an extended clause is a finite disjunction of affine clauses. Thus, for in- stance,x1∨(x2⊕x3⊕ >)∨(x1⊕x3)is an extended clause.

Clearly,CNF is linearly translatable intoECNF Now, since x⇔ ¬δis equivalent tox⊕δ, andx ⇔ δis equivalent to x⊕δ⊕ >, the generalized Shannon expansion can be restated as the following branching rule:

∆≡((x⊕δ)∧∆|x←δ⊕>)∨((x⊕δ⊕ >)∧∆|x←δ)

The Compilation Algorithm.Based on previous considera- tions, Algorithm 1 provides the pseudo-code for the compiler eadt, which takes as input anECNFformula∆, and returns as output anEADTformula equivalent to∆. The first two lines deal with the specific cases where∆is valid or unsatisfiable.

In both cases, the corresponding leaf is returned.

We note in passing that the unsatisfiability problem (resp.

the validity problem) forECNFhas the same complexity as for its subsetCNF, i.e., it iscoNP-complete (resp. it is in P). This is obvious for the unsatisfiability problem. For the validity problem, anECNFformula is valid iff every extended clause in it is valid, and an extended clauseδ1∨. . .∨δk(where eachδi,i∈1, . . . , kis an affine clause) is valid iff the affine formula(δ1⊕ >)∧. . .∧(δk⊕ >)is contradictory, which can be tested in polynomial time.

In the remaining case,∆is split into a decomposable con- junction of components∆1,· · ·,∆k(Line 3). These compo- nents are recursively compiled intoEADTformulae and con- joined as a∧node using theaNodefunction. Note that de- composition takes precedence over branching: only when∆ consists of a single component, the compiler chooses an affine clausex⊕δfor which all variables occur in∆(Line 5), and then branches on this clause using the generalized Shannon

(5)

Algorithm 1:eadt(∆) input : anECNFformula∆

output: anEADTformula equivalent to∆ 1 if∆≡ >then returnleaf(>)

2 if∆≡ ⊥then returnleaf(⊥)

3 let∆1,· · ·,∆k be the connected components of∆ 4 ifk >1then returnaNode(eadt(∆1),· · ·,eadt(∆k)) 5 choose a simplified affine clausex⊕δsuch that

var(x⊕δ)⊆Var(∆)

6 returndNode(x⊕δ,eadt(∆|x←δ⊕>),eadt(∆|x←δ))

expansion (Line 6). Here, thedNodefunction returns a deci- sion node labeled with the first argument, having the second argument as left child, and having the third argument as right child. When Line 3 is omitted, theCNF-to-EADTcompiler boils down to aCNF-to-ADTcompiler.

Algorithm 1 is guaranteed to terminate. Indeed, by def- inition of a simplified affine clause, δinx⊕δis an affine clause which does not containx. Since none of∆ |x←δ⊕>

and∆|x←δcontainsx, the steps 5 and 6 can be applied only a finite number of times. Furthermore, theEADT formula returned by the algorithm is guaranteed to satisfy the affine decomposition rule. This property can be proved by induc- tion on the structure of the resulting tree: the only non-trivial case is when the tree consists of a ∧node with parents N and childrenN1,· · ·, NkeachNiformed by callingeadton the connected component∆i of the formula∆. Since each parent clause inN is of the formx⊕δ, wherexis excluded fromδ, and since the components do not share any variable, it follows thatx⊕δoverlaps with at most one component in

1,· · ·,∆k. This, together with the fact that the generalized Shannon expansion is valid, establishes the correctness of the algorithm.

Implementation. Algorithm 1 was implemented on top of the state-of-the-art SAT solver MiniSAT [E´en and S¨orensson, 2003]. We extended MiniSAT to deal with ECNF formu- lae. The heuristic used at Line 5 for choosing affine clauses of the form x⊕δ is based on the concept of variable ac- tivity (VSIDS, Variable State Independent Decaying Sum) [Moskewicz et al., 2001]. Specifically, for each extended clause C of ∆, the score of C is computed as the sum of the scores of each affine clause in it, where the score of an affine clause is the the sum of the VSIDS scores of its vari- ables. Based on this metric, an extended clauseC of∆ of maximal score is selected, and the variables ofCare sorted by decreasing VSIDS score; the selected variablexis the first variable in the resulting list, and the affine clauseδis formed by the nextk−1 variables in the list. Note that selecting all the variables ofx⊕δfrom the same extended clauseC of∆prevents us from generating connections between vari- ables which are not already connected in the constraint graph of∆. We also took advantage of a simple filtering method, which consists in finding implied affine clauses, used only at the first top nodes of the search tree. In our experiments, we

bounded the size of affine clauses tok = 2, and used the filtering method up to depth5.

5 Experiments

Setup. The empirical protocol we followed is very close to the one conducted in [Schrag, 1996] (and other papers). We have considered a number ofCNFbenchmark instances from different domains provided by the SAT LIBrary (www.cs.

ubc.ca/˜hoos/SATLIB/index-ubc.html). For eachCNFinstance∆, we generated 1000 queries; each query is a 3-literal termγthe 3 variables of which are picked up at random from the set of variables of∆, following a uniform distribution; the sign of each literal is also selected at random with probability 12. The objective is to count the number of models of the conditioned formula ∆ | γ for all queriesγ.

Our experiments have been conducted on a Quad-core Intel XEON X5550 with 32Gb of memory. A time-out of 3 hours has been considered for the off-line compilation phase, and a time-out of 3 hours per query has been established for ad- dressing each of the 1000 queries during the on-line phase.

Based on this setup, three approaches have been examined:

• A direct, uncompiled approach: we considered a state-of-the-art model counter, namely Cachet (www.cs.rochester.edu/˜kautz/Cachet/

index.htm) [Sanget al., 2004]. Here, #FCachet is the number of elements ofFCachet, the set of “feasible”

queries, i.e., the queries in the sample for whichCachet has been able to terminate before the time-out (or a segmentation fault).QCachetgives the mean time needed to address the feasible queries, i.e.,

QCachet= 1

#FCachet X

γ∈FCachet

QCachet(∆|γ)

whereQCachet(∆|γ)is the runtime ofCachetfor∆|γ.

• Two compilation-based approaches:d-DNNFandEADT have been targeted. We took advantage of thec2dcom- piler (reasoning.cs.ucla.edu/c2d/) to gener- ate (smooth)d-DNNFcompilations,2and our own com- piler to compute EADT compiled forms. For each L amongd-DNNFandEADT,∆has been first turned into a compiled form∆ ∈ Lduring an off-line phase. The compilation time CL needed to compute ∆ and the mean query-answering time QL have been measured.

We also computed for each approach two ratios:

αL= QL

QCachet andβL=

CL QCachet−QL

Intuitively, αL indicates how much on-line time im- provement is got from compilation: the lower the better.

The quantityβL captures the number of queries needed to amortize compilation time. Clearly, the compilation- based approach targetingLis useful only ifαL<1. By convention,βL= +∞whenαL≥1.

2Primarily, we also planned to use the d-DNNF compiler Dsharp[Muiseet al., 2012] but unfortunately, we encountered the same problems as mentioned in [Voronov, 2013] to run it, which prevented us from doing it.

(6)

Instance Cachet c2d eadt

name #var #cla #F Q C Q α β C Q α β

ais6 61 581 1000 0.531 1.23 4E−5 8E−7 2 0.01 <1E−7 <2E−7 1

ais8 113 1520 866 0.540 3.04 2E−4 3E−4 5 0.24 1E−5 2E−5 1

ais10 181 3151 325 0.578 12.3 1E−3 2E−3 21 7.69 1E−4 2E−4 13

ais12 265 5666 80 0.573 - - - - 410 1E−3 2E−3 717

bmc-ibm-2 2810 11683 1000 0.569 - - - - 0.37 2E−5 4E−5 1

bmc-ibm-3 14930 72106 999 13.04 412 0.93 7E−2 34 180 6E−3 5E−4 13

bmc-ibm-4 28161 139716 1000 5.412 1128 9.09 1.679 +∞ - - - -

bw large.a 459 4675 1000 0.537 15.05 2E−5 4E−5 28 <1E−4 <1E−7 <2E−7 1 bw large.b 1087 13772 1000 0.612 48.88 5E−5 8E−5 79 0.01 <1E−7 <2E−7 1

bw large.c 3016 50457 996 2.452 283.3 1E−4 6E−5 115 0.16 1E−5 4E−6 1

bw large.d 6325 131973 896 31.44 - - - - 1.9 2E−5 6E−7 1

(bw) medium 116 953 1000 0.526 2.39 2E−5 4E−5 4 <1E−4 <1E−7 <2E−7 1 (bw) huge 459 7054 1000 0.543 15.11 2E−5 4E−5 27 <1E−4 <1E−7 <2E−7 1

hanoi4 718 4934 505 0.557 559.6 3E−5 5E−5 1004 0.13 <1E−7 <2E−7 1

hanoi5 1931 14468 440 0.619 2240 8E−5 1E−4 3621 1.1 1E−5 2E−5 1

logistics.a 828 6718 993 1.266 - - - - 6757 2.12 1.676 +∞

ssa7552-038 1501 3575 1000 0.634 20.99 0.042 0.065 35 - - - -

Table 3: Some experimental results

Results. Table 3 presents the obtained results. Each line corresponds to aCNFinstance∆ identified by the leftmost column. The first two columns give respectively the number

#var of variables of∆and the number#cla of clauses of

∆, and the remaining columns give the measured values. The reported computation times are in seconds.

We can observe that both compilation-based approaches typically prove valuable whenever the off-line compilation phase terminates. On the one hand, for each compilation- based approachL, all the 1000 queries have been “feasible”

when the compilation process terminated in due time. For this reason, we did not report in the table the number#FLof fea- sible queries. By contrast, the number of feasible queries for the direct, uncompiled approach is sometimes significantly lower than 1000, and the standard deviation of the on-line query-answering time (not given in the table for space rea- sons) for such queries is often significantly greater than the corresponding deviations measured from compilation-based approaches. On the other hand, the number of queriesβto be considered for balancing the compilation time is finite for all, but two (one ford-DNNFand one forEADT), instances.

Furthermore, the experiments revealed that some instances of significant size are compilable. When the compilation suc- ceeds,βis typically small and, accordingly, on-line time sav- ings of several orders of magnitude can be achieved. Espe- cially, the optimal value1 for the “break-even” pointβ has been reached for many instances when theEADT language was targeted. This means that in many cases the off-line time spend to built theEADTcompiled form is immediately bal- anced by the first counting query. Stated otherwise, theeadt compiler proves also competitive as a model counter.

Finally, our experiments showEADTcompilation challeng- ing with respect tod-DNNFcompilation in many (but not all) cases. When compilation succeeds in both cases, the number of nodes inEADTandd-DNNFformulae are about the same order, but theEADTformulae are slightly faster for process- ing queries, due to their arborescent structure.

6 Conclusion

The propositional languageEADTintroduced in the paper ap- pears as quite appealing for the representation purpose, when CTis a key query. Especially,EADToffers the same queries asd-DNNF, and more transformations (among those consid- ered in the KC map). The subsetADTofEADToffers all the queries and the same transformations as those satisfied by the influentialOBDD<language. Furthermore,OBDD< is not at least as succinct asADT, which showsADTas a possible chal- lenger toOBDD<. In practice, theEADTcompilation-based approach to model counting appears as competitive with the model counterCachetand thed-DNNFcompilation-based approach to model counting.

This work opens a number of perspectives for further re- search. From the theoretical side, a natural extension ofADT is the set of all single-rooted finite DAGs, where leaves are labeled by a Boolean constant (>or ⊥), and internal nodes are affine decision nodes. However, this language is not ap- pealing as a target language for knowledge compilation, be- cause it contains the languageBDD of binary decision dia- grams (alias branching programs) [Bryant, 1986] as a subset andBDD does not offeranyquery from the KC map [Dar- wiche and Marquis, 2002], unlessP=NP. Thus, the problem of finding interesting classes of affine decision graphs that are tractable for model counting looks stimulating.

From the practical side, there are many ways to improve our compiler. Notably, it would be interesting to take ad- vantage of preprocessing techniques [Piette et al., 2008;

J¨arvisaloet al., 2012] in order to simplify the inputCNFfor- mulae before compiling them. Furthermore, it could prove useful to exploit Gaussian elimination for handling more effi- ciently (see e.g. [Li, 2003; Chen, 2007; Sooset al., 2009]) instances that contain subproblems corresponding to affine formulae, like those reported in [Crawford and Kearns, 1995;

Canni`ere, 2006]. Finally, considering other heuristics for se- lecting the branching affine clauses (e.g. criteria based on the mutual information metric) could also prove valuable.

(7)

References

[Bacchuset al., 2003] F. Bacchus, S. Dalmao, and T. Pitassi.

Algorithms and complexity results for #SAT and bayesian inference. InProc. of FOCS’03, pages 340–351, 2003.

[Bordeauxet al., 2012] L. Bordeaux, M. Janota, J. P. Mar- ques Silva, and P. Marquis. On unit-refutation complete formulae with existentially quantified variables. InProc.

of KR’12, 2012.

[Bryant, 1986] R.E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, C-35(8):677–692, 1986.

[Canni`ere, 2006] Ch. De Canni`ere. Trivium: A stream cipher construction inspired by block cipher design principles. In Proc. of ISC’06, pages 171–186, 2006.

[Chen, 2007] J. Chen. XORSAT: An efficient algorithm for the dimacs 32-bit parity problem. CoRR, abs/cs/0703006, 2007.

[Crawford and Kearns, 1995] J.M. Crawford and M.J.

Kearns. The minimal disagreement parity problem as a hard satisfiability problem. Technical report, 1995.

[Darwiche and Marquis, 2002] A. Darwiche and P. Marquis.

A knowledge compilation map.Journal of Artificial Intel- ligence Research, 17:229–264, 2002.

[Darwiche, 2001] A. Darwiche. Decomposable negation normal form. Journal of the ACM, 48(4):608–647, 2001.

[Darwiche, 2009] Adnan Darwiche. Modeling and Reason- ing with Bayesian Networks. Cambridge University Press, 2009.

[Darwiche, 2011] A. Darwiche. SDD: A new canonical rep- resentation of propositional knowledge bases. InProc. of IJCAI’11, pages 819–826, 2011.

[E´en and S¨orensson, 2003] N. E´en and N. S¨orensson. An ex- tensible SAT-solver. InProc. of SAT’03, pages 502–518.

2003.

[Fargier and Marquis, 2008] H. Fargier and P. Marquis. Ex- tending the knowledge compilation map: Krom, Horn, affine and beyond. InProc. of AAAI’08, pages 442–447, 2008.

[Gergov and Meinel, 1994] J. Gergov and C. Meinel. Ef- ficient analysis and manipulation of OBDDs can be ex- tended to FBDDs. IEEE Transactions on Computers, 43(10):1197–1209, 1994.

[J¨arvisaloet al., 2012] M. J¨arvisalo, M. Heule, and A. Biere.

Inprocessing rules. InProc. of IJCAR’12, pages 355–370, 2012.

[Li, 2003] C. Li. Equivalent literal propagation in the dll pro- cedure. Discrete Applied Mathematics, 130(2):251–276, 2003.

[Littmanet al., 2001] M. L. Littman, S. M. Majercik, and T. Pitassi. Stochastic boolean satisfiability. Journal of Au- tomated Reasoning, 27(3):251–296, 2001.

[Marquis, 2011] P. Marquis. Existential closures for knowl- edge compilation. InProc. of IJCAI’11, pages 996–1001, 2011.

[Mateescuet al., 2008] R. Mateescu, R. Dechter, and R. Marinescu. AND/OR multi-valued decision diagrams (AOMDDs) for graphical models. Journal of Artificial In- telligence Research, 33:465–519, 2008.

[Moskewiczet al., 2001] M.W. Moskewicz, C.F. Madigan, Y. Zhao, L. Zhang, and S. Malik. Chaff: engineering an efficient SAT solver. InProc. of DAC’01, pages 530–535, 2001.

[Muiseet al., 2012] Ch.J. Muise, Sh.A. McIlraith, J.Ch.

Beck, and E.I. Hsu. Dsharp: Fast d-DNNF compilation with sharpSAT. InProc. of AI’12, pages 356–361, 2012.

[Pietteet al., 2008] C. Piette, Y. Hamadi, and L. Sa¨ıs. Vivi- fying propositional clausal formulae. InProc. of ECAI’08, pages 525–529, 2008.

[Pipatsrisawat and Darwiche, 2008] K. Pipatsrisawat and A. Darwiche. New compilation languages based on structured decomposability. InProc. of AAAI’08, pages 517–522, 2008.

[Pipatsrisawat and Darwiche, 2010] K. Pipatsrisawat and A. Darwiche. A lower bound on the size of decomposable negation normal form. InProc. of AAAI’10, 2010.

[Roth, 1996] D. Roth. On the hardness of approximate rea- soning.Artificial Intelligence, 82(1–2):273–302, 1996.

[Sanget al., 2004] T. Sang, F. Bacchus, P. Beame, H.A.

Kautz, and T. Pitassi. Combining component caching and clause learning for effective model counting. InProc. of SAT’04, 2004.

[Sanget al., 2005] T. Sang, P. Beame, and H. A. Kautz. Per- forming Bayesian inference by weighted model counting.

InProc. of AAAI’05, pages 475–482, 2005.

[Schaefer, 1978] Th. J. Schaefer. The complexity of satisfi- ability problems. InProc. of STOC’78, pages 216–226, 1978.

[Schrag, 1996] R. Schrag. Compilation for critically con- strained knowledge bases. In Proc. of AAAI’96, pages 510–515, 1996.

[Shannon, 1949] C.E. Shannon. The synthesis of two–

terminal switching circuits.Bell System Technical Journal, 28(1):59–98, 1949.

[Sooset al., 2009] M. Soos, K. Nohl, and C. Castelluccia.

Extending SAT solvers to cryptographic problems. In Proc. of SAT’09, pages 244–257, 2009.

[Subbarayanet al., 2007] S. Subbarayan, L. Bordeaux, and Y. Hamadi. Knowledge compilation properties of tree-of- BDDs. InProc. of AAAI’07, pages 502–507, 2007.

[Valiant, 1979] L. G. Valiant. The complexity of computing the permanent.Theoretical Computer Science, 8:189–201, 1979.

[Voronov, 2013] A. Voronov.On Formal Methods for Large- Scale Product Configuration. Ph.D. thesis, Chalmers Uni- versity, 2013.

(8)

[Wachter and Haenni, 2006] M. Wachter and R. Haenni.

Propositional DAGs: A new graph-based language for rep- resenting Boolean functions. In Proc. of KR’06, pages 277–285, 2006.

Appendix

Proof:[Proposition 1] We start with the queries. Concerning CT, the proof is given in Section 3. For the remaining queries, we take advantage of the obvious polynomial translation ex- isting between any language and a superset of it. Thus when- everEADT(resp. ADT) satisfies a given query, this query is also satisfied byEDT,ADT,DT, andODT< (resp. DT, and ODT<). Conversely, whenever a query isNP-hard forEDT, it is alsoNP-hard forEADT.

• CO,VA: comes directly from the fact thatEADTsatisfies CT.

• CE,ME: comes directly from the fact thatEADTsatis- fiesCOandCD(Lemmata A.3 and A.4 from [Darwiche and Marquis, 2002] can be easily extended toADNfor- mulae).

• IM: comes directly from the fact that EADT satisfies VAandCD(Lemma A.7 from [Darwiche and Marquis, 2002] can be easily extended toADNformulae).

• SE: forADT, the result comes directly from the fact that ADTsatisfies∧BC,¬CandCO. Indeed, for anyADN formulaeαandβ, we haveα|=βiffα∧¬βis inconsis- tent. For the classEDT we take advantage of the same reduction as the one used to prove thatEDTdoes not sat- isfy∧BC. Indeed, the problem of determining whether the conjunction of twoEDTformulaeα1andα2is con- sistent isNP-complete. Sinceα1∧α2 is consistent iff α1 6|= ¬α2 and sinceEDT satisfies ¬C, the hardness result follows.

• EQ: comes directly from the fact thatADTsatisfiesSE, since for anyADNformulaeαandβ, we haveα≡βiff α|=βandβ |=α.

We continue with the transformations:

• CD: letγ be a consistent term. Ifαis anEADT(resp.

ADT,EDT,DT,ODT<) formula, the tree obtained by re- placing every affine clause δ labeling a node of α by δ|γis anEADT(resp. ADT,EDT,DT,ODT<) formula equivalent toα | γ. Indeed, the conditioning transfor- mation ”distributes” over the connectives; especially:

– (∆1∧. . .∧∆k)|γ= (∆1|γ)∧. . .∧(∆k|γ).

– (∆1∨. . .∨∆k)|γ= (∆1|γ)∨. . .∨(∆k|γ).

Thus, when we have

∆≡((x⊕δ)∧∆[x←δ⊕ >])

∨((x⊕δ⊕ >)∧∆[x←δ]), then∆|γis equivalent to

((x⊕δ)|γ∧∆[x←δ⊕ >]|γ)

∨((x⊕δ⊕ >)|γ∧∆[x←α]|γ).

Observe that(x⊕δ) | γ is an affine clause whenδ is an affine clause and that(x⊕δ⊕ >)| γis equivalent

to((x⊕δ) | γ)⊕ >. As to the case ofEDT, observe also that for any literall,l | γis equivalent tol, or>

or ⊥, which are allowed labels for the decision nodes of anEDTformula). Finally, observe that whenαis an ODT< formula, the ordering constraint induced by<is preserved by such a conditioning process. The fact that the replacement process can obviously be achieved in time linear in the size ofαplus the size ofγcompletes the proof.

• FO: by reduction from the validity problem forDNFfor- mulae. Letα=Wm

i=1γiwhere eachγi(i∈1, . . . , m) is a term. We associate in polynomial time withαtheDNF formula β given by Wm

i=1i ∧Vi−1

j=1¬newj ∧newi) where{new1, . . . , newm}are fresh variables fromPS, not occurring inα. By construction,β is a determinis- ticDNFformula (i.e., its terms are pairwise inconsistent) and we haveα≡ ∃{new1, . . . , newm}.β. Now, we can easily associate withβin polynomial time an equivalent ODT<formulaβ=

hnew1,hnew2, . . . ,

hnewm−1,hnewm,⊥, γmi, γm−1 i. . . , γ1i, where each γi (i ∈ 1, . . . , m) is an ODT< formula equivalent to the termγi. Basically, whatever the<or- dering overVar(α)which is considered, the size ofγi is linear in the size of γi. Andβ respects the exten- sion of<overVar(α)∪ {new1, . . . , newm}given by

∀i∈1, . . . , m−1, newi< newi+1and∀i∈1, . . . , m,

∀x∈Var(α),newi< x.

Therefore, we haveα≡ ∃{new1, . . . , newm}.β. Sup- pose thatODT<(resp.DT,EDT,ADT,EADT) would sat- isfyFO. Then we could compute in time polynomial in the size ofβanODT<formula (hence aDT,EDT,ADT, EADT formula) equivalent to∃{new1, . . . , newm}.β, hence equivalent toα. Since each ofODT<,DT,EDT, ADT, EADT satisfies VA, we could determine in time polynomial in the size of α whetherα is valid. As a consequence, we would havecoNP = P, henceP = NP.

• SFO: as toADT(resp. DT,ODT<), the result comes di- rectly from the fact thatADT(resp.DT,ODT<) satisfies CDand∨BC. Indeed, for every propositional formula αand variablex, we have∃x.α≡(α| ¬x)∨(α|x).

As toEDT(resp.EADT), let us consider twoEDT(resp.

EADT) formulaeα1andα2and letxbe a fresh variable, i.e.,x 6∈ Var(α1)∪Var(α2). The EDT(resp. EADT) formulaβ =hx, α1, α2ican be computed in time linear in the size ofα1plus the size ofα2, and by construction it is such thatα1∨α2 ≡ ∃x.β. IfEDT(resp. EADT) would satisfySFO, then anEDT(resp. EADT) formula equivalent toα1∨α2could be generated in time polyno- mial in the size ofα1plus the size ofα2, just by forget- tingxinβ. As a consequence,EDT(resp.EADT) would satisfy∨BC. This is not the case unlessP = NP.

• ∧C: by reduction from the satisfiability problem for CNF formulae. Letα = Vm

i=1δi where each δi (i ∈ 1, . . . , m) is a clause. With each δi (i ∈ 1, . . . , m) we can associate in linear time an ODT< formula δi

(9)

equivalent to δi. Suppose that ODT< (resp. DT,EDT, ADT,EADT) would satisfy∧C. Then we could compute in time polynomial in the size ofαan ODT< formula (hence aDT,EDT,ADT,EADTformula) α equivalent toVm

i=1δi, hence equivalent toα. Since each ofODT<, DT,EDT,ADT,EADTsatisfiesCO, we could determine in time polynomial in the size ofαwhetherαis consis- tent. As a consequence, we would haveP = NP.

• ∧BC: as toEDT(resp. EADT), the proof is by reduc- tion from the satisfiability problem forCNF formulae.

Consider aCNFformulaα = Vm

i=1δi overVar(α) = {x1, . . . , xn}, where eachδi(i∈1, . . . , m) is a clause.

Associate withα in polynomial time the CNF formu- lae α1 andα2 such thatα1 = Vm

i=1δii where eachδii (i ∈ 1, . . . , m) is the clauseδi in which every variable xj (j∈1, . . . , n) is replaced by a fresh variablexij, and α2=Vn

j=1(Vm

i=1((¬xj∨xij)∧(xj∨ ¬xij))). By con- struction,αis satisfiable iffα1∧α2is satisfiable. The point is that α1 (resp. α2) can be associated in poly- nomial time with an equivalentEDTformula (hence an EADTformula)α1(resp. α2). Indeed, by construction, the outermost V

connectives in α1 and in α2 are de- composable. Thus we can consider the EDT formula α1 = Vm

i=1δii where each δii (i ∈ 1, . . . , m) is a DT representation of the clause δii (and we know that suchDTrepresentations can be generated in time linear in the size of the corresponding clause.) Similarly,α2

is equivalent to theEDTformula (hence anEADTfor- mula)α2=Vn

j=1βjwhere eachβj(j ∈1, . . . , n) is a DTrepresentation ofVm

i=1((¬xj ∨xij)∧(xj∨ ¬xij)), which is equivalent to theDNFformula(xj∧Vm

i=1xij)

∨(¬xj ∧Vm

i=1¬xij). Thusβj (j ∈ 1, . . . , n) can be taken as equal to

hxj,hx1j,hx2j, . . . ,hxmj ,>,⊥i,⊥i,⊥i. . .i,

hx1j,⊥,hx2j,⊥,h. . . ,hxmj ,⊥,>i, . . .i.

Now, if any ofEDTorEADTwould satisfy∧BC, then for testing the satisfiability ofα, it would be enough to compute bothα1andα2in time polynomial in the size of α, then compute an EDTformula (or anEADTfor- mula)αequivalent toα1∧α2, and finally test the satis- fiability ofαin polynomial time since each ofEDTand EADTsatisfiesCO. This would makeP = NP.

As toADT(resp. DT), given twoADT(resp. DT) for- mulaeα1andα2, anADT(resp. DT) formulaαequiv- alent toα1∧α2can be obtained by replacing inα1ev- ery leaf node labeled by >by a copy of α2. Clearly enough, this can be achieved in quadratic time in the size ofα1plus the size ofα2. SinceT(α)is equivalent toT(α1)∧T(α2), we get thatαis equivalent toα1∧α2. In theDTcase, it is not guaranteed that the resulting tree αis read-once.

As toODT<, compute first theADNformulaαequiva- lent toα1∧α2as explained for theADTcase above. In the general case, such a formulaαis not anODT<for- mula because some paths from the root of αto a leaf

may contain two decision nodes labeled by the same de- cision variable. However, it is easy to turn αinto an equivalentODT<formula in linear time, via a reduction process. First of all, once can easily turnαin linear time into an equivalent tree such that every decision nodeN is labeled by a unary affine clause which has the form of a variablex. Indeed, ifNis labeled by>(resp.⊥) then by-pass it by connecting its father toN+(resp.N) (of course, ifNis the root of the tree, just replace it byN+

(resp. N)). IfN is labeled by a unary affine clause of the form¬x, then switch its two childrenN+andN. Once this is done, for every pathpfrom the root of the resulting tree to a leaf containing two decision nodes la- beled by the same decision variablex, if the first nodeN inpamong those labeled byxis connected toN+(resp.

N), then by-pass every other nodeN0labeled byxin pby connecting its father to N0+ (resp. N0−); repeat this reduction rule until no such path pcan be found.

By construction, the resulting formula is anODT< for- mula equivalent toα. Note that if this reduction process is applied to a DTformula, the resultingDTformula is read-once.

• ∨C: comes directly from the fact that none ofODT<, DT,EDT,ADT, andEADTsatisfies∧CunlessP = NP and each of them satisfies¬C(simply use De Morgan laws).

• ∨BC: as toODT<(resp.DT,ADT), the result comes di- rectly from the fact thatODT<(resp.DT,ADT) satisfies

∧BCand¬C. As toEDTandEADT, the result comes directly from the fact that each ofEDTandEADTsatis- fies¬Cbut none of them satisfies∧BCunlessP = NP.

In both cases, take advantage of De Morgan laws.

• ¬C: we explain how anyEADTformulaαcan be asso- ciated in linear time with anEADTformulan(α)equiv- alent to¬α. nproceeds recursively as follows, starting withN=Rα:

– ifN =hδ, N, N+i,

thenn(N) =hδ, n(N), n(N+)i;

– ifN =Vk

i=1Ni, thenn(N) =Wk

i=1n(Ni);

– ifN =Wk

i=1Ni, thenn(N) =Vk

i=1n(Ni);

– ifN =>, thenn(N) =⊥;

– ifN =⊥, thenn(N) =>.

Observe that in the cases N = Vk

i=1Ni and N =

Wk

i=1Ni, thentransformation preserves the decompos- ability of the nodes. Thatn(N)is equivalent to¬I(N) is obvious for every case, except for the case whenN= hδ, N, N+i. In this latter case, we know thatI(N) = ((δ⊕ >)∧I(N))∨(δ∧I(N+)). Therefore,¬I(N)≡ (δ∨ ¬I(N))∧((δ⊕ >)∨ ¬I(N+)). After distribu- tion and simplification, we obtain((δ⊕ >)∧ ¬I(N))∨

(δ∧ ¬I(N+)). Thus, by structural induction,¬I(N)is equivalent to((δ⊕ >)∧n(N))∨(δ∧n(N+)). Equiv- alently,¬I(N)is equivalent tohδ, n(N), n(N+)i.

Finally, whenαis anADTformula (resp. anEDT,DT, ODT< formula),n(α)also is anADTformula (resp. an

(10)

EDT,DT,ODT< formula). In theADT,DT, and ODT<

cases,n(α)can be simply obtained fromαby replacing in it every>leaf by a⊥leaf and every⊥leaf by a>

leaf.

Proof:[Proposition 2]

• OBDD< 6≤sADT: it is known that the circular bit shift functioncbsmdoes not have a polynomial-sizedSDNNF representation [Pipatsrisawat and Darwiche, 2010], hence a polynomial-sized OBDD< representation since SDNNF<sOBDD<. For any positive integerm, consider the following Boolean function over2m+1+mvariables cbsm(x0, . . . , x2m−1, y0, . . . , y2m−1, i0, . . . , im−1) which is the semantics of the formulaαm=

_

b0,...,bm−1∈{0,1}

(

m−1

^

j=0

ibjj

2m−1

^

j=0

xj ⇔y(j+num(b0,...,bm−1))mod2m),

whose size is linear in the number of variables of cbsm. In this formula, ibjj denotes the literal ij

when bj = 0 and the literal ¬ij when bj = 1;

num is the mapping from {0,1}m to the set of nat- ural numbers which gives the integer represented by the binary string b0. . . bm−1. Thus, the variables i0, . . . , im−1 make precise how the bits of the binary string y0. . . y2m−1 must be (circularly) shifted, and cbsm(x0, . . . , x2m−1, y0, . . . , y2m−1, i0, . . . , im−1) = 1 exactly when the variables x0, . . . , x2m−1 and the shifted variablesy0, . . . , y2m−1are pairwise equal.

For each b0, . . . , bm−1 ∈ {0,1}, the formula βb0,...,bm−1=

2m−1

^

j=0

xj⇔y(j+num(b0,...,bm−1))mod2m

is equivalent to theAFFformulaγb0,...,bm−1 =

2m−1

^

j=0

xj⊕y(j+num(b0,...,bm−1))mod2m⊕ >.

Clearly enough,γb0,...,bm−1can be computed in time lin- ear in the size ofβb0,...,bm−1, hence linear in the number of variables ofcbsm. SinceAFF≥p ADT, anADTfor- mula δb0,...,bm−1 equivalent to βb0,...,bm−1 can also be generated in time polynomial in the size ofβb0,...,bm−1. As a consequence, an ADT formula equivalent to αm

can be generated fromαmin polynomial time by gen- erating first aDTformula with decision nodes labelled by variables from{i0, . . . , im−1}, and whose2mpaths correspond to all possible terms of the formVm−1

j=0 ibjj withb0, . . . , bm−1 ∈ {0,1}; then each leaf node of this tree associated withb0, . . . , bm−1is replaced by the root of δb0,...,bm−1. By construction, the size of the result- ingADTformula is linear in the number of variables of cbsm.

• CNF 6≤s ADTand DNF6≤s ADT: comes from the fact thatAFF≥pADT(henceADT≤sAFF), whileCNF6≤s

AFF, andDNF6≤sAFF(because of the ”parity function”

ni=1xi, which is a XOR-clause with no polynomial- sizedDNForCNFrepresentation).

• EADT<sADT: from the inclusionADT⊆EADT, we ob- viously get thatEADT≤sADT. Now, consider theCNF formula∆ =Vn

i=1(¬xi∨ ¬yi). [Fargier and Marquis, 2008] shows that∆cannot be represented by anAFF[∨]

formula of size polynomial inn. Furthermore,ADTis polynomially translatable intoAFF[∨]. Indeed, letαbe anADTformula. Letβ be the disjunction, for all paths ofαfrom its root to a>node, of the conjunction of all affine clauses encountered in the path. β can be gener- ated in time linear in the size ofα, and by construction it is a disjunction of affine formulae that is equivalent to α. As a consequence, ∆cannot be represented by an ADTformula of size polynomial inn. Contrastingly,∆ has a polynomial-sized EADTrepresentation (and even a polynomial-sizedEDTrepresentation) since the sets of variables of the clauses¬xi∨ ¬yi (i∈ 1, . . . , n) of∆ are pairwise disjoint andCLis polynomially translatable intoDT.

Références

Documents relatifs

- Distribution en quantité de mouvement de l’agrégat oc lorsque l’on suppose que le mouvement relatif des deux agrégats (L = 1) est décrit par une

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

[r]

La fonction g n est clairement contine, dérivable strictement croissante.. Elle converge donc et sa limite α est positive

Comme Φ est une application linéaire entre deux espaces de même dimension, pour montrer que c'est un isomorphisme, il sut de montrer qu'il est injectif.. C'est à dire que son noyau

soit le nombre de régions du plan , déterminées par p de ces droites... On appelle I le milieu

[r]

En d´ eduire un isomorphisme du corps L sur un sous-anneau (que l’on pr´ ecisera) de l’anneau M n×n (K) des matrices carr´ ees n × n ` a coefficients dans K..