1 Introduction

Knowledge compilation is an area of research with a long tradition in artificial intelligence (see, e.g., [11] and [16]). A key aspect of any compilation approach is the target language into which the propositional theory is compiled. Therefore, the study of representations for propositional theories has been a central subject. One aim is to decide whether representations can be transformed into equivalent ones of another representation language by only increasing the representation size polynomially (see, e.g., [1, 2, 6, 7, 14, 15, 17, 20]). We follow this direction of research.

Representation Languages

In the following we describe informally the significant representation languages considered in this paper (for formal definitions of the significant ones see Section 2). Circuits are a powerful model for the representation of Boolean functions in small size (w.r.t. the number of Boolean variables the functions are defined on). The desire to have better algorithmic properties leads to restricted circuits. A circuit with ∧-gates (conjunctions), ∨-gates (disjunctions), and negation gates is in negation normal form if its negation gates are only wired by input variables. Decomposable negation normal form circuits, or DNNFs for short, introduced by Darwiche [12] require that the subcircuits leading into each ∧-gate have to be defined on disjoint sets of variables. This requirement is called decomposability. Darwiche also defined deterministic DNNFs, d-DNNFs for short, where the subcircuits leading into each ∨-gate never simultaneously evaluate to the function value 1. Determinism allows efficient algorithms for model counting, the efficient computation of the number of satisfying inputs of a function represented by a given restricted circuit. Moreover, Pipatsrisawat and Darwiche defined the notion of structured decomposability [18]. For every ∧-gate the subcircuits leading into the gate are not only defined on disjoint sets of variables but their variables have to be split with respect to a given variable tree called vtree whose leaves are labeled by Boolean variables. Structuredness allows the combination of Boolean functions by a Boolean operator in polynomial time. Sentential decision diagrams, SDDs for short, introduced by Darwiche [14] are restricted structured d-DNNFs which have turned out to be a promising representation language for propositional knowledge bases as reported, e.g., by Van den Broeck and Darwiche [9]. Here, the requirement of restricted strongly deterministic decompositions generalizes the well-known Shannon decomposition. It ensures that for each function f representable by polynomial-size SDDs with respect to a vtree T also the negated function \(\overline {f}\) is representable by SDDs w.r.t. T in polynomial size. DNNFs are not only by definition more general than d-DNNFs [6] and it is not difficult to prove that d-DNNFs are strictly more general than structured d-DNNFs. Beame and Liew as well as Bova and Szeider mentioned the question about the relative succinctness of structured d-DNNFs and SDDs, i.e., whether structured d-DNNFs are strictly more concise than SDDs [2, 8]. To the best of our knowledge it is still open whether there exists a Boolean function representable by structured d-DNNFs in polynomial size but needs SDDs of at least quasipolynomial or even exponential size. In the following we make one step to answer this question.

Contribution and Related Work

Ordered binary decision diagrams, OBDDs for short, are well suited as data structure for Boolean functions and have received much considerations in the verification literature (see, e.g., the monograph of Wegener [23]). OBDDs are restricted binary decison diagrams that respect so-called variable orderings which are lists of variables. SDDs respect variable trees and are more general than OBDDs by definition. Bova was the first one who presented a Boolean function representable by SDDs of polynomial size but whose OBDD size is exponential [5]. Later on Bollig and Buttkus showed an exponential separation between SDDs and more general BDD models [4]. Unambiguous nondeterministic OBDDs have at most one accepting computation path for every input. They can be seen as restricted structured d-DNNFs. Recently, it was proved that every Boolean function f for which f and its negated function \(\overline {f}\) can be represented by polynomial-size unambiguous nondeterministic OBDDs with respect to the same variable ordering can also be represented by SDDs of polynomial size w.r.t. so-called linear vtrees that contain additionally auxiliary variables [4]. Here, we generalize this result and prove that given polynomial-size structured d-DNNFs w.r.t. the same vtree for f and its negated function \(\overline {f}\), the function f can also be represented by SDDs of polynomial size. It is not difficult to prove that there are vtrees T and Boolean functions f such that structured d-DNNFs for f and for \(\overline {f}\) w.r.t. T are exponentially more succinct than SDDs representing f w.r.t. T (see also Section 3). Therefore, for our simulation we have to modify the given vtree and we add extra auxiliary variables.

Organization of the Paper

The rest of the paper is organized as follows. In Section 2 we recall the main definitions concerning decomposable negation normal forms, we introduce certificates, and we investigate how structured d-DNNFs alter if some of the input variables are set to constants. For completeness we prove in Section 3 that structured d-DNNFs can be exponentially more succinct than SDDs for a given function w.r.t. a fixed vtree. Section 4 contains our main result. It is shown that every Boolean function f for which f and its negated function \(\overline {f}\) can be represented by polynomial-size structured d-DNNFs w.r.t. the same vtree can also be represented by SDDs of polynomial size w.r.t. a vtree that contains extra auxiliary variables.

2 Preliminaries

In this section, we briefly recall the main notions concerning decomposable negation normal forms, we take a look at certificates which are minimal satisfiable subcircuits, and we investigate how some representations of Boolean functions alter if some of the input variables are replaced by Boolean constants.

2.1 Decomposable Negation Normal Forms

We assume familiarity with fundamental concepts on Boolean functions and circuits (otherwise see, e.g., [22] for more details). In the rest of the paper, we look at (restricted) NNFs as classes of Boolean circuits. A satisfying input for a Boolean function f is an assignment to the input variables whose function value is 1, in other words this assignment is mapped to 1 by f. A Boolean function f depends essentially on a variable x if the subfunctions of f obtained by replacing x by the Boolean constants are different.

Many known representations of propositional knowledge bases are restricted negation normal form circuits (NNFs) and correspond to specific properties on NNFs [15]. Decomposability and determinism are two of these fundamental properties.

Definition 1 (NNFs)

