Oracle Turing Machines Nondeterministic OTM defined in the same way (transition relation, rather than function) oracle is like a subroutine, or function in your favorite PL but each call counts as single step e.g.: given 1, 2,, n are even # satisfiable? poly-time OTM solves with SAT oracle 3 Oracle Turing Machines Shorthand #1: applying oracles to entire complexity classes: complexity class C language A C A = {L decided by OTM M with oracle A with M in C} example: P SAT 4 Outline (Umans slides) Oracle Turing Machines The Polynomial-Time Hierarchy (PH) Quantified SAT Complete problems for classes in PH, PSPACE Oracle Turing Machines Oracle Turing Machine (OTM): multitape TM M with special query tape special states q?, q yes, q no on input x, with oracle language A M A runs as usual, except when M A enters state q? : y = contents of query tape y A transition to q yes y A transition to q no 2 1
The Polynomial-Time Hierarchy 0 = 0 = P 1 =P P 1 =NP 1 =conp 2 =P NP 2 =NP NP 2 =conp NP i+1 =P i i+i =NP i i+1 =conp i Polynomial Hierarchy PH = i i The Polynomial-Time Hierarchy 0 = 0 = P i+1 =P i i+i =NP i i+1 =conp i Example: MIN CIRCUIT: given Boolean circuit C, integer k; is there a circuit C of size at most k that computes the same function C does? MIN CIRCUIT 2 7 8 Oracle Turing Machines Shorthand #2: using complexity classes as oracles: OTM M complexity class C M C decides language L if for some language A C, M A decides L Both together: C D = languages decided by OTM in C with oracle language from D exercise: show P SAT = P NP The Polynomial-Time Hierarchy can define lots of complexity classes using oracles the following classes stand out they have natural complete problems they have a natural interpretation in terms of alternating quantifiers they help us state certain consequences and containments (more later) 6 5
Useful characterization Theorem: L i iff expressible as L = { x y, y x k, (x, y) R } where R i-1. Corollary: L i iff expressible as L = { x y, y x k, (x, y) R } where R i-1. Alternating quantifiers Nicer, more usable version: L i iff expressible as L = { x y 1 y 2 y 3 Qy i (x, y 1,y 2,,y i ) R } where Q= / if i even/odd, and R P L i iff expressible as L = { x y 1 y 2 y 3 Qy i (x, y 1,y 2,,y i ) R } where Q= / if i even/odd, and R P 11 12 The PH EXP PSPACE PSPACE: generalized geography, 2-person games 3rd level: V-C dimension 2nd level: MIN CIRCUIT, Succinct Set Cover, BPP 1st level: SAT, UNSAT, factoring, etc PH 3 3 3 2 2 2 NP conp P Useful characterization Recall: L NP iff expressible as L = { x y, y x k, (x, y) R } where R P. Corollary: L conp iff expressible as L = { x y, y x k, (x, y) R } where R P. 10 9
Complete problems Recall: MIN CIRCUIT: given Boolean circuit C, integer k; is there a circuit C of size at most k that computes the same function C does? { (C, k) C x ( C k and C (x) = C(x)) } Conclude: in 2 (open whether it is complete for 2 ) Complete problems three variants of SAT: QSAT i (i odd) = {3-CNFs (x 1, x 2,, x i ) for which x 1 x 2 x 3 x i (x 1, x 2,, x i ) = 1} QSAT i (i even) = {3-DNFs (x 1, x 2,, x i ) for which x 1 x 2 x 3 x i (x 1, x 2,, x i ) = 1 } QSAT = {3-CNFs for which x 1 x 2 x 3 Qx n (x 1, x 2,, x n ) = 1} 15 16 Alternating quantifiers Proof: ( ) induction on i base case: true for 1 =NP and 1 =conp consider L i : L = {x y 1 (x, y 1 ) R }, for R i-1 L = {x y 1 y 2 y 3 Qy i (x, y 1,y 2,,y i ) R} same argument for L i ( ) exercise. Alternating quantifiers Pleasing viewpoint: 2 3 2 2 NP conp const. # of alternations poly(n) alternations PSPACE PH i i 3 3 P 13 14
PH collapse recall: L i+1 iff expressible as L = { x y (x, y) R } where R i since i = i, R expressible as R = { (x,y) z((x, y), z) R } where R i-1 together: L = { x (y,z) (x, (y,z)) R } conclude L i Natural complete problems We now have versions of SAT complete for levels in PH, PSPACE Natural complete problems? PSPACE: games PH: almost all natural problems lie in the second level 19 20 QSAT is PSPACE-complete Theorem: QSAT is PSPACE-complete. Proof: in PSPACE: x 1 x 2 x 3 Qx n (x 1, x 2,, x n )? x 1 : for each x 1, recursively solve x 2 x 3 Qx n (x 1, x 2,, x n )? if encounter yes, return yes x 1 : for each x 1, recursively solve x 2 x 3 Qx n (x 1, x 2,, x n )? if encounter no, return no base case: evaluating a 3-CNF expression poly(n) recursion depth poly(n) bits of state at each level PH collapse Theorem: if i = i then for all j > i j = j = j = i the polynomial hierarchy collapses to the i-th level Proof: sufficient to show i = i+1 then i+1 = i = i = i+1 ; apply theorem again 17 18
Simpler version of MIN DNF Theorem (U): MIN DNF is 2 -complete. we ll consider a simpler variant: IRREDUNDANT: given DNF, integer k; is there a DNF consisting of at most k terms of computing same function does? Boolean circuits circuit C directed acyclic graph nodes: AND ( ); OR ( ); NOT ( ); variables x i x 1 x 2 x 3 x n C computes function f:{0,1} n {0,1} in natural way identify C with function f it computes 23 24 Natural complete problems MIN CIRCUIT good candidate, still open MIN DNF: given DNF, integer k; is there a DNF of size at most k computing same function does? example: x 1 x 2 x 3 x 1 x 2 x 3 x 4 Natural complete problems MIN CIRCUIT good candidate, still open MIN DNF: given DNF, integer k; is there a DNF of size at most k computing same function does? example: x 1 x 2 x 3 x 1 x 2 x 3 x 4 x 1 x 2 x 4 21 22
Connection to TMs TM M running in time t(n) decides language L can build circuit family {C n } that decides L size of C n = O(t(n) 2 ) Proof: CVAL construction Conclude: L P implies family of polynomial-size circuits that decides L Uniformity Strange aspect of circuit family: can encode (potentially uncomputable) information in family specification solution: uniformity require specification is simple to compute Definition: circuit family {C n } is logspace uniform iff TM M outputs C n on input 1 n and runs in O(log n) space 27 28 Boolean circuits size = # gates depth = longest path from input to output formula (or expression): graph is a tree every function f:{0,1} n {0,1} computable by a circuit of size at most O(n2 n ) ANDof n literals for each x such that f(x) = 1 OR of up to 2 n such terms Circuit families circuit works for specific input length we re used to f: * {0,1} circuit family : a circuit for each input length C 1, C 2, C 3, = {C n } {C n } computes f iff for all x C x (x) = f(x) {C n } decides L, where L is the language associated with f 25 26
Parallelism the NC ( Nick s Class ) Hierarchy (of logspace uniform circuits): NC k = O(log k n) depth, poly(n) size NC = k NC k captures efficiently parallelizable problems not realistic? overly generous OK for proving non-parallelizable 31 Uniformity Theorem: P = languages decidable by logspace uniform, polynomial-size circuit families {C n }. Proof: already saw ( ) ( ) on input x, generate C x, evaluate it and accept iff output = 1 Parallelism uniform circuits allow refinement of polynomial time: circuit C depth parallel time size parallel work 29 30