Size-Depth Tradeoffs For Boolean Formulae: Maria Luisa Bonet Samuel R. Buss
Size-Depth Tradeoffs For Boolean Formulae: Maria Luisa Bonet Samuel R. Buss
July 3, 2002
Abstract
We present a simplified proof that Brent/Spira restructuring of
Boolean formulas can be improved to allow a Boolean formula of
size n to be transformed into an equivalent log depth formula of size
O(nα ) for arbitrary α > 1.
Keywords: theory of computation, Boolean formulas, formula
complexity, size-depth tradeoff
1 Introduction
A Boolean formula is constructed from variables x, y, . . . and from Boolean
functions (also called ‘gate types’) such as AND (∧), OR (∨), NOT (¬),
PARITY (⊕), etc. Equivalently, a Boolean formula is a Boolean circuit with
fanout one. A basis B is a finite set of Boolean gate types, and a B -formula is a
formula using only gate types from B . When deriving asymptotic size bounds
on Boolean formulas, we always work with a fixed basis B and consider only
B -formulas.
It has been known for some time (Spira [4] and Brent [1]) that a Boolean
formula of size n can be transformed into an equivalent O(log n) depth
formula. Examination of the methods of Brent and Spira shows that this
transformation can yield a log depth formula of size O(nα ) with α = 2.1964.
We present a simple proof that for any α > 1 and arbitrarily close to 1, a
∗
Supported in part by NSF grant DMS-9205181
1
Boolean formula of size n has an equivalent O(log n) depth formula of size
O(nα ). We prove this for formulas over the basis AND, OR, NOT and also
for formulas over the basis PARITY, AND and 1. Our methods also for work
for other bases, e.g., B2 , the set of all binary gate types.
This improvement to arbitrary α > 1 has already been obtained by
Bshouty-Cleve-Eberly [2]. The advantage of our proof is that it is much
simpler. The reasons that our proof is simpler are (1) we deal only with
Boolean formulas while Bshouty-Cleve-Eberly deal with the more general
arithmetic case, and (2) we use a much simpler method of choosing break-
points in formulas based on a construction of Brent. Bshouty et.al. use a
more complicated extension of Brent’s construction. Our method of choosing
breakpoints could also be used in the algebraic case allowing simpler proofs
of the essential results of Bshouty,et.al.; however, we do not present this here.
d 13 me ≤ s ≤ b 23 mc.
We let B2 be the set of all binary Boolean gate types. Note that any
B2 -formula must be a binary tree.
2
Theorem 2 (Spira [4]) Let C be a B2 -formula of leafsize m. Then there is
an equivalent {∧, ∨, ¬}-formula C 0 such that,
depth(C 0 ) ≤ 2 · log3/2 m ≈ 3.419 log m
and such that
leafsize(C 0 ) ≤ mα
1+2α 1
where α satisfies 3α
≤ 2
(α ≥ 2.1964 suffices).
The proof of this theorem is by induction on the leafsize of C . The
induction step uses Lemma 1 to find a subformula D of C having leafsize s
satisfying d 13 me ≤ s ≤ b 23 mc.
We define C0 and C1 to be B2 -formulas obtained from C by the following
process: first replace the subformula D by 0 and 1, respectively. Now
eliminate the constants 0 and 1 by collapsing gates that contain a constant
as input (this removes at least one Boolean gate and might reduce the leafsize).
For a given truth assignment to the variables of C , if D has value 0 then
C has value equal to the value of C0 , and if D has value 1, then C has the
same value as C1 . Therefore C is equivalent to
E := (C0 ∧ ¬D) ∨ (C1 ∧ D).
∨ r
¡ @
¡ @
¡ @
ª
¡ R
@
∧ r ∧ r
¢ A ¢ A
¢ A ¢ A
¢ A ¢ A
®
¢ AU ¢® AU
r r r r
¢ A ¢ A ¢ A ¢ A
¢ A ¢ A ¢ A ¢ A
¢ C0 A ¢ ¬D A ¢ C1 A ¢ D AA
¢ A ¢ A ¢ A ¢
Figure 1
Now apply the induction hypothesis to C0 , C1 , D and ¬D to get
equivalent formulas C00 , C10 , D0 and (¬D)0 of logarithmic depth. Clearly
C is equivalent to the formula
C 0 := (C00 ∧ (¬D)0 ) ∨ (C10 ∧ D0 ).
3
Also the leafsize of C 0 is equal to the sum of the leafsizes of C00 , C10 , D0 and
(¬D)0 . Its depth is two plus the maximum depth of these four formulas.
From this it straightforward to obtain the constants 2 log3/2 m and α:
we leave this calculation to the reader, as we shall do a similar, but more
complicated calculation below. 2
It is possible to make an improvement to the constants in Theorem 2 if we
assume that C is a {∧, ∨, ¬}-formula instead of a general B2 -formula. This
improvement depends on the fact that only one occurrence of subformula D
is picked as a breakpoint. Note that if D is a positively occurring subformula
of C then C0 tautologically implies C1 , and otherwise, if D is negatively
occurring then C1 tautologically implies C0 . In the first case, when C0
tautologically implies C1 , we have that C is equivalent to both of the formulas
(see Figure 2):
C0 ∨ (D ∧ C1 ) and (C0 ∨ D) ∧ C1 .
∨ r
¡ @
¡ @
¡
ª
¡ @
R
@
r ∧ r
¢ A ¡ @
¢ A ¡ @
¢ C0 A ¡
ª
¡ @
R
@
¢ A r r
¢ A ¢ A
¢ A ¢ A
¢ D A ¢ C1 A
¢ A ¢ A
Figure 2
The point is that, unlike in the proof of Spira’s theorem sketched above,
it is unnecessary to include the subformula D twice in the formula E . This
4
of course will improve the constant α and give a better bound on the leafsize
of C 0 . However, even better (smaller) values for α can be obtained if we also
change the choice of breakpoints so that instead of having D be approximately
one half the size of C , we choose D to be some larger fraction of C . Intuitively,
this will help because the larger piece (that is, D ) will be used only once,
whereas the smaller piece (that is, C0 and C1 ) will be used twice.
The new breakpoints will be based on the following simple lemma:
Lemma 3 (Brent [1]) Let T be a tree with leafsize m, and 1 ≤ s ≤ m. Then
there is a subtree D such that D has leafsize ≥ s and such that its immediate
subtrees have leafsize < s.
Proof Any minimal subtree of T of leafsize ≥ s will suffice. 2
5
µ ¶α
m
leafsize(C00 ), leafsize(C10 ) ≤
k
and ³ ´
depth(DL0 ), depth(DR
0
) < (3 ln 2)k log k−1
k
m
³ ´
m
depth(C0 ), depth(C1 ) ≤ (3 ln 2)k log k
To study the worst case, let us set b = kDk = kDL k + kDR k. Thinking of b
as a constant, we can bound kC 0 k by
6
is at kDk = k−1
k
m. So the worst case happens when kC0 k and kC1 k are m
k
,
k−1
kDL k = k m and kDR k = 0. Thus we have the bound
³ ´α ³ ´α
leafsize(C 0 ) ≤ 2 m
k
+ k−1
k
m .
1
To finish the proof of Theorem 4 we must prove that for α = 1 + log(k−1)+1 ,
m α k−1 α α
we have 2( k ) + ( k m) ≤ m ; this is of course equivalent to showing that
2( k1 )α + ( k−1
k
)α ≤ 1. It is easy to see that the lefthand side of the inequality
is a decreasing function of α and to prove the inequality, it will suffice to let
α0 be the (unique) value, greater than 1, so that 2( k1 )α0 + ( k−1 k
)α0 = 1 and
1
prove that α0 < 1 + log(k−1)+1 . Multiplying the equation defining α0 by k α0 ,
we get that
k α0 − (k − 1)α0 = 2. (1)
Since α0 − 1 < log α0 for 1 < α0 < 2, (α0 − 1)(log(k − 1) + 1) < 1. So,
1
α0 − 1 <
log(k − 1) + 1
1
α0 < 1+
log(k − 1) + 1
7
Theorem 5 (See also Bshouty-Cleve-Eberly [2]) Let C be a {⊕, ∧, 1}-formula
of leafsize m. Then for all k ≥ 2, there is an equivalent {⊕, ∧, 1}-formula C 0
such that
depth(C 0 ) ≤ (3 ln 2) log m
and
leafsize(C 0 ) ≤ mα
1
where α = 1 + 1+log(k−1)
.
(D ∧ (C0 ⊕ C1 )) ⊕ C0 .
Figure 3
We claim that,
C0 ⊕ C1 ≡ Ai1 ∧ · · · ∧ Air
8
where {Ai1 , · · · , Air } is the subset of {A1 , · · · , As } that consists of the inputs
to ∧ gates. To prove this, first suppose that some Aij has value 0: then
C0 ⊕ C1 = 0 because the values of that conjunction in C0 and in C1 are equal,
and therefore C0 and C1 have the same value. On the other hand, suppose
all Aij ’s have value 1: then the values of the ∧-gates will depend on their
other inputs, and thus the value of Cx will depend on the value of x, which
implies that C0 ⊕ C1 has value 1.
Let A be the formula Ai1 ∧ · · · ∧ Air . The leafsize of A is obviously less
or equal than the leafsize of C0 . Now we can use the proof of Theorem 4 to
prove Theorem 5: the only difference is that instead of using the fact that C
is equivalent either to C0 ∨ (D ∧ C1 ) or to C1 ∨ (¬D ∧ C0 ), we now use the
fact that C is equivalent to (D ∧ A) ⊕ C0 . The calculations of the bounds on
leafsize and depth of C 0 are identical to those in the proof of Theorem 4. 2
References
[1] R. P. Brent, The parallel evaluation of general arithmetic expressions,
J. Assoc. Comput. Mach., 21 (1974), pp. 201–206.