A negation normal form circuit on a variable set X is a Boolean circuit over fan-in 2 conjunction gates and unbounded fan-in disjunction gates, labeled by ∧ and ∨, whose inputs are labeled by literals x and \(\overline {x}\) for xX, and ⊥ and ⊤ for the Boolean constants 0 and 1. The size of an NNF \(\mathcal {C}\), denoted by \(|\mathcal {C}|\), is the number of its gates. The NNF size of a Boolean function f is the size of a smallest negation normal form circuit representing f. The Boolean function \(f_{\mathcal {C}}:\{0,1\}^{X}\rightarrow \{0,1\}\) represented by \(\mathcal {C}\) is defined in the usual way. An NNF is decomposable, or a DNNF for short, iff the children of each ∧-gate are reachable from disjoint sets of input variables. A set of Boolean functions {f1,…,f} on the same variable set is disjoint if each pair of functions fi,fj, ij, is not simultaneously satisfiable. A DNNF is deterministic, or a d-DNNF for short, iff the functions computed at the children of each ∨-gate are disjoint.

The size of restricted NNFs for a Boolean function can be defined in a similar way as above. The fact that negations only appear at variables is not really a restriction and the NNF size is polynomially related to the circuit size of a Boolean function over the standard basis {∧,∨,¬}. Our assumption that each ∧-gate has only fan-in 2 is justified because it affects the NNF size only polynomially. In the following for an NNF \(\mathcal {C}\) and a gate g in \(\mathcal {C}\) the subcircuit rooted at g is denoted by Cg.

Structured decomposability on the notion of vtrees was originally introduced by Pipatsrisawat and Darwiche [18]. Informally, the variables are considered in a certain way formalized as a tree structure on the variables.

Definition 2

A vtree for a finite, nonempty set of variables X is a full, rooted binary tree whose leaves are in one-to-one correspondence with the variables in X.

In the rest of the paper for a node u in a graph let vars(u) denote the set of variables for which a literal appears in the subgraph rooted at u.

Definition 3

Let T be a vtree for the finite, nonempty set of variables X and \(\mathcal {D}\) be a (deterministic) DNNF. An ∧-gate u of \(\mathcal {D}\) with children ul and ur respects a node v of T with children vl and vr iff \(\text {vars}({u_{l}}) \subseteq \text {vars}({v_{l}})\) and \(\text {vars}({u_{r}}) \subseteq \text {vars}({v_{r}})\). \(\mathcal {D}\) respects the vtree T, if every ∧-gate u of \(\mathcal {D}\) respects a node v in T. A (deterministic) DNNF that respects a given vtree T is called a (deterministic) DNNFT. Moreover, a structured (deterministic) DNNF is a (deterministic) DNNFT for an arbitrary vtree T.

In the following let Tv be the subtree of a tree T rooted at a node v in T. If we choose for every ∧-gate u in a DNNFT the node v in T in such a way that u respects v and there exists no other node \(v^{\prime }\) in T such that u respects \(v^{\prime }\) and \(T_{v^{\prime }}\) is a subtree of Tv, the node v is unique and we call v the decomposition node of u and d-node(u) = v.

Sentential decision diagrams introduced by Darwiche [14] result from so-called structured decomposability and strong determinism. Therefore, by definition they are restricted structured d-DNNFs.

Definition 4

For a variable set X let \(\bot :\{0,1\}^{X}\rightarrow \{0,1\}\) and \(\top :\{0,1\}^{X}\rightarrow \{0,1\}\) denote the constant 0 function and constant 1 function, respectively. A set of Boolean functions {f1,…,f} on the same variable set is called a partition iff the functions f1,…,f are disjoint, none of the functions is the constant 0 function ⊥, and \(\bigvee \limits _{i=1}^{\ell } f_{i}=\top \).

Definition 5

A sentential decision diagram C, or SDD for short, respecting a vtree T is defined inductively in the following way:

  • C consists of a single node labeled by a constant representing ⊥ or ⊤ and T is an arbitrary vtree.

  • C consists of a single node labeled by a literal on a variable x and x is in the variable set of T.

  • The output gate of C is a disjunction whose inputs are wires from ∧-gates g1,…,g, where each gi has wires from pi and si, v is an inner node in T with children vL and vR, \(C_{p_{1}}, \ldots , C_{p_{\ell }}\) are SDDs that respect the subtree of T rooted at vL, \(C_{s_{1}}, \ldots , C_{s_{\ell }}\) are SDDs that respect the subtree of T rooted at vR, and the functions represented by \(C_{p_{1}}, \ldots , C_{p_{\ell }}\) are a partition.

An SDD is an SDD respecting some vtree.

By definition SDDs are circuits with alternating ∨- and ∧-gates. The property that the functions p1,…,p are disjoint is also called strong determinism and the partition property is a strengthening of strong determinism. The distinction between the left and right child of a node is crucial for SDDs but not for structured d-DNNFs. Xue, Choi, and Darwiche showed that switching the left and right child of a vtree node may lead to an exponential change in the size of the corresponding SDDs for a given function [24]. Obviously, as a result we can conclude that for a function f the size of a structured d-DNNF representing f can be exponentially more succinct than its SDD size for a fixed vtree. In the next section we show that strong determinism is really a strengthening of determinism w.r.t. polynomial-size representations even without switching left and right children in a vtree.

Some applications require their input circuits to be smooth, i.e., all children of an ∨-gate mention the same set of variables. The notion of smoothness was first introduced by Darwiche [13]. Recently, smoothness was also considered for structured decomposable circuits [21].

Definition 6

A circuit is smooth if for every pair of children u1 and u2 of an ∨-gate u, the set of variables vars(u1) is equal to vars(u2).

A smoothing algorithm transforms a given circuit to a smooth circuit that represents the same Boolean function. Since there exists a smoothing algorithm for structured d-DNNFs that maintains the same vtree running in polynomial time [21], we assume that the considered circuits are smooth in the rest of the paper. For smooth structured d-DNNFs the notion of decomposition nodes can easily be extended for ∨-gates. Let u be an ∨-gate with children u1,…,uk then the decomposition node of u is equal to the decomposition node of u1,…,uk. Furthermore, decomposition nodes of nodes labeled by a literal are the corresponding leaves in the considered vtree, respectively.

2.2 Certificates

