Alternation, Polynomial Time Hierarchy 1 Alternating Turing Machines

Computational Complexity Theory, Fall 2008
September 5
Lecture 4: Alternation, Polynomial Time Hierarchy
Lecturer: Kristoffer Arnsfelt Hansen
1
Scribe: Jakob Truelsen
Alternating Turing Machines
An Alternating Turing Machine (ATM) is a generalization of the nondeterministic TM. It is like a
nondeterministic TM but with the states divided into types.
Definition 1 (ATM) M is called an ATM if it has the following form:
M = (Q, Σ, Γ, q0 , δ, type), where
|Q| < ∞
Finite set of states
|Σ| < ∞
Finite set of input symbols
|Γ| < ∞ ∧ Σ ⊆ Γ
Finite set of tape symbols
q0 ∈ Q
The starting state
δ : Q × Γ → 2(Q∪{Ha ,Hr })×{L,R,S}×Γ The transition function
type : Q → {∧, ∨, ¬}
The type function.
For any configuration c, let Q(c) be the state of c and S(c) the set of all possible successor
configurations.
We further require that for any configuration c, type(c) = ”¬” ⇒ |S(c)| = 1.
We define the predicate “eventually accepting” EA(c) on a configuration c to be true iff any of
the following conditions are met:
• Q(c) = Ha
• type(Q(c)) = ” ∨ ” ∧ ∃c0 ∈ S(c) : EA(c0 )
• type(Q(c)) = ” ∧ ” ∧ ∀c0 ∈ S(c) : EA(c0 )
• type(Q(c)) = ”¬” ∧ {c0 } = S(c) ∧ ER(c0 )
where ER(c) is the predicate “eventually rejecting” which is true iff any of the following conditions are met:
• Q(c) = Hr
• type(Q(c)) = ” ∨ ” ∧ ∀c0 ∈ S(c) : ER(c0 )
• type(Q(c)) = ” ∧ ” ∧ ∃c0 ∈ S(c) : ER(c0 )
• type(Q(c)) = ”¬” ∧ {c0 } = S(c) ∧ EA(c0 )
We define L(M ) = {x ∈ Σ∗ |EA(initial configuration(x))}.
The definition of multi-tape, time consumption and space consumption is the same as always.
1
Definition 2 We will now define language classes for the ATMs.
ATIME(T (n)) is the class of languages accepted by an ATM in time O(T (n))
ASPACE(S(n)) is the class of languages accepted by an ATM in space O(S(n))
Lemma 3 All ¬-states can be eliminated at no cost.
Proof Let M = (Q, Σ, Γ, q0 , δ, t) be an ATM. Construct the dual machine M 0 = (Q0 , Σ, Γ, q00 , δ 0 , t0 ),
where Q0 ∩ Q = ∅, and we have a a bijective mapping from Q0 to Q; for q ∈ Q let q 0 ∈ Q0 be the
image of q in this mapping.
δ 0 is as δ but every state q has been replaced with q 0 , and Ha and Hr are swapped.

 ” ∧ ” if t(q) = ” ∨ ”
” ∨ ” if t(q) = ” ∧ ”
t0 (q 0 ) =

”¬” if t(q) = ”¬”
Now we define M̂ = (Q ∪ Q0 , Σ, Γ, q0 , δ̂, t̂)

 t(q) if q ∈ Q ∧ t(q) 6= ”¬”
t0 (q) if q ∈ Q0 ∧ t0 (q) 6= ”¬”
t̂(q) =

” ∧ ” otherwise

δ(q, γ) if q ∈ Q ∧ t(q) 6= ”¬”


 0
δ (q, γ) if q ∈ Q0 ∧ t0 (q) 6= ”¬”
δ̂(q, γ) =
δ 0 (q 0 , γ) if q ∈ Q ∧ t(q) = ”¬”



