
Relation of NC to Time-Space Classes 71
(iv) for one of the gates c, a tag indicating that c is the output gate.
We assume for simplicity that ∨-and∧-gates have exactly two inputs, ¬-
gates exactly one, and input ports none. Circuits with unbounded fan-in
can be simulated with at most an O(log n) factor increase in depth and at
most double the size.
Because we can construct the dual circuit in logspace (the construction
is similar to the proof of Lemma 7.3), we can assume without loss of gen-
erality that C
n
has no negate gates other than those applied immediately
to inputs. That is, if d is a negate gate and (c, d) is the unique wire coming
into d,thenc is an input port.
Now we design an alternating logspace machine N to simulate this
family of circuits. On input x of length n,themachineN will use M to
produce C
n
on the fly and evaluate C
n
(x). First N runs M to find the
name of the output gate and its type, which it writes on its worktape. Now
suppose some process of N has the name and type of a gate d written on
its worktape.
• If d is an ∧-oran∨-gate, it starts M from scratch, enumerating wires
to find the two wires (c, d), (c
,d) coming into d. When it has found
these wires, it makes an existential or universal branch according as
d is an ∨-or∧-gate, respectively. Each of the two subprocesses takes
one of c and c
and repeats.
• If d is an input port 1 ≤ d ≤ n, N accepts or rejects according as the
dth bit of the input x is 1 or 0, respectively.
• If d is a ¬-gate, N runs M to find the input port c such that (c, d)is
the unique wire coming into d. It accepts or rejects according as the
cth bit of the input x is 0 or 1, respectively.
The machine N needs no more than logarithmic space to do any of these
tasks, because all it has to remember at any time is the name of the current
gate c it is visiting. Moreover, the number of alternations that N makes is
bounded by the depth of the circuit it is simulating, which is (log n)
O(1)
.
(⊇) For this inclusion, assume that we are given an alternating logspace
machine N making at most (log n)
c
alternations on inputs of length n.We
wish to construct a logspace-uniform family of circuits of polylog depth
and polynomial size simulating N.
As argued in Theorem 7.4, we can assume without loss of generality that
N runs in polynomial time. Encoding configurations in some reasonable
way as strings over a finite alphabet, each configuration reachable from the
start configuration on an input of length n can be represented as a string
of length log n,andthereareonlyn
c
such configurations for some constant
c.