Bova et al. showed how to apply results from communication complexity to prove lower bounds on the size of (deterministic) DNNFs [6]. The main idea is that for a function f this size is lower bounded by the size of a so-called balanced (disjoint) rectangle cover for f. For this result they considered certificates for satisfying assignments w.r.t. a given (deterministic) DNNF \(\mathcal {D}\). Informally, these certificates are minimal satisfiable subcircuits of D that contain the output gate of \(\mathcal {D}\).

Definition 7

[6] Let \(\mathcal {D}\) be a DNNF for the set of variables X. A certificate of \(\mathcal {D}\) is a DNNF \(\mathcal {C}\) for X with the following properties:

  1. (i)

    The DNNF \(\mathcal {C}\) is a connected subgraph of \(\mathcal {D}\).

  2. (ii)

    The roots (output gates) of \(\mathcal {C}\) and \(\mathcal {D}\) coincide.

  3. (iii)

    If \(\mathcal {C}\) contains an ∧-gate u, \(\mathcal {C}\) also contains each child node v of u and the edge (u, v).

  4. (iv)

    If \(\mathcal {C}\) contains an ∨-gate u, \(\mathcal {C}\) also contains exactly one of the child nodes v of u and the edge (u, v).

Since the fan-in of ∨-gates is restricted by 1 and because of the decomposability of \(\mathcal {D}\), a certificate can be seen as a rooted binary tree where each leaf is labeled by a different variable of X. Now, we define 1-certificates in order to represent sets of satisfying inputs of a given DNNF (for 1-certificates see also [3]).

Definition 8

A decision node is a node labeled by a Boolean variable which has two outgoing edges one labeled by 0 and the other one by 1. A sink is a node labeled by a Boolean constant. A 1-certificate is a certificate with the following modifications: each leaf labeled by a literal x is a restricted decision node labeled by x whose only outgoing edge labeled by 1 leads to the 1-sink and each leaf labeled by a literal \(\overline {x}\) is a restricted decision node labeled by x whose only outgoing edge labeled by 0 leads to the 1-sink.

A 1-certificate represents all assignments to the input variables where the labels of outgoing edges of decision nodes are chosen as assignments for the corresponding variables. Since a 1-certificate does not have to contain a decision node for each input variable, the represented set of assignments to all variables can contain more than one element. Obviously, according to the definition of 1-certificates, each ∨- and ∧-gate evaluates to 1 for an assignment of the represented set. Since the roots of a 1-certificate and a given DNNF coincide because of the second requirement in the definition of certificates, this set of assignments is also satisfying for the given DNNF. In the deterministic case, there is a one-to-one correspondence between 1-certificates and subsets of satisfying assignments for the function represented by the given DNNF. We know the following fact [3].

Fact 1

If \(\mathcal {D}\) is a deterministic DNNF representing a Boolean function \(f_{\mathcal {D}}: \{0,1\}^{n} \rightarrow \{0,1\}\), then for each satisfying assignment b ∈{0,1}n of \(f_{\mathcal {D}}\) there is a unique 1-certificate of \(\mathcal {D}\) representing b.

2.3 Pruned Vtrees and Pruned Structured d-DNNFs

Beame and Liew showed how lower bounds on the SDD size for a Boolean function can be proved by deterministic two-way best-partition communication complexity [2]. For this reason they defined a small generalization of vtrees suitable for describing SDDs with respect to partial assignments.

Definition 9

[2] A pruned vtree on a variable set X is a full, rooted binary tree whose leaves are either marked stub or by a variable in X and whose leaves marked by variables are in one-to-one correspondence with the variables in X.

Obviously, any vtree on a variable set X is by definition also a pruned vtree on X.

For a vtree T on a variable set X and \(A\subseteq X\) the pruned vtree TA can be constructed as follows. For each vertex v in T, the subtree rooted at v is replaced by a stub iff \(\text {vars}({v})\subseteq A\) and \(\text {vars}({\text {parent}(v)}) \not \subseteq A\), where parent(v) is the unique parent of v in T.

Next, we define pruned SDDs in a slightly modified form than Beame and Liew.

Definition 10

A pruned SDD C respecting a pruned vtree T is defined inductively in the following way:

  • C consists of a single node labeled by a constant representing ⊥ or ⊤ and T is an arbitrary pruned vtree.

  • C consists of a single node labeled by a literal on a variable x and x is in the variable set of the pruned vtree T.

  • The output gate of C is a disjunction whose inputs are wires from ∧-gates g1,…,g, where each gi has wires from pi and si, v is an inner node in the pruned vtree T with children vL and vR, \(C_{p_{1}}, \ldots , C_{p_{\ell }}\) are pruned SDDs that respect the subtree of T rooted at vL, \(C_{s_{1}}, \ldots , C_{s_{\ell }}\) are pruned SDDs that respect the subtree of T rooted at vR, and the functions represented by \(C_{p_{1}}, \ldots , C_{p_{\ell }}\) are mutually disjoint.

A pruned SDD is a pruned SDD respecting some pruned vtree.

Note that a pruned SDD w.r.t. a pruned vtree that is a stub represents always ⊥ or ⊤.

Using pruned vtrees Beame and Liew investigated how SDDs simplify under partial assignments to the input variables. Let \( \mathcal {D}\) be an SDD representing a Boolean function f w.r.t. the vtree T on the set of variables X. Furthermore, let \(A\subseteq X\) and p be an assignment to the variables in A. The pruned SDD \(\mathcal {D}_{p}\) is constructed in the following way. For each leaf labeled by a literal , where or \(\overline {\ell }\) are in A, we replace by ⊤ iff is fullfilled by p and by ⊥ otherwise. Any children of ∨-gates that compute ⊥ can be eliminated. If a gate computes a constant function under the assignment p, the outgoing edges of the gate can be replaced by the corresponding constant. All nodes that are not any longer connected to the root of \(\mathcal {D}\) can be eliminated.