δ(q 0 , γ) if q ∈ Q0 ∧ t0 (q) = ”¬”
Figure 1: ¬ Elimination
Then, L(M̂ ) = L(M ). All that is needed for the proof is DeMorgan’s laws.
Thus, we do not gain anything using negation states.
Theorem 4 Assuming T (n) ≥ n, and S(n) ≥ log n, we will show the following inclusions for
complexity classes:
a) AT IM E(T (n)) ⊆ DSP ACE(T (n))
b) N SP ACE(S(n)) ⊆ AT IM E(S(n)2 ), S(n) ≥ n.
c) ASP ACE(S(n)) ⊆ DT IM E(2O(S(n)) )
2
d) DT IM E(T (n)) ⊆ ASP ACE(log T (n))
Proof
a) We can afford to store a path in the computation tree, as a sequence of numbers of leafs to
follow, as the outdegree of each node is a constant (the constant depends on the machine). We
can also afford to store an extra bit for each node on the path.
We will do a DFS traversal computing the “eventually accepting” predicate for every node in
the computation tree, ending up with the root, which holds the answer. For each node on the
current path, we will store the partial result of the predicate (we can evaluate a ∨ b ∨ .. ∨ z as
((a ∨ b) ∨ ..) ∨ z, the same goes for ∧).
To do this, we need T (n) to be space-constructible. However, we can avoid this assumption by
trying with increasing depth (starting from 0 and incrementing by 1) until the predicate of the
root can be calculated.
b) For configurations u, v, we define Reach(u, v, i) to be true iff there is a path from u to v in the
configuration graph of length ≤ 2i .
We want to compute Reach(s, t, O(S(n))) for all accepting configurations t.
Let E be the edges of the configuration graph, Reach can be defined as follows
Reach(u, v, i) ⇐⇒ u = v ∨ (u, v) ∈ E ∨ ∃w : Reach(u, w, i − 1) ∧ Reach(w, v, i − 1)
Build alternating machine, branch using ∨-type states over all configurations w (standard nondeterminism), branch in two for the ∧ using ∧-type state.
Guessing w takes time O(S(n)) because we have to guess an encoding of a configuration which is
O(S(n)) long, and we do O(S(n)) levels of recursion. Total time is thus as promised O(S(n)2 ).
c) We construct the configuration graph, each configuration has size S(n), so the entire graph
has size 2O(S(n)) . We will compute the “eventually accepting” predicate for each configuration.
First we mark the single accept configuration as “eventually accepting”, note we can have one
by erasing all tapes and reset all tapeheads when we accept. Then we do closure by rounds. In
every round, we check for each configuration if it leads to a configuration marked as “eventually
accepting”, and mark it if that is the case. We will need at most 2O(S(n)) rounds to complete
the closure, each taking time 2O(S(n)) . The total time is thus 2O(S(n)) · 2O(S(n)) = 2O(S(n)) .
d) We know that DT IM E(T (n)) ⊆ UL -SIZE(O(T (n)2 )). So it is enough to show that
UL -SIZE(O(T (n)2 )) ⊆ ASP ACE(log T (n)).
That is given a machine M that outputs a circuit of size O(T (n)2 ) in O(log T (n)) space, we
must construct a ATM that evaluates the circuit in only O(log(T (n))) space.
First a terminal gate can be calculated by running M (|x|),
An or-gate can be evaluated by finding both of its input gates by running M (|x|). And using
” ∨ ”-type states, evaluating the the input gates. We do only need to remember two gates to do
this.
3
An and-gate can be evaluated by finding both of its input gates by running M (|x|). And using
” ∧ ”-type states, evaluating the input gates. We do again only need to remember two gates to
do this.
An not-gate can be evaluated by finding its input gate by running M (|x|). And using ”¬”-type
states, evaluating the input gate. We only need to remember one gate to do this.
Corollary 5 As a corollary we see that combining a) and b) yields:
AT IM E(T (n)O(1) ) = DSP ACE(T (n)O(1) )
combining c) and d) yields:
ASP ACE(S(n)) = DT IM E(2O(S(n)) )
By defining:
AL = ASP ACE(log n)
AP
= AT IM E(nO(1) )
AP SP ACE = ASP ACE(nO(1) )
AEXP
O(1)
= AT IM E(2n
)
We have that
AL = P
AP
= P SP ACE
ASP ACE = EXP
AEXP
2
= EXP SP ACE
The Polynomial Time Hierachy (PH)
Definition 6 We recall the definiton of N P
N P = {L ⊆ Σ∗ |∃p ∈ R[x] ∧ R ∈ P : x ∈ L ⇐⇒ (∃y : |y| ≤ p(|x|) ∧ (x, y) ∈ R)}
We will now look at the language MIN-CNF. The language of CNF formulas that are minimal
in size.
D ∈ MIN-CNF ⇐⇒ ∀W ∃x : |W | < |D| ⇒ D(x) 6= W (x)
It is not at all obvious if MIN-CNF ∈ N P . So we define the polynomial time hierarchy, and this
contains classes where membership of MIN-CNF is obvious (and natural).
4
Definition 7 First for notational convenience we define:
∃p y := ∃y : |y| ≤ p(|x|)
∀p y := ∀y : |y| ≤ p(|x|)
Then we define the two sets of hierarchy classes
ΣPK = {L ⊆ Σ∗ |
∃p ∈ R[x], R ∈ P : x ∈ L
⇐⇒ ∃p y1 ∀p y2 ∃p y3 . . . Qp yk : (x, y1 , . . . , yk ) ∈ R}
ΠPK = {L ⊆ Σ∗ |
∃p ∈ R[x], R ∈ P : x ∈ L
⇐⇒ ∀p y1 ∃p y2 ∀p y3 . . . Qp yk : (x, y1 , . . . , yk ) ∈ R}
Definition 8 Next we define some appropriate subsets of ATMs:
Σk machine: ATM where for all inputs and for all computation paths, the configurations are in
k intervals. All configurations in the same intervals are of the same type, and the starting interval
is of type ∨.
Πk the same, but initial type is ∧.
Proposition 9 It follows that
Σpk = {L(M )|M is polytime Σk machine }
Πpk = {L(M )|M is polytime Πk machine }
It is easy to see that N P = ΣP1 and P = ΣP0 = ΠP0
Proof First assume L in Σpk , then it is easy to construct a ATM on the Σk form. First it uses
” ∨ ”-type states to guess y1 , then ” ∧ ”-type states to check y2 and so forth. Finally it runs the
polytime machine given by the definition.
Assume M is a polytime Σk machine and that x is accepted by M . Then there must exists a
sequence of nondeterministic choices y1 taken in the first interval, s.t. for any sequence of nondeterministic choices of y2 taken in the second interval, and so furth. We can check in deterministic
polytime that the given sequence of choices will lead to an accept state.
A similar argument works for Π.
Lemma 10 And we see that
co-Πpk = Σpk
Πpk ∪ Σpk = Σpk+1 ∩ Πpk+1
Proof In the first we note that complement swaps quantifiers and, P is closed under negation.
In the second we note that Πpk ⊂ Σpk+1 as we can drop the first ∃-quantifier, Σpk ⊂ Πpk+1 as we can
drop the first ∀-quantifier and Σpk ⊂ Σpk+1 and Πpk ⊂ Πpk+1 as we can drop the k + 1’th quantifyer.
Definition 11 Finally we define the polynomial hierarchy to be
[ p
[ p
PH =
Σk =
Πk ⊆ P SP ACE
k≥0
k≥0
5