
CUUS063 main CUUS063 Goldreich 978 0 521 88473 0 March 31, 2008 18:49
SPACE COMPLEXITY
Recursive composition. Using Claim 5.7, we wish to obtain a O(t)-space oracle machine
that evaluates g
t
by making oracle calls to g
1
, where t = O(log |V
1
|). Such an oracle
machine will yield a log-space transformation of G
1
to G
t
(by evaluating g
t
at all possible
values). It is tempting to hope that an adequate composition lemma, when applied to
Claim 5.7, will yield the desired O(t)-space oracle machine (reducing the evaluation of
g
t
to g
1
). This is indeed the case, except that the adequate composition lemma is still to
be developed (as we do next).
We first note that applying a naive composition (as in Lemma 5.1) amounts to an ad-
ditive overhead of O(log |V
1
|) per each composition. But we cannot afford more than an
amortized constant additive overhead per composition. Applying the emulative composi-
tion (as in Lemma 5.2) causes a multiplicative overhead per each composition, which is
certainly unaffordable. The composition developed next is a variant of the naive composi-
tion, which is beneficial in the context of recursive calls. The basic idea is deviating from
the paradigm that allocates separate input/output and quer y devices to each level in the
recursion, and combining all these devices in a single (“global”) device that will be used
by all levels of the recursion. That is, rather than following the “structured programming”
methodology of using locally designated space for passing information to the subroutine,
we use the “bad programming” methodology of passing information through global vari-
ables. (As usual, this notion is formulated by referring to the model of multi-tape Turing
machine, but it can be formulated in any other reasonable model of computation.)
Definition 5.8 (global-tape oracle machines): A
global-tape oracle machine is de-
fined as an oracle machine (cf. Definition 1.11), except that the input-, output-, and
oracle tapes are replaced by a single
global-tape. In addition, the machine has a
constant number of work-tapes, called the
local-tapes. The machine obtains its input
from the global-tape, writes each query on this very tape, obtains the corresponding
answer from this tape, and writes its final output on this tape. (We stress that, as a
result of invoking the oracle f , the contents of the global-tape changes from q to
f (q).)
18
The space complexity of such a machine is stated when referring separately
to its use of the global-tape and to its use of the local-tapes.
Clearly, any ordinary oracle machine can be converted into an equivalent global-tape
oracle machine. The resulting machine uses a global-tape of length at most n + + m,
where n denotes the length of the input, denote the length of the longest query or
oracle answer, and m denotes the length of the output. However, combining these three
different tapes into one global-tape seems to require holding separate pointers for each
of the original tapes, which means that the local-tape has to store three corresponding
counters (in addition to storing the original work-tape). Thus, the resulting machine uses a
local-tape of length w + log
2
n + log
2
+log
2
m, where w denotes the space complexity
of the original machine and the additional logarithmic terms (which are logarithmic in the
length of the global-tape) account for the aforementioned counters.
Fortunately, the aforementioned counters can be avoided in the case that the original
oracle machine can be described as an iterative sequence of transformations (i.e., the input
is transformed to the first query, and the i
th
answer is transformed to the i + 1
st
query or
18
This means that the prior contents of the global-tape (i.e., the query q) is lost (i.e., it is replaced by the answer
f (q)). Thus, if we wish to keep such prior contents then we need to copy it to a local-tape. We also stress that,
according to the standard oracle invocation conventions, the head location after the oracle responds is at the leftmost
cell of the global-tape.
160