It is not difficult to see that \(\mathcal {D}_{p}\) is a subgraph of \(\mathcal {D}\). Moreover, \(\mathcal {D}_{p}\) is a pruned SDD that respects the pruned vtree TA and \(\mathcal {D}_{p}\) represents the subfunction of f obtained by replacing the variables in A by the assignment p [2]. Pruned smooth structured d-DNNFs can be obtained in a similar way as pruned SDDs. Definition 3 can easily be adapted with respect to pruned vtrees.

The following restricted partial assignments are crucial for our transformation from structured d-DNNFs into SDDs.

Definition 11

[2] For a node v in a vtree T on the set of variables X let shell(v) denote the variables in X ∖vars(v).

For \(A\subseteq X\) we call {A, XA} a shell partition for X if there is a vertex v in the vtree T such that shell(v) = A. An assignment to the variables in A is called a shell restriction (w.r.t. v).

Let \(\mathcal {D}\) be a (pruned) SDD respecting a (pruned) vtree T and let v be a node in T. \(\mathit {SDD(\mathcal {D},v)}\) denotes the set of all (pruned) SDDs in \(\mathcal {D}\) for which the decomposition node of the root is v.

Proposition 1

[2] Let \(\mathcal {D}\) be an SDD respecting a vtree T and let v be a node in T. For every shell restriction p w.r.t. v the functions represented by the pruned SDDs in \(\mathit {SDD(\mathcal {D}_{p},v)}\) are mutually disjoint.

For simplicity, we present the following proof which is different from the one presented by Beame and Liew [2].

Proof

The proof can easily be done by contradiction. Let p be a shell restriction w.r.t. v and let f1 and f2 be two functions represented by two different SDDs in \(\mathit {SDD(\mathcal {D}_{p},v)}\) that are not mutually disjoint. Since the roots of the SDDs in \(\mathit {SDD(\mathcal {D}_{p},v)}\) have the same decomposition node, no SDD in \(\mathit {SDD(\mathcal {D}_{p},v)}\) can be part of another SDD in \(\mathit {SDD(\mathcal {D}_{p},v)}\). Let ui be the root of the SDD representing fi for i ∈{1,2}. Furthermore, let r be an assignment to the variables in vars(v) which is mapped by f1 and f2 to 1. Now, let p + r be the joint assignment to X obtained from p and r. It follows that there are two 1-certificates for p + r in the given SDD \(\mathcal {D}\), one that contains u1 and another one that contains u2 in contradiction to the determinism property (see also Fact 1). □

Strong determinism is not necessary for Proposition 1 because determinism is sufficient for Fact 1. Therefore, we can generalize Proposition 1 for structured d-DNNFs. Since the output gate of a structured d-DNNF can also be a conjunction, we have to modify the notation.

Definition 12

Let \(\mathcal {D}\) be a structured d-DNNF w.r.t. a vtree T. Furthermore, let v be an arbitrary node in T and let p be a shell restriction w.r.t. v, where shell(v) = A. \(\mathcal {D}_{p}\) denotes the pruned structured d-DNNF obtained from \(\mathcal {D}\) by the restriction p. A node in \(\mathcal {D}_{p}\) is in the set R(Dp,v) if its decomposition node in the pruned vtree TA is v. Moreover, the set \(R^{+}(\mathcal {D}_{p},v)\) contains all nodes in \(R(\mathcal {D}_{p},v)\) for which there exists no child node in \(R(\mathcal {D}_{p},v)\). The set d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) contains all pruned structured d-DNNFs in \(\mathcal {D}_{p}\) rooted at a node in \(R^{+}(\mathcal {D}_{p},v)\).

Now, the following proposition can be proved in a similar way as Proposition 1.

Proposition 2

Let \(\mathcal {D}\) be a structured d-DNNF w.r.t. a vtree T and p be a shell restriction w.r.t. a node v in T. Then all functions represented by a pruned structured d-DNNF in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) are mutually disjoint.

For our transformation from structured d-DNNFs into equivalent SDDs the following observation is useful. Let \(\mathcal {D}\) be a structured d-DNNF w.r.t. a vtree T and let v be a node in T with shell(v) = A. Furthermore, let p be a shell restriction w.r.t. v. If f is the Boolean function represented by \(\mathcal {D}\), the disjunction of all functions represented by structured d-DNNFs in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) is equal to the subfunction of f obtained by replacing the variables in A according to p denoted by fA, p in the following. The reason is the following one. \(\mathcal {D}\) is an NNF, a circuit with ∨- and ∧-gates. Replacing the variables in A by p in this circuit yields a circuit computing fA, p. Therefore, \(\mathcal {D}_{p}\) represents this subfunction. If R(Dp,v) contains for a node \(v^{\prime }\) also a child node of \(v^{\prime }\), then R(Dp,v) contains all child nodes of \(v^{\prime }\). As a result the disjunction of all functions represented by a pruned structured d-DNNF rooted at a node in \(R(\mathcal {D}_{p},v)\) is equal to the disjunction of all functions represented by a pruned structured d-DNNF rooted at a node in \(R^{+}(\mathcal {D}_{p},v)\).

Proposition 3

Let \(\mathcal {D}\) be a structured d-DNNF w.r.t. a vtree T representing a Boolean function f and p be a shell restriction w.r.t. a node v in T. Furthermore, let \(\overline { \mathcal {D}}\) be a structured d-DNNF w.r.t. T representing the Boolean function \(\overline {f}\). Then all functions represented by a pruned structured d-DNNF in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) or in d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\) are mutually disjoint. Moreover, assuming that none of the functions is equal to the constant function ⊥, the set of all these functions is a partition.

Proof

We assume that none of the functions represented in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) or d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\) is the constant function ⊥. The disjunction of all the functions represented in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) (d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\)) is equal to fA, p (\(\overline {f}_{A,p}\)) and the disjunction of fA, p and \(\overline {f}_{A,p}\) is obviously equal to the constant function ⊤. Using Proposition 2 it remains to prove that a pair of function f1 and f2 where f1 is represented by a structured d-DNNF in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) and f2 is represented in d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\) is mutually disjoint. Since f and \(\overline {f}\) are mutually disjoint, we know that fA, p and \(\overline {f}_{A,p}\) are mutually disjoint. Therefore, we are done. □

