0% found this document useful (0 votes)
26 views

Size-Depth Tradeoffs For Boolean Formulae: Maria Luisa Bonet Samuel R. Buss

Trabajo de investigacion

Uploaded by

Kevin Mondragon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Size-Depth Tradeoffs For Boolean Formulae: Maria Luisa Bonet Samuel R. Buss

Trabajo de investigacion

Uploaded by

Kevin Mondragon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Size-Depth Tradeoffs for Boolean Formulae

Maria Luisa Bonet Samuel R. Buss∗


Department of Mathematics Department of Mathematics
Univ. of Pennsylvania, Philadelphia Univ. of California, San Diego

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.

2 Near-linear size, log depth transformations


We shall identify Boolean formulas with rooted trees in which each node is
labelled with a Boolean gate type and each leaf is labelled with a variable
name. The depth of a formula or a tree is the maximum number of nodes
(Boolean gates) of arity ≥ 2 on any branch of the tree. Note that unary gates,
such as negations, do not count towards the depth. The leafsize of a formula
is the number of occurrences of variables in the formula, which is also equal
to the number of leaves in the tree. We use log and ln to denote logarithms
base two and e, respectively.
For expository purposes, we begin by giving the proof of a well-known
theorem of Spira. For this, we need the following lemma about choosing
breakpoints in a tree (of fanin ≤ 2) that split the tree roughly into half.

Lemma 1 (Lewis-Stearns-Hartmanis [3]) If T is a tree with all nodes having


arity at most 2, and if the leafsize of T is m where m ≥ 2, then there is a
subtree S of T with leafsize s, where

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 .

In the second case, when C1 tautologically implies C0 , we have that C is


equivalent to both of the formulas:

C1 ∨ (¬D ∧ C0 ) and (C1 ∨ ¬D) ∧ C0 .

∨ 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

Theorem 4 (See also Bshouty-Cleve-Eberly [2]) Let C be a {∧, ∨, ¬}-


formula of leafsize m. Then for all k ≥ 2, there is an equivalent {∧, ∨, ¬}-
formula C 0 such that

depth(C 0 ) ≤ (3k ln 2) · log m ≈ 2.07944k log m,

and such that


leafsize(C 0 ) ≤ mα ,
1
where α = 1 + 1+log(k−1)
.

Proof By induction on the leafsize m. If m = 1, C computes either xi or


¬xi , and C already has the desired leafsize and depth.
Let us assume now that the theorem applies to leafsizes up to m − 1,
and prove the theorem for m. Brent’s lemma provides a subformula D of
leafsize ≥ k−1 k
m and immediate subtrees DL and DR of leafsize < k−1 k
m:
let ∗ denote the gate type of D ’s root. Consider now the formulas C0
and C1 obtained from C by replacing the subformula D by the constants
0 and 1 respectively and then collapsing the gates that use them so that
leafsize(C0 ), leafsize(C1 ) ≤ k1 m. Now we use the induction hypothesis to
obtain formulas C00 , C10 , DL0 , and DR
0
so that
à !α
k−1
leafsize(DL0 ), leafsize(DR
0
) < m
k

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

Depending on whether D occurs positively or negatively as a subformula


of C , the formula C 0 is to be defined to be either C00 ∨ ((DL0 ∗ DR
0
) ∧ C10 ) or
C10 ∨ (¬(DL0 ∗ DR
0
) ∧ C00 ). In either case,

depth(C 0 ) = max{depth(DL0 ) + 3, depth(DR


0
) + 3, depth(C00 ) + 2, depth(C10 ) + 2}
< (3 ln 2)k log( k−1
k
m) + 3
= (3 ln 2)k log m + (3 ln 2)k log( k−1
k
)+3
= (3 ln 2)k log m + 3k ln 2 log( k−1
k
)+3
= (3 ln 2)k log m + 3k ln(1 − 1/k) + 3
< (3 ln 2)k log m + 3(−1) + 3
= (3 ln 2)k log m

The last inequality holds because ln(1 − 1/k) < −1/k .


For notational convenience, we now write kAk for the leafsize of A. We
can bound the leafsize of C 0 by:

kC 0 k ≤ 2(m − kDL k − kDR k)α + kDL kα + kDR 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

f (kDL k) = 2(m − b)α + kDL kα + (b − kDL k)α .

The function f is concave up, so the above expression is maximized at the


endpoints which are (1) kDL k = k−1k
m and kDR k = 0 and (2) kDL k = 0 and
kDR k = k−1
k
m. In either case, kC 0
k is bounded above by
³ ´α ³ ´α
2(m − kDk)α + k−1
k
m + kDk − k−1
k
m .

Again this is a concave up as a function of kDk, so the maximum values are at


the endpoints (1) kDk = m and (2) kDk = k−1 k
m. In this case, the maximum

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)

Now it must be that that α0 < 2, since k ≥ 2 and thus k 2 − (k − 1)2 =


2k − 1 > 2. Define gα0 (k) = k α0 . By the Mean Value Theorem, equation (1)
implies that there exists x, (k − 1) < x < k , such that

gα0 0 (x) = α0 xα0 −1 = 2.

Since gα0 0 is increasing, gα0 0 (k − 1) = α0 (k − 1)α0 −1 < 2. Taking logarithms


yields:

log(α0 (k − 1)α0 −1 ) < log 2 = 1


log α0 + (α0 − 1) log(k − 1) < 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

which completes the proof of Theorem 4. 2

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)
.

Proof First notice that if D is a subtree of C , then C is equivalent to:

(D ∧ (C0 ⊕ C1 )) ⊕ C0 .

This is because if D is 0 then C will have the same value as C0 , and if D is 1


then C will have the same value as C1 which is equivalent to (C0 ⊕ C1 ) ⊕ C0 .
Consider now Cx which has a new variable x substituted for D . Consider
the branch from x to the root of C as in Figure 3; the A1 , . . . , As are
subformulas of C which are inputs to gates having x in their other input.
r ⊕/∧
¢ A
¢ A
¢ Ar
As r p
⊕/∧
p
p
r ⊕/∧
¢ A
¢ A
¢ Ar
Ai r p
⊕/∧
p
p
r ⊕/∧
¢ A
¢ A
¢ Ar
A1 r x

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.

[2] N. H. Bshouty, R. Cleve, and W. Eberly, Size-depth tradeoffs for


algebraic formulae, in Proceedings of the 32th Annual IEEE Symposium
on Foundations of Computer Science, IEEE Computer Society, 1991,
pp. 334–341.

[3] P. L. II, R. Stearns, and J. Hartmanis, Memory bounds for recogni-


tion of context-free and context-sensitive languages, in Sixth Annual IEEE
Symp. on Switching Circuit Theory and Logical Design, 1965, pp. 191–202.

[4] P. M. Spira, On time hardware complexity tradeoffs for Boolean functions,


in Proceedings of the Fourth Hawaii International Symposium on System
Sciences, 1971, pp. 525–527.

You might also like