3 On Structured d-DNNFs and SDDs w.r.t. a Fixed Vtree

In this section, we show for completeness that strong determinism is a stronger requirement than determinism w.r.t. polynomial-size representations.

Proposition 4

There exist a vtree T and a Boolean function f such that f and \(\overline {f}\) can be represented by structured d-DNNFs w.r.t. T in polynomial size but the SDD size of f w.r.t. T is exponential.

Proof

We start with a well-known function from the BDD literature. The hidden weigthed bit function HWBn introduced by Bryant [10] is defined by

$$ \text{HWB}_{n}(x_{1}, \ldots, x_{n})= x_{\|x\|}, $$

where ∥x∥ = x1 + ⋯ + xn is the number of variables set to 1 in the input x and the output is 0 if x1 + ⋯ + xn = 0. W.l.o.g. let n be divisible by 10. It is well known that the OBDD size of HWBn is Ω(2n/5) [10]. Now, let T be a vtree rooted at v on the variables x1,…,xn. The node v is the left child of v, and vr the right one. Furthermore, the subtree rooted at v has \(\frac {6}{10} n\) leaves and the one rooted at vr has \(\frac {4}{10} n\) leaves. Both subtrees are right-linear which means that for every inner node in the considered vtree the left child is a leaf. Let X be the set of x-variables on leaves in the subtree rooted at v and Xr the remaining x-variables.

In the following we prove an exponential lower bound on the size of SDDs w.r.t. T for HWBn. From the definition of SDDs it is not difficult to see that it is sufficient to show an exponential lower bound on the number of subfunctions for HWBn obtained by replacing \(\frac {6}{10} n\) x-variables by constants. (For exponential lower bounds on the size of strongly deterministic structured d-DNNFs see also [19].) Counting subfunctions is well-known from lower bound methods for OBDDs. Therefore, similar lower bound proofs for the OBDD size of HWBn can be used. A slight improvement of Bryant’s lower bound is presented in Theorem 4.10.2 in [23]. It is proven that the number of subfunctions obtained by replacing \(\frac {6}{10} n\) variables is at least \(2^{\frac {n}{5}-1}\).

Next, we show that the structured d-DNNF size for HWBn w.r.t. T is polynomial. HWBn can be defined as \(\bigvee _{1\leq i \leq n} {E_{i}^{n}}(X)\wedge x_{i}\), where \({E^{n}_{i}}\) is the symmetric Boolean function on n variables computing 1 iff the number of ones in the input, that is the number of variables set to 1, is exactly i. Now, we decompose the functions \(({E_{i}^{n}}(X)\wedge x_{i})\) in the following way. The functions fi, j are defined on the variables in X. If xi is in X, the function value of fi, j is 1 iff the number of variables in X set to 1 is j and xi is set to 1. Otherwise, it is sufficient that the number of variables in X set to 1 is j. Furthermore, the functions gi, j are defined on the variables in Xr. If xi is in Xr, the function value of gi, j is 1 iff the number of variables in Xr set to 1 is ij and xi is set to 1. Otherwise, it is sufficient that the number of variables in Xr set to 1 is ij. Let hi, j(X) = fi, j(X) ∧ gi, j(Xr). Then, for i fixed \(({E_{i}^{n}}(X)\wedge x_{i})\) is the disjunction of all functions hi, j for \(i-\frac {4}{10}n \leq j \leq \min \limits \{i, \frac {6}{10} n\}\). It is not difficult to see that each of the f- and g-functions can be represented by OBDDs of at most quadratic size w.r.t. every variable ordering because they are slight modifications of symmetric functions (see, e.g., [23]). Since OBDDs and SDDs w.r.t. right-linear vtrees are closely related (see [14] and Section 2.3 in [4]), we can conclude that they can also be represented by polynomial-size structured d-DNNFs w.r.t. the right-linear subtree rooted at v and vr, respectively. Obviously, HWBn is the disjunction of all hi, j. Neither the f-functions nor the g-functions are mutually disjoint but two different functions hi, j and \(h_{i^{\prime },j^{\prime }}\) for \(i\not = i^{\prime }\) or \(j\not = j^{\prime }\) are mutually disjoint.

Since the number of the f- and g-functions as well as the number of conjunctions fi, jgi, j is polynomially bounded in n and the representation size for each f- and g-function is polynomial, the d-DNNF size for HWBn w.r.t. T is also polynomially bounded.

The polynomial upper bound on the structured d-DNNF size for \(\overline {\text {HWB}}_{n}\) w.r.t. T can be shown in a similar way using the representation

$$\overline{\text{HWB}}_{n}(x)=\bigvee\limits_{1\leq k \leq n} ({E^{n}_{k}}(x)\wedge \overline{x}_{k}) \vee {E^{n}_{0}}(x).$$

4 Simulating Structured d-DNNFs by SDDs

In this section, we examine the relationship between stuctured d-DNNFs and SDDs. We present a method to represent efficiently a Boolean function f as an SDD provided that f and \(\overline {f}\) can both be represented by small structured d-DNNFs w.r.t. the same vtree. In Section 3 we have seen that in general this is not possible without modifying the given vtree. In order to ensure the partition property of SDDs we add some auxiliary variables. Our simulation generalizes the procedure described by Bollig and Buttkus [4] how to transform two unambiguous nondeterministic OBDDs w.r.t. the same variable ordering for f and \(\overline {f}\) into an SDD for f in polynomial time.

4.1 Main Ideas of the Simulation

Our simulation of structured d-DNNFs by SDDs can be divided into three phases. First, we transform the given structured d-DNNF into an equivalent one which is not only deterministic but strongly deterministic. For this reason we modify the given vtree into a vtree with auxiliary variables. In the second phase we transform the resulting structured d-DNNF again into an equivalent one to ensure the partition property. After the first and the second phase there can be edges between ∧-gates but SDDs are by definition circuits with alternating ∨- and ∧-gates. Therefore, in the last phase we transform subcircuits rooted at an ∧-gate into equivalent subcircuits rooted at an ∨-gate.

For the first and second phase we adapt ideas from the transformation of unambiguous nondeterministic OBDDs into SDDs [4]. Let f and \(\overline {f}\) be the Boolean functions represented by the structured d-DNNFs \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) w.r.t. a vtree T. Let \(\mathcal {D}_{u}\) denote the subgraph of \(\mathcal {D}\) rooted at a node u and let fu be the Boolean function represented by \(\mathcal {D}_{u}\). Now, let u be an arbitrary ∨-gate in \(\mathcal {D}\) and let \(f_{u_{1}}, \dots , f_{u_{l}}\) be the functions represented at the child nodes of u. Then fu is equal to \((f_{u_{1}} \wedge \top ) \vee (f_{u_{2}} \wedge \top ) \vee {\dots } \vee (f_{u_{l}} \wedge \top )\). Since \(f_{u_{1}}, \dots , f_{u_{l}}\) and ⊤ formally have to be defined on disjoint sets of variables, the given vtree has to be modified and auxiliary variables are added. If every ∨-gate in a given structured d-DNNF is handeled in this way, the result is an equivalent structured d-DNNF w.r.t. a modified vtree that is strongly deterministic. (See Fig. 1 for a transformation of an ∨-gate.)

Fig. 1
figure 1

Transformation of an ∨-gate to ensure strong determinism

The functions \(f_{u_{1}}, \dots , f_{u_{l}}\) do not necessarily form a partition. Therefore, the idea in the second phase is to find further functions represented at inner nodes of \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) which together with \(f_{u_{1}}, \dots , f_{u_{l}}\) yield a partition. Let A be a subset of the set of variables the function f is defined on and let p be an assignment of the variables in A. Moreover, let fA, p denote the subfunction of f obtained by replacing the variables in the subset A by p. The crucial observation for the second phase is that fA, p and \(\overline {f}_{A,p}\) form a partition. Now, let v be the decomposition node of u in the vtree T and let the set A be equal to shell(v). Furthermore, let p be a shell restriction w.r.t. v for which there exists an assignment r to the remaining variables such that there is a 1-certificate for the joint assignment p + r that contains the node u. Then the disjunction of all functions represented by the pruned structured d-DNNFs in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) is equal to fA, p and the disjunction of all functions represented by the pruned structured d-DNNFs in d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\) is equal to \(\overline {f}_{A,p}\). Moreover, all functions represented by a structured d-DNNF in d-\(\mathit {DNNF(\mathcal {D}_{p},v)}\) or d-\(\mathit {DNNF(\overline {\mathcal {D}}_{p},v)}\) are mutually disjoint (Proposition 3). Now, let \(u^{\prime }_{1}, \ldots , u^{\prime }_{k}\) be the set of all nodes in \(R^{+}(\mathcal {D}_{p},v)\) without u1,…,ul and let w1,…,wm be the set of all nodes in \(R^{+}(\overline {\mathcal {D}}_{p},v)\). Then \(f_{A,p}= f_{u_{1}} \vee {\dots } \vee f_{u_{l}} \vee f_{u_{1}^{\prime }} \vee {\dots } \vee f_{u_{k}^{\prime }}\) and \(\overline {f}_{A,p}= \overline {f}_{w_{1}} \vee {\dots } \vee \overline {f}_{w_{m}}\). Therefore, we can conclude that

$$ \begin{array}{@{}rcl@{}} f_{u} &=& (f_{u_{1}} \wedge \top) \vee {\dots} \vee (f_{u_{l}} \wedge \top) \vee (f_{u_{1}^{\prime}} \wedge \bot) \vee {\dots} \vee (f_{u_{k}^{\prime}} \wedge \bot) \vee\\ &&(\overline{f}_{w_{1}} \wedge \bot) \vee {\dots} \vee (\overline{f}_{w_{m}} \wedge \bot) \end{array} $$

and since all the functions are mutually disjoint, they form a partition. (Here, we assume that none of these functions is equal to ⊥.)

After the transformations in the first and second phase edges between ∧-gates are possible in the resulting structured d-DNNF. Since SDDs are by definition circuits with alternating ∨- and ∧-gates, we modify some of the subcircuits rooted at ∧-gates into equivalent ones rooted at ∨-gates. Here, we have to make sure that the partition property is fullfilled. The procedure is similar to the one in the second phase. Let u be such an ∧-gate and u and ur its child nodes. Let v be the decomposition node of u in the given vtree. Now, let p be a shell restriction w.r.t. v for which there exists an assignment r to the remaining variables such that there is a 1-certificate for the joint assignment p + r that contains the node u. Let \(u^{\prime }_{1}, \ldots , u^{\prime }_{k}\) be the set of all nodes in \(R^{+}(\mathcal {D}_{p},v)\) without u or child nodes of u and let w1,…,wm be the set of all nodes in \(R^{+}(\overline {\mathcal {D}}_{p},v)\). Then we know that

$$ \begin{array}{@{}rcl@{}} f_{u} &=& (f_{u_{\ell}} \wedge f_{u_{r}}) \vee (f_{u_{1}^{\prime}} \wedge \bot) \vee {\dots} \vee (f_{u_{k}^{\prime}} \wedge \bot) \vee (\overline{f}_{w_{1}} \wedge \bot) \vee {\dots} \vee (\overline{f}_{w_{m}} \wedge \bot) \end{array} $$

and \(f_{u_{\ell }}, f_{u_{1}^{\prime }}, \ldots , f_{u^{\prime }_{k}}, f_{w_{1}}, \ldots , f_{w_{m}}\) form a partition. (See Fig. 2 for a transformation of a function represented at an ∧-gate. For simplicity there are no nodes \(u^{\prime }_{1}, \ldots , u^{\prime }_{k}\) in the figure.) Note that for the third phase we do not have to alter the already modified vtree.

Fig. 2
figure 2

Transformation of a subcircuit rooted at an ∧-gate

4.2 The Simulation

We start with a kind of normalization for vtrees. For our simulation later on it is not necessary that the vtrees for the given structured d-DNNFs representing f and \(\overline {f}\) are the same but that they have the same normalized vtree. Let T be a given vtree. Since there is no difference between a left and right child of an inner node in a structured d-DNNF, we normalize the vtree in the sense that for each inner node v the number of variables vars(v) of the left child of v is at most as large as the number of variables vars(vr) of the right child of v. (See Fig. 3 for an example of such a vtree.) The modified vtree \(T^{\prime }\) for our simulation has the following structure. For each inner node v in T for which vars(v) contains more than two variables we add another node \(v^{\prime }\). If v is the left (right) child of the node parent(v), the parent of v in T, \(v^{\prime }\) is the left (right) child of parent(v) in \(T^{\prime }\). Furthermore, \(v^{\prime }\) is the new parent of v and v is the left child of \(v^{\prime }\) in \(T^{\prime }\). The right child of \(v^{\prime }\) is a leaf labeled by a new auxiliary variable. (See Fig. 4 for the modified vtree \(T^{\prime }\) w.r.t. the vtree T in Fig. 3, a node v in T and the nodes v and \(v^{\prime }\) in \(T^{\prime }\).) In the following v denotes a node in T as well as in \(T^{\prime }\). It will be clear from the context whether v is in T or \(T^{\prime }\).

Fig. 3
figure 3

A vtree T on the Boolean variables x1,x2,…,x12

Fig. 4
figure 4

The modified vtree w.r.t. the vtree T in Fig. 3

For technical reasons we assume that the given structured d-DNNFs are of the following form.

Definition 13

Let \(\mathcal {D}\) be a structured d-DNNF. We call \(\mathcal {D}\) simple if there exist no edges between ∨-gates, no ∨-gate is connected to a node labeled by ⊥ or ⊤, and nodes labeled by ⊥ are the only ones in \(\mathcal {D}\) that represent the constant function ⊥.

The size of a structured d-DNNF and the size of an equivalent simple one are polynomially related. Moreover, it is easy to check whether a function represented by a d-DNNF is equal to the constant function ⊥ in polynomial time.

In the followig simulation we look at DNNFs as graphs and we start with a simple fact.

Fact 2

Each Boolean function on two variables x and y can be represented by an SDD w.r.t. a vtree on x and y with at most seven nodes.

Such an SDD for a Boolean function can easily be constructed by evaluating each assignment to the variables.

Simulation 1

Let f be a Boolean function on n variables and f and \(\overline {f}\) are represented by structured d-DNNFs \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) w.r.t. the same normalized vtree T on the set of variables X. Because of Fact 2 we assume that each function represented at a node whose decomposition node in T is in a subtree T2 on two variables is already represented by an SDD w.r.t. T2. Now, we construct an SDD S representing f in the following way. First, we modify the vtree T to a vtree \(T^{\prime }\) on the variables in X and at most n − 2 auxiliary variables as mentioned above.

Let (V, E) and \((\overline {V},\overline {E})\) be the sets of nodes and edges of the structured d-DNNFs \(\mathcal {D}\) and \(\overline {\mathcal {D}}\), respectively. Let \(Y = V \cup \overline {V}\) and Z = {,∧,⊤,⊥}∪ Y. The nodes of S are tuples (u, v) ∈ Y × Z.

We construct S respecting the modified vtree by mapping nodes and edges of \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) to nodes and edges of S in the following way.

  1. 1.

    For each node u in Y we add the node (u, ) to S.

    • If the decomposition node of u in T is in a subtree of T on two variables, (u, ) is the same gate type as u or is labeled by the same constant or literal as u. Moreover, if \((u,u^{\prime })\in E\) or \((u,u^{\prime })\in \overline {E}\), respectively, the edge \(((u, \emptyset ), (u^{\prime }, \emptyset ))\) is inserted.

    • Otherwise, if the decomposition node of u in T is not in a subtree of T on two variables, (u, ) is an ∨-gate.

  2. 2.

    For each ∨-gate uV whose decomposition node v in T is not in a subtree of T on two variables the following nodes and edges are added. Let p be an arbitrary shell restriction w.r.t. v such that \(u\in R(\mathcal {D}_{p},v)\). For each node \(u^{\prime } \in R^{+}(\mathcal {D}_{p},v)\cup R^{+}(\overline {\mathcal {D}}_{p},v)\), we add an ∧-gate \((u,u^{\prime })\) to S. Moreover, we add the nodes (u,⊥) and (u,⊤) to S which are labeled by ⊥ and ⊤, respectively. Furthermore, the edges \(((u, \emptyset ), (u, u^{\prime }))\) and \(((u, u^{\prime }), (u^{\prime }, \emptyset ))\) are added to S. In addition, if \((u,u^{\prime })\in E\), the edge \(((u, u^{\prime }), (u, \top ))\) is inserted, otherwise \(((u, u^{\prime }), (u, \bot ))\).

    In a similar way each ∨-gate in \(\overline {V}\) is handled.

  3. 3.

    For each ∧-gate uV whose decomposition node v in T is not in a subtree of T on two variables the following nodes and edges are added. Let u and ur be the left and the right child of u, respectively. Moreover, let v be the decomposition node of u in T and let p be a shell restriction w.r.t. v such that \(u_{\ell }\in R(\mathcal {D}_{p},v_{\ell })\). We add the ∧-gate (u,∧) and a node (u,⊥) labeled ⊥ and the edges ((u, ),(u,∧)), ((u,∧),(u,)), ((u,∧),(ur,)). Furthermore, for each node \(u^{\prime } \in R^{+}(\mathcal {D}_{p},v_{\ell }) \cup R^{+}(\overline {\mathcal {D}}_{p},v_{\ell })\) without u and any child node of u we add the ∧-gate \((u,u^{\prime })\) and the edges \(((u,\emptyset ),(u,u^{\prime }))\), \(((u,u^{\prime }), (u^{\prime },\emptyset ))\), \(((u,u^{\prime }),(u,\bot ))\).

    In a similar way each ∧-gate in \(\overline {V}\) is handled.

Let \(\text {root}(\mathcal {D})\) be the root of the structured d-DNNF \(\mathcal {D}\). The root of S is given by \((\text {root}(\mathcal {D}), \emptyset )\). All nodes (u,⊤) and all nodes (u,⊥) for uY can be merged to a node labeled ⊤ and ⊥, respectively. Finally, we remove all nodes and edges from the resulting SDD S which cannot be reached from \((\text {root}(\mathcal {D}), \emptyset )\).

4.3 Size, Correctness, and Equivalence

In the following we show that the simulation presented in Section 4.2 can be done in polynomial-size. Furthermore, we prove that the result of the simulation is an SDD for f, the Boolean function represented by one of the given structured d-DNNFs. Our proofs generalize the proofs presented by Bollig and Buttkus [4].

We get a relationship between the sizes of the given structured d-DNNFs and the constructed equivalent SDD by the following lemma which states that the increase in size is at most quadratic.

Lemma 1

Let \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) be structured d-DNNFs w.r.t. a normalized vtree T that represent the Boolean functions f and \(\overline {f}\), respectively. Then, the result S from Simulation 1 has \(\mathcal {O}((|\mathcal {D}|+|\mathcal {\overline {D}}|)^{2})\) nodes and edges.

Proof

Since we assume in the paper that the given structured d-DNNFs are smooth, we know that the size of the vtree T is not larger than the sizes of \(\mathcal {D}\) or \(\overline {\mathcal {D}}\). The modified vtree \(T^{\prime }\) is at most twice the size of T. Therefore, the number of nodes in S is asymptotically dominated by the size of |Y × Z| which is \(\mathcal {O}((|\mathcal {D}|+|\mathcal {\overline {D}}|)^{2})\). The number of edges is linear in the number of nodes in S. Therefore, we are done. □

Each node u in \(V\cup \overline {V}\) is mapped to a node (u, ) of S in Simulation 1. In order to prove that S is a syntactically correct SDD that represents the same function as \(\mathcal {D}\), we prove that each subcircuit S(u, ) represents the same function as \(\mathcal {D}_{u}\) or \(\overline {\mathcal {D}}_{u}\), respectively. For this reason we map each node u to a node in the modified vtree \(T^{\prime }\) which is the decomposition node of (u, ). Therefore, S(u, ) respects the subtree of \(T^{\prime }\) rooted at this node.

Remember that for each node v in the given vtree T there is a node with the same name in \(T^{\prime }\). Furthermore, if vars(v) is larger than two in T, the parent of v in \(T^{\prime }\) is denoted by \(v^{\prime }\).

Definition 14

Let \(T^{\prime }\) be the modified vtree in Simulation 1 and \(u \in V \cup \overline {V}\) be a node of the given structured d-DNNFs. The function node maps nodes of \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) to nodes of \(T^{\prime }\) in the following way.

$$ \begin{array}{@{}rcl@{}} \text{node}(u) := \begin{cases} v, & \text{ the node called }v \text{ in } T \text{ is } \text{d-node}({u}) \text{ in }T \text{ and } \\ & u \text{ is an } \wedge\text{-gate or } \text{vars}({v}) \text{ is at most two in }T\\ v^{\prime}, & \text{ the node called }v \text{ in } T \text{ is } \text{d-node}({u}) \text{ in }T, \text{vars}({v}) \text{ is }\\ & \text{larger than two, and } u \text{ is an } \vee\text{-gate}\\ \end{cases} \end{array} $$

Lemma 2

Let \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) be structured d-DNNFs w.r.t. a normalized vtree T that represent the Boolean functions f and \(\overline {f}\). Furthermore, let S be the result from Simulation 1 and \(T^{\prime }\) the modified vtree. Then, each node (u, ) of S is the root of a syntactically correct SDD S(u, ) w.r.t. the vtree Tnode(u). Moreover, S(u, ) represents the same Boolean function as \(\mathcal {D}_{u}\) for uV or \(\overline {\mathcal {D}}_{u}\) for \(u\in \overline {V}\), respectively.

Proof Proof idea

We give a proof by induction on the depth l of the subgraph S(u, ) of the SDD S in the Appendix which follows the lines of the proof of Lemma 3 in [4]. Here, the depth is the longest path to a leaf. □

As a result from Lemma 2, we know that S is a syntactically correct SDD that represents the same function as the given structured d-DNNF \(\mathcal {D}\).

Corollary 1

Let \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) be structured d-DNNFs w.r.t. a normalized vtree T that represent the Boolean functions f and \(\overline {f}\). Furthermore, let S be the result from Simulation 1. Then, S is a syntactically correct SDD w.r.t. the modified vtree \(T^{\prime }\) used in the simulation and S represents f.

Proof

The root of S is given by the node \((\text {root}({\mathcal {D}}), \emptyset )\) described in Simulation 1. Using Lemma 2 we know that \(S = S_{(\text {root}({\mathcal {D}}), \emptyset )}\) is a syntactically correct SDD w.r.t. the modified vtree \(T^{\prime }\) that represents the same Boolean function as the structured d-DNNF \(\mathcal {D}\). □

Theorem 1

Let f be a Boolean function such that f and \(\overline {f}\) can be represented by structured d-DNNFs \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) w.r.t. the same normalized vtree. Then, f can also be represented by an SDD of size \(\mathcal {O}((|\mathcal {D}|+|\overline {\mathcal {D}}|)^{2})\).

Proof

Using Simulation 1 we construct S for f w.r.t. the modified vtree \(T^{\prime }\) given the structured d-DNNFs \(\mathcal {D}\) and \(\overline {\mathcal {D}}\) representing the functions f and \(\overline {f}\) w.r.t. the same normalized vtree T. Using Corollary 1 we know that S is a syntactically correct SDD representing f. Moreover, from Lemma 1 we know that the size of S is at most quadratic w.r.t. the sizes of \(\mathcal {D}\) and \(\overline {\mathcal {D}}\). □

5 Concluding Remarks

To the best of our knowledge the question whether the complexity class that consists of all Boolean functions representable by polynomial-size structured d-DNNFs is closed under negation is open. We have shown how negation w.r.t. the same normalized vtree is useful to construct SDDs. For the construction we extended the given normalized vtree to a vtree with further auxiliary variables. It is open whether a similar construction exists without any auxiliary variables.