p216 Schaefer

download p216 Schaefer

of 11

Transcript of p216 Schaefer

  • 8/11/2019 p216 Schaefer

    1/11

  • 8/11/2019 p216 Schaefer

    2/11

    (e) Every relation in S is definable by a CNFformula having at most 2 liter al s in eachconjunct.

    (f ) Every relation in S is the set of solutionsof a system of linear equation over the two-element fiel d {0,1}.

    Sections 2-4 are devoted to the statement andproof of thi s Dichotomy Theorem. (Although we usethe word "dichotomy" to describe thi s resul t, i t

    should be borne in mind that the dichotomy holdsonly i f P#NP; i f P=NP, the dichotomy would col-lapse.)

    A variat ion of the problem consists of allow-the constants 0 and l to occur in input formulas(e.g. a clause R(x,O,y) is allowed). Wedenotethis "satisf iabil ity-with-constants" problem bySATc(S)~ Our results for SATe(S) are sharper thanfor SAT(S): we obtain a compTete characterizationup to log-space equivalence. For any fini te set Sof logical relations, SATc(S) li es in one of sevenlog-space equivalence classes, described as follows:

    I. SATc(S) is decidable deterministical ly in logspace.

    2. The complement of SATe(S) is log-equivalent to

    the graph reachabili t~ problem (given a graph Gand nodes s,t of G, do s and t lie in the sameconnected component of G?).

    3. The complement of SATe(S) is log-equivalent tothe digraph reachabil~ty problem (given a direc-ted graph G and nodes s, t of G, is there a di-rected path from s to t?). In this case,SATc(S) is log-complete in co-NSPACE(Iog n).

    4. SATc(S) is log-equivalent tothe problem of deciding whether a graph isbipartite.

    5. SATc(S) is log-equivalent to the problem ofwhether an arbi trary system of li near equationsover the fi eld {0, ]} is consistent.

    6. SATc(S) is log-complete in P.

    7. SATc(S is log-complete in NP.

    This result is presented in Section 5. For "most"sets S, SATc(S is essentially ident ical to, andhas the same complexity as, SAT(S). (See Lemma 4.2.)Of course, i t is not known that the above sevenclasses are distinct.

    In Section 6, we present a polynomial-spaceanalogue of the Dichotomy Theorem, involving quan-ti fied formulas. Wedefine QFc(S) to be the analogof SATc(S) in which formulas contain universal andexistential quantifiers quantifying the proposition-al variables. The main theorem of this sectionstates that for any fi ni te set S of logical rela-tions, QFc(S is ei ther polynomial-time decidable

    or log-complete in polynomial space. For bothQFc(S ) and SATc(S) the polynomial-time decidableca~es are just- the cases (c) -( f) li sted above;cases (a) and (b) are excluded.

    Wemen~ion here a few par ticular completenessresults whic~fol low from these general theorems.Problems NPI,NP2 and NP3 are NP-complete.

    NPI. ONE-IN-THREE SATISFIABILITY

    Given sets S . . . . . S_ each having at most 3 mem-bers, is there a subset T of the members suchthat for each i, ITnSiJ = l ?

    NP2. NOT-ALL-EQUAL SATISFIABILITY

    Given sets S. , . .. ,S m each having at most 3members, canlthe meJiibers be colored with twocolors so that no set is all one color?

    NP3. TWO-COLORABLE PERFECT CATCHING

    Given a graph G, can the nodes of G be coloredwith two colors so that each node has exactlyone neighbor the same color as itsel f? (G maybe restri cted to be planar and cubic.)(Theorem 7.1)

    Problems PI and P2 are log-complete in P.

    Pl.

    P2.

    SAT3W(Weakly Positive Sati sf iabili ty )

    Given a CNF formula having at most 3 l iteralsin each clause, and having at most one negatedvariable in each clause, is i t sati sfiable?(Corollary 5.2)

    NOT-EXACTLY-ONE SATISFIABILITY

    Given sets S .. . . . S m each having at most 3members, and'a distTnguished member s, can onechoose a subset of the members, containing s,so that no set has exactly one member chosen?(Corollary 5.2)

    This paper contains a ful l proof of theDichotomy Theorem. The other resul ts are, for themost part, stated without proof.

    Technical Note. The def init ion of "logical relation"given above is deficient in that i t fai ls to dif fe r-entiate between empty relat ions of diff er ing ranks.Therefore, we formally define a logical relation tobe a pair (k,R) with R~{O,1}k; but informally weshall continue to regard R i t self as being therelation.

    2. THE DICHOTOMY THEOREM

    This section states and discusses the mainresult of this paper, the following theorem.

    Theorem 2.1. (Dichotomy Theorem for Sa tisf iab ility) .Let S be a fi ni te set of logical relations. I f Ssat isf ies one of the conditions ( a) -( f) below, thenSAT(S) is polynomial-time decidable. Otherwise,SAT(S) is log-complete in NP. (See below fordefinitions).

    (a) Every relation in S

    (b) Every relation in S

    (c) Every relation in S

    (d) Every relation in S

    (e) Every relation in S(f) Every relat ion in S

    is O-valid.

    is l-valid.

    is weakly positive.

    is weakly negative.

    is affine.is bijunctive.

    Definitions.(The following defini tions were all invented forthis paper and should not be assumed to agree withterminology used elsewhere.)

    The logical relation R is O-valid i f (0 ... .. O)E R. The logical relat ion R is l- val id i f(I .. .. . I)~R.

    2 1 7

  • 8/11/2019 p216 Schaefer

    3/11

    The logic al rel at ion R is weakly pos iti ve(resp. weakly negative) i f R(x .. . . ) is l ogi ca ll yequ iva len t to some CNF f o r ~ l a having at mo st onenegated ( resp. unnegated) va ri ab le in each con-junct.

    The logical relat ion R is b ijunc tive ifR(x I .. . . ) is lo gi ca ll y equivalent to some CNF for -~ul~ having at most 2 l it er a ls in any conjunct.

    The logical relat ion R is af fine if R(x .. . . )is logically equivalent to somesy--~m of-linearequations over the two-element fi el d {0 , I} ; that

    is, if R(x~ .. . ) is log ic all y equivalent to a con-jun ct io~ o~ formulas of the forms ~I ~ ~Cn = 0and ~l ~' '' ~n =l , where ~ denotes additi onmodulo 2.

    Compl exit y-th eore tic notion s, such as P, NP,log-space reducibility, etc. are defined briefly inthe Appendix.

    Exampl es

    The re la t ion RI ={( l ,O, O,O ) , ( O, l , l , O) , (O, l ,O , l ) ,( I , 0 , I , I ) } i s a ff in& s inc e~i ( u ,x ,y, z ) i s equ iva l-en t to (u~x: l )A(x~ymz:O}.

    The relation R 2 = { ( 0 , 0 , 0 ) , ( 0 , 0 , I ) , ( 0 , I , 0 ) ,(I ,I ,0 )} is bi jun ct ive and weakly negative, since~2(x ,y,z ) i s equ iva len t to ( - I xVy) A(4y v- l z ) .I~ is also, obviously, O-valid.

    The relation R 3={ (0 ,I ) , (I ,0 )} is defined bythe formula (xv y) ~(~ xv~ y) , or equivalent ly,x~ y= I. Hence this relat ion is bi junct ive andaf fi ne. I t i s not, however, weakly pos iti ve orweakly negat ive - - th is can be shown using Lemma3.1W.

    The relat ion R = {( 0, 0,0 ) , (I , I , I )} is definedby the formula (xmy) A(ymz), or eq uiv ale ntl y,( x v ~ y ) A ( y V I x ) A ( y v ~ z ) A ( Z ~ - I y ) . He nc e, i tis O-valid, l-valid, weakly positive, weakly nega-t ive, aff ine and bi junct ive.

    The re la t ion R~={(O,O, I ) , (O, I ,O) , (O, I , I ) ,(I ,O ,O ), (I ,O ,I ), (I ,T ,O )} is the complement of R 4.It does not have any of the six properties li st edfo r R -- th is can be proved using Lemmas 3.1A,3.1B, and 3.1W. Thus, t hi s example shows th at noneof these properties is preserved under complement.

    The re la t ion R ={(0 ,0 , I ) , (0 , I ,0 ) , ( I ,0 ,0 ) } i sthe re la ti on ex act ly one of three mentioned inthe In tr od uc ti on . I t can be shown, using Lemmas3.1A, 3.1B and 3.1W, tha t i t is not weakly po si ti ve ,not weakly negative, not affine and not bijunctive.

    By applyi ng Theorem 2.1 w it h S={R 5} and S={R6}re sp ec ti ve ly , i t can be deduced th at tee NOT-ALL vEQUAL and ONE-IN-THREE s a t i s f i a b i l i t y problems,def ined in Section I , age log- complete in NP. Weomit the proofs.

    Method of Proof

    The key question on which the proof of theDichotomy Theorem cent ers is : For a given S, whatrelat ions are definable by exis ten t i al l y quantif iedS-formulas? For example, i s S={R}, where R is therel ati on exactlY one of x, y, z, then the exist en-tially quantified S-formula (3Ul,U2,U3)(R(X,Ul,U3)AR(y,up,uR)A~(Ul,U2,Z)) defines the relation{(T ,I , I) , (T, O,O ),( O,I ,O) ,(O ,O, I)} , which in thenotation of Section 3 could be wri tte n [x ~y ~z =l ].

    Moreover, for this particular S, it turns out thatevery logic al rel at ion is definable by some exi s-ten t i al l y quantif ied S-formula. This fact readi lyimplies the NP-completeness of SAT(S).

    Another way to state this fact is as a closurepropert y: The smalle st set of rel at io ns which con-tain s S and is closed under certa in operations (con-junction and exi ste nti al quant ific atio n) is theset of all logical relat ions. From this point ofvie w, the general problem can be phrased as fo l -lows: What sets of l ogic al rel ati ons are closedunder these operations? I f we can obta in a reason-ably succinct classification of the sets of rela-tions that are closed in this way, then this mayserve as a basis for classifying the complexity ofSAT(S) for various S.

    We do in f act obtain a cl as si fi ca ti on theoremalong these li ne s. Section 3 is devoted to it sstatement and proof, and a refinement of it isgiven in Section 5. This theorem cl as si fi es thesets of logical relations that are closed undercomposition, substitution of constants for varia-bles, and ex is te nt ia l quant ifi cat ion . Although thecl as si fi ca ti on is not so thorough as to give a com-ple te enumeration of the sets having th is closu reproperty, it does permit the complexity of thecorresponding sa ti sf ia bi li t y problem to be deter-

    mined up to log-space equivalence in al l cases.The closure of the set S under these threeoperations is denoted Rep(S). I t is int er es ti ngto note that the corresponding satisfiability-with-constants problem, SATc(S), is NP-complete justwhen Rep(S) is the set of al l logi cal rel ati ons .Thus, NP-completeness is closely tied to a kind offun cti onal completeness. (In Section 3 of [Sch]we observed and exp loi ted a si mi la r lo gi ca l com-pleteness proper ty which is probably exh ibi ted insome form by a l l known NP-complete problems. )

    Relation to Earlier Work

    The work presented here is similar in spiritto the classification by Post [P] of the sets oflogical functions that are closed under functionalcomposition. In both cases, it is shown tha t func-ti on al completeness holds provided th at the gener-ating set is not included in one of a finite numberof restricted classes of functions or relations.But the generating operations are quite different,and to the best of our knowledge, none of the pa r-ticulars of Post's proof carry over to this work.

    Our generalized sa t is fi ab il it y problem em-braces, as pa rt ic ul ar cases, a number of pre vio usl ystudied problems. Of the NP-complete cases, so faras we know, only the standard CNF s at is f i a bi li t yproblem with 3 literals per clause has appeared inthe li te ra tu re [C]. Of the polynomial-time decid-able cases, all are eith er tr iv ia l or previouslyknown. The s at is f ia bi l it y problem fo r weakly nega-tive formulas is essentially identical to the prob-

    lem ca ll ed UNIT which is shown to be complete in Pin [JL]. A res tri cte d form of weakly posi tivesa t is fi ab il it y is equivalent (under complement) tothe digraph reachability problem, a complete prob-lem in no ndet ermin isti c log space [Sav] . Our workmakes use of a l l these ea r li e r completeness r e-sul ts .

    2 1 8

  • 8/11/2019 p216 Schaefer

    4/11

    3. CLA SSIFICAT ION OF LOGICAL RELATIONS

    T h is s e c t io n p r e s en t s t h e c l a s s i f i c a t i o n t h e -o r e m ( Th eo re m 3 .0 ) w h i c h i s t h e e s s e n t i a l p a r t o fthe p roof o f the Dicho tomy Theorem. Th i s theoremc l a s s i f i e s t h e s e t s o f l o g i c a l r e l a t i o n s t h a t a r ec l o s e d u n d er c e r t a i n o p e r a t i o n s ( c o n j u n c t i o n , s u b -s t i t u t i o n o f co n s ta n t s fo r v a r i a b l e s , an d e x i s t e n -t i a l q u a n t i f i c a t i o n ) , s h ow in g t h a t a n y s uc h s e tc o n s i s t s e x c l u s i v e l y o f r e l a t i o n s w h ic h a re i n o neo f t h e f o u r c l a s s e s w e a k ly p o s i t i v e , w e a k l y n e g a-

    t i v e , a f f i n e o r b i j u n c t i v e , o r e l s e is t h e s e t o fa l l l o g i c a l r e l a t i o n s .A k e y p a r t o f t h e p r o o f , w h i c h i s a l s o o f i n -

    d e p e nd e n t i n t e r e s t , i s a s e r i e s o f l e m m a s ( Le mm as3 . 1 A , 3 .1 B an d 3 . IW ) w h i ch c h a r a c t e r i z e t h e s e f o u rc l a s s e s o f r e l a t i o n s i n s e m a n ti c t e r m s , t h a t i s ,i n t e r m s o f w h a t e l e m e n t s a r e i n t h e r e l a t i o n ,r a t h e r t h a n i n t e r m s o f d e f i n i n g f o r m u l a s a s i nt h e d e f i n i t i o n s .

    T he r e s u l t s o f t h i s s e c t i o n d e a l p u r e l y w i t hl o g i c a l r e l a t i o n s ; n o c o m p l e x i t y - t h e o r e t i c n o ti o n sa r e i n v o l v e d .

    D e f i n i t i o n s

    T he d e f i n i t i o n o f S - f o r m u l a w as g i v e n i n S e c -t i o n I . We u se t h e te r m f o r m u l a i n a l a r g e r s e n s e ,t o m e an a n y w e l l - f o r m e d f o r m u l a , f o rm e d f ro m v a r i -a b l e s , c o n s t a n t s , l o g i c a l c o n n e c t i v e s , p a r e n th e s e s ,l o g i c a l r e l a t i o n s ym b ols a nd e x i s t e n t i a l a nd u n i -v e r s a l q u a n t i f i e r s - - t h e i n t e n t h e re i s t o i n -c l u d e w h a t ev e r n o t a t i o n i s h an dy f o r e x p r e s s i n g ar e l a t i o n a mo ng p r o p o s i t io n a l v a r i a b l e s .

    To c l a r i f y t he s e t e rm s : ( a ) A v a r i a b l e , f o rp u r p os e s o f t h i s p a p e r, i s a n e l e m e n t o f t h e s e t{ X ,X n , Xl . . . . . Y, Y n , Y l . . . . , z , z n , . . . . U ,U o . . . , v , v n , v l ,. . . } T Va r i a b le s ~ l i k e f o r m u I a s, ar e s t r i n g s o fs y m b o l s ; a nd w e c o n s t r u e , e . g . , t h e v a r i a b l e x 1 8t o be a s t r i n g o f l e n g t h 3 . ( b ) A c o n s t a n t i s o neo f th e sy m bo ls 0 , I ( l = t r u e , O = f a l s e ~ 7 - - ( - ~ A l o g -i c a l c o n n e c t i v e i s on e o f th e sy m bo ls - 1 , ^ , v,+ , z , ~ w h i c h h av e t h e i r u s u a l m e an in gs o f " n o t " ," a n d " , " o r " , " i m p l i e s " , " e q u a l s " , "d o es n o t e q u a l . "( d ) E a c h l o g i c a l r e l a t i o n R h as a s s o c i a t e d w i t h i ta l o g i c a l r e l a t i o n s y m b o l, d en o te d ~ , a s in S e c t i o nI . ( e ) T he q u a n t i f i e r s ( 3 x ) a nd ( V x) a r e i n t e r -p r e t e d t o m e a n " f o r s om e x e { 0 , I } " a nd " f o r a l lx ~ { 0 , I } " .

    A l i t e r a l i s a v a r i a b l e o r a n e ga te d v a r i a b l e ,i . e . , ~ o r - ~ f o r s o m e v a r i a b l e ~ .

    T he n o t a t i o n R ( x l . . . . ) i s s h o r t h a n d f o r~( x I . . . . . x k ) where~k ~s the rank o f R .

    I f A i s a f o r m u l a , t h e n Va r ( A ) d e n o te s t h es e t o f f r e e ( i . e . , u n q u a n t i f i e d - ~ r i a b l e s o c c ur -r i n g i n A. A n a s s i g n m e n t f o r A i s a f u n c t i o ns : V a r ( A ) + { O , l } . We s a y t h e a s sig n m en t s s a t i s f i e sA i f s m a ke s A t r u e u n d e r th e u s u a l r u l e s o f i n t e r -p r e t a t i o n .

    We d e f i n e S a t ( A ) t o b e t h e s e t o f a l l a s s i g n -m en ts s : V a r ( A ) + - ~ w h ic h s a t i s f y A . Two f o rm u -l a s A a nd B a r e l o g i c a l l y e q u i v a l e n t i f Va r (A ) =Va r ( B ) a n d S a t ( A ) = S a t ( B ) .

    L e t A b e a fo r m u l a , V ~ V a r ( A ) , a nd i ~ { 0 , I } .

    Then KA d e n ot es t h e a s s ig n m e n t s : V a r ( A ) { O , l }i , Vdefined by s(~): i i f f ~EV. Usually we wri te jus tK: ,, and let the domain be inferred from context.K 'Vdenotes the assignment which has the constantv~lue i; again the domain is inferred from context.

    I f A is a formula, ~ is a variable, and w is

    a li t er al , then A[#] denotes the formula formedfrom A by replacing each occurrence of ~ by w. If

    V is a set of variables, then A[~] denotes the re-sul t of substi tut ing w for everyWoccurrence ofevery variable in V. Multiple substitut ions are

    V' V"denoted by expressions such as A[~, w, ,w, ,] withobvious meaning.

    The set of existentially quantified S-formulaswith constants is denoted Gen(S). Specif ically,Gen(S) is the smallest set of formulas such that( a ) f o r a l l R ~ S , ~ ( x I . . . . ) ~ G e n ( S ) , a n d ( b ) f o ra l l A , B ~ G e n ( S ) an d a l l v a r i a b l e s ~ ,n , t h e f o l l o w -i n g are all in Gen(S): A~B, A[~], A[~], A[f]and (3~)A.

    Gen+(S) denotes the set of al l formulas whichare logicall y equivalent to some formula in GentS).

    If A is a formula, then we denote by [A] thelogical relation defined by A, when the variablesare taken in lexicographic order. For example,[z~(xvy)] is the 3-place relation {(0,0,I),(0,I,0),( l ,o ,o) , ( i , l ,o)} .

    F i n a l l y w e d e f i n e R e p (S ) : = { [ A ] : A e G e n ( S ) } .R e p ( S ) i s t h e s e t o f r e l a t i o n s t h a t a r e " r e p r e s e n t -a b l e " by q u a n t i f i e d S - f o r m u l a s w i t h c o n s t a n t s . O b-s e rv e t h a t i f S ~ S ' , th e n R e p ( S ) ~ R e p ( S ' ) .

    C l a s s i f i c a t i o n T h eo r em f o r R ep (S )

    T he ore m 3 . 0 . L e t S b e a n y s e t o f l o g i c a l r e l a t i o n s .I f S s a t i s f i e s o n e o f t h e c o n d i t i o n s ( a ) - ( d ) b e lo w,t he n R ep (S ) s a t i s f i e s t h e s am e c o n d i t i o n . O t h e r -w i s e , Re p( S) i s th e s e t o f a l l l o g i c a l r e l a t i o n s .

    (a) Every relation in S is weakly positive.(b) Every relation in S is weakly negative.(c) Every relat ion in S is aff ine.(d) Every relat ion in S is bijunct ive.

    T he r e m a i n d e r o f t h i s s e c t i o n i s d e v o t e d tot h e p r o o f o f T h e o re m 3 . 0 .

    Lem ma 3 . 1 A . L e t R b e a l o g i c a l r e l a t i o n a nd l e t~ I ~ . . ) . T h e n R i s a f f i n e i f a n d o n l y i f

    A:=for I s i , s 2 , s 3 c S a t ( A ) , S l ~ S 2 ~ S 3 ~ S a t ( A ) .

    P r o o f . We u se t h e f o l l o w i n g f a c t , w h i ch ca n b ep r ov e d u s in g e le m e n t a r y l i n e a r a l g e b r a . I f K i s af i e l d , t he n a s u b s e t D ~ K n i s t h e s o l u t i o n s e t o f as y st em o f l i n e a r e q u a t io n s o v e r K i f f f o r a l lb l , b 2 , b 3 ~ D a nd a l l c i 2, c c ~ K w i t h c i 2 +c + c = I ,C lb I + c 2 b 2 + c 3 b 3 e D . I n c as e K i s t h e f l e l ~ { 0 , I } ,t h i ~ c o n d i t i o n i s e q u i v a l e n t t o " t h e sum o f a n yt h r e e e l em e n t s o f D i s i n D . " S i nc e R i s a f f i n ei f f A i s e q u i v a l e n t t o a s y st em o f l i n e a r e q u a t i o n so v e r { 0 , I } , t h e le mm a f o l l o w s f ro m t h i s f a c t . [ ]

    R em ar k. T he c a r d i n a l i t y o f an a f f i n e r e l a t i o n i sa l w a y s a p o we r o f 2 . ( T h i s f o l l o w s f r o m s t a n d a r d

    r e s u l t s i n l i n e a r a l g e b r a . ) T h i s f a c t i s o ft e n o fu se f o r s h ow in g t h a t a r e l a t i o n i s n o t a f f i n e .

    We no w d e f i n e s o m e t e r m i n o l o g y f o r t h e n e x tlemma.

    I f ~ i s a v a r i a b l e , we u se t h e n o t a t i o n < ~ , i >t o d e n o te t h e l i t e r a l ~ i f i : l a nd ~ C i f i =O . A si s c u s t o m a r y, ~ d e n o t e s t h e c o m p l e m e n t a r y l i t e r a lo f ~ , t h a t i s , t h e l i t e r a l < ~ , l - i > w h ere ~ = < ~ , i > .We s a y t h e l i t e r a l ~ = < ~ , i > i s c o n s i s t e n t w i t h af o r m u l a A i f s ( ~ ) = i f o r s om e s ~ S a t ( A ) . We s a y t h e

    2 1 9

  • 8/11/2019 p216 Schaefer

    5/11

    assignment s a~rees with the l i t er al ~ i f e= for some variable ~. A set of l i t er al sis consistent i f i t does not contain ~ and ~ forany literal ~.

    I f s is an assignment and Q is a consistentset of l i t eral s , we denote by s#Q the assignmentwhich di ffe rs from s just on the set {~ : ~ Q}.

    Let e be a l i t er al and A a formula. We defineImPA(e) to be the set of al l l i t er al s B such thatevery s ~ Sat(A) which agrees with ~ also agrees

    with 8. Thus, ImPA(e) is the set of l i t er al s whichare "implied" by tSe li t er al e. For example, i fA= xvy , then ~ ImPA().

    Let A be a formula ~nd s ~Sat(A). A chan~eset for (A,s) is any set V~Var(A) such thatsBK] V eSat(A)" Tha t is, V is a change set for(A,s)' i f f the assignment which di ff er s from sjus t on V sat isf ies A.

    Lemma 3.1B. Let R be a logical relat ion and le tA:=B(x . . . . ). Then the following are equivalent:

    (a) R is bijunct ive.

    (b) For every s ~ Sat(A), i f V and V 2 are changesets for (A,s) then so is VImV 2.

    (c) For every s ~ Sat(A) and every l i t er alwhich is consistent with A, s#ImPA(e ~Sat(A).

    (See Note on last page of th is section.)Proof.(a)~(b-T?-. Assume R is bi junct ive. Thus, Ais log ic al ly equivalent to some formula B which isa conjunction of clauses of the form (~+B), where~,B are li t eral s. Let s~Sat(A) be given, and le tVI,V2 be change, sets for (A,s). Let Q be the small-est set of l~te rals such that (a) { :q~Vln V ~}eQ, and (b) whenever ~Q and (~+ 8) or(B ~) is a conjunct of B fo r some l i t eral 8, then8~Q. Clear ly, any assignment t~Sat(B) which di f -fers from s on al l of Vlf%V 2 must agree with everyl i t eral in Q. Since SKl,Vl is such an assign-ment, Q is consistent and Q cannot contain any l i t -eral with n~V~ . Simi lar ly, Q cannot

    contain any l i t eral with n~V 2. Hence,s#Q = sKI,v, nV " I t is straightforward to showthat s#Q sati~fie~ every conjunct of B; henceSKl, V nV ~Sat(B) = Sat(A). Hence V mV2 is a

    1change set ~or (A,s).

    (b)-->(c): Assume that (b) holds. Let s ~Sat(A),and let ~ be a l i t e ral consistent with A. Wewantto show that s#ImPA(e ~ Sat(A). AssumeTthat s dis-agrees with ~; that is, ~ = f or somevariable ~. Let W:={n : ~ImPA(~)};that is, W s the set of variables on which ImPA(~clashes with s. We claim that W =(']{V:V is achange set for (A,s) & ~ V } . To prove this claim,f i r s t note that any change set containing ~ mustalso contain al l of W, since W consists of al l var-

    iables which are forced to change as a resul t ofchanging ~. On the other hand, i f some variable nis not contained in W then there is some assign-ment t s uc h t h a t t ( ~ ) ~ s ( ~ ) b u t t ( n ) = s ( n ) , s o t h a tn i s n o t c o n t a i n e d i n t h e c h a n g e s e t { ~ :t ( ~ ) ~ s ( ~ ) } . T h i s p r o ve s t h e c l a i m .

    Now b y m u l t i p l e a p p l i c a t i o n o f h y p o t h e s i s ( b ) ,W i s i t s e l f a c h a n ~e s e t f o r ( A , s ) . T h u s, s 8 K 1= s#1mPA(e) e Sa t(A ), as was to be shown. ,W

    ( C ) - - > ( a ) : A s s u m e t h a t f o r e v e r y s ~ S a t ( A ) a n de v e r y l i t e r a l e w h ic h i s c o n s i s t e n t w i t h A ,

    s#ImPA(~) eSat(A). Define B to be the conjunctionof {(~+ B): ~,B are l i t er als & B~ImpA(~)}. Notethat Var(B)=Var(A), since B has the c~njunct ({ ~)for each ~V ar (A) . We claim that B is log ica ll yequivalent to A, and hence R is bi juncti ve.

    We must show that Sat(B)=Sat(A). Clearl y,Sat(A)~Sat(B), since any assignment sati sfying Amust sa tisf y each conjunct of B.

    I t remains to show Sat(B)~Sat(A). Suppose,fo r sake of contradiction, that s ~ Sat(B) - Sat(A).Choose s~ E Sat(A) such that IwI is maximum, whereW = {n :~s1(n)=sp(n) Choose CEVar(A)-W, and let

    :=. ?he l i t eral ~ is consistent with A,because i f ~ were inconsistent with A, then B wouldhave a conjunct asserting this fac t (that is , i f

    = is inconsistent with A, then B has a con-junct ( - ~ ~ ) , and i f ~= is inconsistentwith A, then B has a conjunct (~ - ~ ) ) , and thiswould force s2(~)=Sl(~). Let sR:= sp#ImPA(~). Byhypothesis s 3 sat is fi es A. - -

    We claim that for all n~W, s3(n)=s2(n). Tosee this, suppose nEW with sR(n)#sp(n). Since now~ ImPA(e), B has a~conjuBct(e) , or equivalently ( +). This conjunct is not satis fi ed by sl ,contradicting the assumption that s sa ti sf ie s B. 'This proves the claim.

    Thus, s3 agrees with s on al l of Wu{~}.This contradicts the fact t~at s 2 was chosen tomaximize IwI .. The contradiction completes theproof.. [ ]

    Let A be a formula, let i E {O,l }, and le tV~Var(A). Define he i-closure of V with respectto A to be the set Cli,A(V-[:={~cVar(A) : for al l

    seSat(A) such that sl V ~i , s(C)=i}. In otherwords, Cln A(V) (resp. Cll .A(V)) is the set ofva ri ab les ~i ch are forced ~o be false (resp. true)by al l variables of V being fal se (resp. true) .

    I t is easy to see that V~Cll A(V), and thatV~V' implies Cl~ A(V)~Cl i A(V ') ~' -f or a ll V,V'

    Var(A), i ~{ o, i} ? Call t6e set VSVar(A)i-closed for A i f V=CI i A(V ). Also, call V

    i, consistent for A i f Here is some s ~ Sat(A)such that s I V si . We say V is i-nonclosed (resp.i-inconsistent) for A i f V is not i-closed (resp.i-consistent) for A.

    Lemma 3.1W. Let R be a logical rel at ion and l etA:= R(x~ . . . ). Then (a) R is weakly posi tive i fand ~ l y ' i f whenever V~Var(A) is O-consistent andO-closed for A, K v~Sat(A); and (b) R is weaklynegative i f and o~I# if whenever V~Var(A) is l-co~-sis tent and l-closed for A, Kl, V~Sat(A).

    Proof. We ju st prove part (a) . The proof of (b) issimi lar . I f R is empty, the lemma holds t r i v i a l l y ,so assume R is nonempty.

    ( ~ ) : Assume that R is weakly positive. Thus A islog ica ll y equivalent to some CNF formula A' havingat most one negated variable per conjunct. I t suf-fices to show that i f V&Var(A') is O-consistentand O-closed for A , then KO, V~Sat (A') . Let V besuch a set and suppose to t5e contrary that Kn vSat(A' ). Let C be a conjunct of A' on which ~' "Kn v fa i l s. Let U be the set of u~negated variableso~"C. Since KO, V fai l s on C, U&V. I f C has no. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    TIf s agrees with ~, the conclusion is immediate,since then s#1mPA(~ = s.

    2 2 0

  • 8/11/2019 p216 Schaefer

    6/11

    negated variable, then this contradicts the factthat V is O-consistent for A'. Otherwise, le t nbe the unique negated variable of C. I t can beseen that nECln a,(U). Also, since K n V fai ls onC, n~ V. This (~h'tradicts the fact th~ V isO-closed for A'. This proves that in factKO, V ~ Sat(A').

    (~) . Assume that K n vESat(A) for al l O-closed,O-consistent sets V_~?ar(A). Let A' be the con-junction of all the clauses { (C lV ' "V ~n ) :

    {~I . . . . . ~n} is O-inconsistent for A} ~{ ( , qv ~] v ..V~n) '." ~leCl 0 A({~I . . . . . ~n})}. Since every"variabl'eis contained ~n its own O-closure, A' hasa conjunct ( -~v~) for each ~V ar (A); hence,Var(A')=Var(A). We claim that A' is logical lyequivalent to A.

    To show Sat(A)~_Sat(A'), suppose that s~Sat(A').Let C be a conjunct of A' on which s fails. I f Cis of the form (~l V. .. V~ n), then s(~) =.. .: s(~ n)=0 and, by the de~=inition of A' , {~, ' " . ,~n} is.O-inconsistent for A; hence, s~Sat(A). Other-wise C is of the form ( - ~nv~v. . . V ~n) , and sos(n)=l, s(~)=...=S(~n)=O. T~en by the defini tiono f A ' , n ~ C ~ n A ( { ~ I . . . . . ~ } ) , h en ce s ~ S a t ( A ) .T h i s p r o v e s 6 a t S a t ( A ) : _ , " S a t ( A ' ) .

    N e x t w e s h o w t h a t S a t ( A ' ) _ ~ S a t ( A ) . S u p p os e

    s ~ S a t ( A ) . L e t V : : { ~ : s ( ~ )= O } . B y t h e p r o p e r t ya ss um e d f o r A , V i s e i t h e r O - i n c o n s i s t e n t o f O - n on -c l os e d f o r A . I f i t i s O - i n c o n s i s t e n t , t h en( C ~ v . . . v ~ ) i s a c o n j u n c t o f A ' , w he re V = { ~ 1 , - ; , ~ n } , a n~ h en ce s ~ S a t ( A ' ) . I f V i s O - no n-c lo s e d , l e t n ~ C l n A (V ) - V. T h e n ( - ~ n v ~ i v . . . v~ n) i s a c o n j u n c t ~ ' ~ o f A ' , a nd h en ce s # S a t ( A ' ) .T H i s p r o v e s t h a t S a t ( A ' ) _ ~ S a t ( A ) .

    T h u s S a t ( A ) = S a t ( A ' ) a nd s o A ' i s l o g i c a l l ye q u i v a l e n t t o A . H e n c e R i s w e a k ly p o s i t i v e . [ ]

    Lemma 3 . 2 . L e t R b e a l o g i c a l r e l a t i o n . I f R i snot weakly negative, then Rep({R})m{[x~y],[ xvy]}

    @. If R is not weakly posit ive, then Rep({R})m{ [ x ~ y ] , [ ' ~ X V- ~ y ] }/ @.

    C o r o l l a r y 3 . 2 . 1 . I f S c o n t a i n s s o m e r e l a t i o n w h i chi s n o t w e a k l y p o s i t i v e a nd so m e r e l a t i o n w h i ch i sno t weakly ne ga t ive , then [x ~y] ~ Rep(S) .

    P r o o f o f C o r o l l a r y. A s s um e R ,R ' ~ S w i t h R n o tweakly po s i t ive and R ' no t weakly neg a t ive . Sup-p o se , f o r s ak e o f c o n t r a d i c t i o n , t h a t [ x ~ y ]Rep(S) . Then, by Lemma 3 .2 , [ x v y ] and [ , x V ~y ]are in Rep(S) . Hence , Rep(S) con ta in s [ ( x v y )^( ~ x v - ~ y ) ] , w h ic h i s j u s t [ x ~ y ] , c o n t r a ry t oassumpt ion . [ ]

    P r o o f o f L em ma 3 . 2 . L e t R b e a l o g i c a l r e l a t i o nw h ic h i s n o t w e a k l y n e g a t i v e , a nd l e t A : = R ( x I . . . . ) .By Lemma 3 .1W, there i s a se t V -~Var(A) which i s l -cons s tent" and l -c lo se d such that:_ K~, ,V ~.Sat(A)"Let V := V ar (A )- V. Choo se W-V ,o f maximum ca rd i -

    n a l i t y s uc h t h a t K w e S a t ( A ) . I t c an b e s ee nf ro m th e d e f i n i t i o n { t h a t I < I W I < IV I . C h o os ee V - W , a nd l e t s b e a n a s s ig n m e n t s a t i s f y i n g A

    s uc h t h a t s l V - I a nd s (~ )= O . S u c h a n s e x i s t s b e -c au se V i s l - c l o s e d a nd l - c o n s i s t e n t .

    F or j = O , l d e f i n e W : = { n e w : s ( n ) = j } ,W : :{n~ Var(A)-W : s~(~):j }, and let

    : = A [ Wo l o" X ' y '

    W is nonempty by ma xim ali ty of IWI. WO is non -

    empty since i t contains ~. Thus x and y both actual-ly occur in B.

    Clearly [B]~Rep({R}). Also, [B] contains(O,l) and (I,0) , because A is sat isfied by K 0 w ands respectively. And [B] does not contain (0,07, bymaximality of IWI. Thus, depending on whether (1,1)is in [B], [B] is either [x~y] or [ xv y] . Thisproves the lemma for the case where R is weaklynegative.

    The proof of the weakly posit ive case is sim-ilar. []

    The following lemma is of frequent use in whatfollows.

    Negated Substitution Lemma. Assume [x~y] ~ Rep(S).Then Gen+(S) is closed under negated substitution;that is, i f A~Gen+(S) and ~,q are variables,

    A[~n ] ~ Gen+(S).

    Proof . By hypo thes i s Gen+(S) con ta ins the fo rmulax~y Observe th at ~ ~r A [ , n ] , o l o g i c a l l y e q u i v a l e n t t o( 3 u ) ( A [ ~ ] A n ~ u ) , ~ w h e r e u i s a v a r i a b l e n o t o c c u r ri n gi n A . ~ H e n c e , A [ ~ n ] ~ G e n + ( S ) . [ ]

    B y a " 3 - e l e m e n t b i n a r y l o g i c a l r e l a t i o n " w e

    m ean a 2 - p l a c e l o g i c a l r e l a t i o n h a v in g e x a c t l y 3e l e m e n ts I t i s e a s y t o v e r i f y t h a t th e r e a r ee x a c t l y f o u r s u ch r e l a t i o n s , a nd t h a t t h es e ar e[xV y], [~ xVy], [x~ ~y] and [4 xV~y].

    Lemma 3.3. Let R be a relation which is not affine.Then Rep({R ,[ x~y]}) contains all 3-element binarylogical relations.

    Proof. I t suffices to show that Rep({R,[x~y]}) con-tains some 3-element binary relation, since theothers can then be obtained by use of the NegatedSubstitution Lemma.

    Let A: : ~ x . . . . ). Using Lemma 3.1A, letSo,Sl,S 2 be asslgnments satisfying A such thatSnSSl 8sR does not satisf y A. Form A' from A byn~gating All occurrences of variables in the set{n : So(n)=l}. By the Negated Substitution Lemma,A'~Gen+({R,[x~y]}). Define si' := s SsQ, fori=l,2. Observe that an assignment t' satisf ies A'i f f tSs o satisfies A. Thus, K 0 (the all-zero as-signment}, Sl' , s 2' all satisfy A', but Sl'8 s{does not.

    For i, j = O,l, let V~ ~ :={C~Var(A') :s ' (~):i & s~ (C)=j}, and"~let

    ~ v l o V ~ l]: = A [ 0 , 0 , 0 , I , y ' zC l e a r l y, B e G e n + ( { R , [ x ~ y ] } ) . A ss um e w i t h o u t l o sso f g e n e r a l i t y t h a t x , y, z a l l a c t u a l l y o c c u r i n B .(For example , i f x does no t o ccur, one can add aconjunct (3w)(w~x) just to make i t occur.)

    By the statement just made about sat isfactionof A', [B] contains (O,O,O),(O,l,l) and (l ,O, l) ,but not (l,l,O).

    Assume, for sake of contradiction, thatRep({R,[x~y]}) does not contain any 3-element bin-ary relation. Then [B] must contain (O,l,O), orelse [(3x)B] is {( O,O) ,( ], ]) ,( O,l )} . Also, [B]must contain (I, 0,0), or else [(3y)B] is{(O,O),(0,] ), (I, 1)}. But then [B[ Z](l,O)}, and thi s contradictiSn ]competesis (O,O),(O,l),theproof. []

    2 2 1

  • 8/11/2019 p216 Schaefer

    7/11

    Lemma 3.4. Let R be a logical relation which isnot bijunct ive. Then Rep({R,[x~y],[xvy]}) con-tains the relation "exactly one of x,y,z."

    Proof. Let A :=B(x . . . . ). By part (b) of Lemmathere exist s nCSat(A) and U,V~Var(A) such

    that U and V are change sets for CA,s), but UmVis not a change set for (A,s).

    Form A' from A by negating all occurrences ofeach variable in the set {n :, Sn(n)=l}. By theNegated Substitution Lemma, A ~Gen+({R,[ xly]}).

    Observe that U and V are change sets for (A',Ko),where KO is t~e all -zero assignment, but UnV isnot. (Also, K 0 sati sfies A'. ) Define

    Var(A')-(UuV) U~V U-V V UB := A' [ 0 ' x ' y ' z ]

    By the above remarks about change sets for (A',Kn),[B] contains (0,0,0) , (l ,l ,O) and (l ,O, l) , but n~t(l,O,O). Now define

    B' := B[Xx] ^ (Ix v1y) A(l yv~z )A( ~zv1 x)

    By the Negated Substitution Lema, B' ~Gen+({R,[x ~y] ,[ xvy] }) . It is easy to check that[B'] = {(l,O,O),(O,l,O),(O,O,l)}. That is, [B']is the relation "exactly one of x,y,z." []

    Lemma 3.5. Let R be the logical relati on "exactlyone of x, y,z. " Then Rep({R}) is the set of alllogical relations.

    Proof. Define

    A := (3Ul,U2,U3,U4,U5,U6)(R(X,Ul,U4)AR(y,u2,u4)

    R(Ul,U2,U 5) R(u3,u4,u 6) R(z,u3,0)

    B := R(x,y,O)

    It is straightforward to verify that A is logical-ly equivalent to (x vy vz ) and that B is logicallyequivalent to x~y.

    Let a logical relation Q be given and letQ=[C] for some standard proposit ional formula C.By introducing a new exis tent ia ll y quantif ied var-iable for each binary logical connective of C, onecan form a formula (3y . . . . . Ym) D, equivalent to C,where D is a conjunction of cTauses each involvingat most 3 variables (and hence D can be expanded toCNF form with at most 3 liter al s per conjunct.)Details of this process can be found in [St,Lemma6.4] or [BBFMP]. I t is now straightforward,using the formulas A and B, to convert D into anequivalent formula in Gen({R}). It follows thatQ E Rep({R}).

    Thus Rep({R}) is the set of al l logical rela-tions. []. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Note. Condition (b) of Lemma 3.1B can also be ex-

    pressed in the following pleasantly symmetricform:

    (b' ) For all sj,s2,s R~sat(A), (SlYS2) A(s2vs3)^(s3 vs I) ~ Sa~(A).

    This is derived from condition (b) by setting Sl=S,s 2=sCKI,V~, sR=sCKi,vo and observing that(Ts2 ~ s ) ^ (s3~sl) I e s :i s equivalent to (SlY s 2)m(s2vs3)~( s3vs I .

    Proof of Theorem 3.0. First we show that i f Sdoes not sat isfy any of the conditions (a)-(d) ofTheorem 3.0, Rep(S) is the set of al l logical rela-tions.

    Assume that S does not satisfy any of (a)-(d) .Then S contains some relat ion R which is not weak-ly positive, some relation R 2 which is not weaklynegative, some relation R wBich is not affi ne,and some relation Rmwhich is not bi junct ive. ByCorollary 3.2.1, [x~y]~Rep({Ri,Rp}). Now byLemma 3.3, [xVy]~Rep({RI,R~,RR} ~. Hence, by

    Lemma 3.4, Rep({RI,R?,R3,R4}) c6ntains the rela-tion "exactly one'of-x,~,z~" and hence is the setof all logical relations, by Lemma 3.5. Thus,Rep(S) is the set of all logical relations.

    It remains to show that i f S sat isfies one ofthe conditions (a)- (d), so does Rep(S). The proofof this part does not involve any new techniques,and we leave i t as an exercise for the reader.(This part is not needed in the proof of the Di-chotomy Theorem.) [ ]

    4. PROOF OF DICHOTOMY THEOREM

    This section finishes the proof of the Dichot-omy Theorem (Theorem 2.1).

    Lemma 4.1. (Dichotomy Theorem for Sa tisf iab ili ty-with-Constants) Let S be a f ini te set of logicalrelations. If S sat isf ies one of the conditions(a)-(d) of Theorem 3.0, then SATc(S) is polynomial-time decidable. Otherwise, SATc(S is log-completein NP.

    Proof. (a) Suppose that every relation in S isweakly posit ive. Then SAT(S) is decidable usingthe following algorithm:

    I. Given an S-formula A, replace each conjunct ofA by an equivalent CNF formula A' having atmost one negated variable in each conjunct.

    2. I f every conjunct of A' contains an unnegatedvariable, ACCEPT.

    3. Otherwise, let (- I~) be a conjunct of A'. I f(~) is also a conjunct of A', REJECT. Otherwise,drop every conjunct in which -~C occurs anddrop ~ from every conjunct in which ~ occursunnegated. ( I f A' becomes empty, ACCEPT.)

    4. Go to step 2.

    We leave ver if icat ion to the reader.

    (b) The case where every relation in S is weaklynegative is similar to (a).

    c ) Suppose that every relation in S is affi ne.Then to decide whether a given S-formula A issati sf iable, convert A to an equivalent systemof linear equations over {O, l} and solve thesystem by Gaussian eliminat ion. (Eliminateone variable at a time unt il eit her al l varia-bles have been eliminated or O=l has beendeduced.) This is a well-known polynomial-time algorithm.

    (d) Suppose that every relat ion in S is bijunct ive.Then to decide whether a given S-formula issatisfiable, convert i t to an equivalent CNFformula with at most 2 l iter als per conjunctand use the Davis-Putnam procedure [DP], whichas noted in [C] decides sa t isf iab i li ty of suchformulas in polynomial time.

    2 2 2

  • 8/11/2019 p216 Schaefer

    8/11

    I n ( a ) - ( d ) a b o v e , w e h av e s k e t ch e d p o l y n o m i a l - t i m ea l g o r i t h m s f o r S AT( S) . F o r S ATe (S ) , t h a t i s i ft h e f o r m u la s c o n t a i n c o n s t a n t s , - i t i s o b v io u s howt o m o d i f y t h e a l g o r i t h m s .

    A ss um e n ow t h a t S d oe s n o t s a t i s f y a n y o f t h ec o n d i t i o n s ( a ) - ( d ) . We w i l l s h o w t h a t S ATe ( S ) i sNP-com plete by showing SAT3

  • 8/11/2019 p216 Schaefer

    9/11

    log space.

    L2. If every relat ion in S is (sl)-weakly positive,and S contains some non~O)-weakly positive re-lation, then either

    (a) S-~-$-c(S) is log-equivalent to the graphreachability problem (given a graph G andnodes s,t, do s and t l ie in the same con-nected component of G?).

    or (b) S--A-$-c(S) is log-equivalent to the digraphreachabili ty problem (given a digraph Gand nodes s,t, is there a directed pathfrom s to t ?), and hence is log-completein nondeterministic log space.

    L3. If every rel ation in S is weakly posi tive, andS contains some relation that is not (sl)-weak-ly positi ve, then Rep(S) is the set of al lweakly posi tive relations, and SATc(S) is log-complete in P.

    Statements LI-L3 also hold when "negative" is sub-stituted for "positive."

    L4. If S contains some relation that is not weaklyposi tive and some relation that is not weaklynegative, and every relation is S is affi ne andbijunctive, then Rep(S)=Rep([x~y]), and SATc(S)

    is log-equivalent to the problem of decidingwhether a graph is bipar ti te .

    L5. I f S contains some relati on that is not weaklypositive, some relation that is not weakly neg-ative, and some relation that is not bijunctive,and every relation in S is affi ne, then Rep(S)= Rep([xgyz=O]), and hence SATc(S) is log-equivalent to the problem of deciding whetheran arbi trary system of li near equations overthe field {O,l} is consistent.

    Remark. The lat ter problem is log-equivalentto its own complement, since a set of li nearequations is inconsistent i f f there is somesubset of them which sums to O=l, a conditionwhich i t sel f can be wri tten as a set of l inearequations. Thus for thi s case, any class inwhich SATc(S) is complete is closed undercomplement.

    L6. If S contains some relation that is not weaklyposi tive, some rel ation that is not weakly neg-ative, and some rel ation that is not affi ne,and every rel ation in S is bij unct ive, thenRep(S)=Rep([x y] ) and s--A-$-c(S is log-completein nondeterministic log space.

    L7. If S contains some relation that is not weaklyposi tive, some rel ation that is not weakly neg-ative, some relat ion that is not bij unctive,and some relati on that is not affi ne, thenRep(S) is the set of all logical relati ons,and SATc(S) is log-complete in NP.

    Corollary 5.2. SAT3W and NOT-EXACTLY-ONE SATISFIA-BILITY (defined in Section l) are log-complete inP. (This follows from statement L3.)

    The proof of L3 relies on the result of Jonesand Laaser [JL] that the problem UNIT (the set ofCNF formulas that y ield a contradict ion from unitresolution) is log-complete in P. Although [JL]does not give any explicit syntactic characteriza-tion, we believe that UNIT is just the set of un-sati sf iabl e CNF formulas having at most one posi-ti ve variable in each conjunct.

    Actual ly, the proof that SAT3W is complete inP can be given in a manner that completely paral-lels Cook's proof [C] that SAT3 (the set of sat is-fi abl e CNF formulas with 3 li ter al s per conjunct)is complete in NP. Cook's proof takes a sequenceof instantaneous machine descriptions and writes aCNF formula that describes the sequence. All thatis necessary to get a completeness resul t in P isto observe that, i f the machine involved is deter-minist ic, the CNF formula constructed has at mostone posi tive variable in each conjunct. (This re-quires certain modifications of Cook's argument,which are carr ied out in the UNIT proof of [JL].)The reduction to formulas with 3 l i ter al s per con-junct again completely parallels Cook's proof --one has just to observe that t his reduction pre-serves the property of having at most one positivevariable per conjunct. (One can then reverse thenegativity of all variables so as to get at mostone negated variable per conjunct, i .e. SAT3W.)

    The proof of statement L2(b) uses the resultof Savitch [Sav] (l ater refined by Jones [J] ) thatthe digraph reachabili ty problem is complete innondeterministic log space. Jones [J] asks whetherthe undirected graph reachabili ty problem is alsocomplete in nondeterministic log space.

    The completness of the sa t i sf iab i l i ty problemfor bijunct ive formulas (cf . L6), which followsfrom the completeness of the digraph reachabili typroblem, was noted in [JL].

    Definitions

    Let k be a nonnegative integer or ~. The re-lation R is (

  • 8/11/2019 p216 Schaefer

    10/11

    6. EXTENSION TO POLYNOMIAL SPACE

    This section gives a polynomial-space analogueof the Dichotomy Theorem, involving quantified fo r-mulas. The resul t is presented without proof.

    A quantified S-formula with constants is amember of the smallest set of formulas T such that(a) for each RE S, R(x . . . . ) cT, and (b) wheneverA,B~T and ~,n are variables, the following are in

    T: AAB, (3~)A, (V~)A, A[~], A[~], A[~]. Define

    QFc(S) := {A : A is a quantified S-formula withconstants, Var(A)=@, and A is true}.

    Theorem 6. l . Let S be a f ini te set of logical re-lations. I f one of the four conditions (c) -( f) ofTheorem 2.1 holds, QFr(S) is polynomial-time decid-able. Otherwise, QFc~S) is log-complete in polyno-mial space.

    The proof relies on the result of Stockmeyerand Meyer [StM] hat the problem Bun 3CNF (decidethe truth of a quantified CNF formula with 3 li t er -als per conjunct) is log-complete in polynomialspace, (See also [St]).

    7. APPLICATIONS

    The results presented here are potentiall yvery useful in expediting NP-completeness proofs,for the reason that they give one a much broader"target cross-section" for use in reductions.Tradi tionally, a researcher has had to aim his re-duction at a specific NP-complete problem, such asthe CNF sa t isf iab i li ty problem. By vir tue of The-orem 2.1, the researcher's aim no longer has to beso specific. Once he has set up the framework forsimulating conjunctions of clauses, he has greatlatitude regarding the specific content of thoseclauses.

    To illu st rat e this idea, we prove that theTWO-COLORABLE PERFECT MATCHING problem, defined inSection l , is NP-complete. With the help of Theo-rem 2.1, the proof is rather simple, whereas pre-viously the author had tri ed without success toprove this problem NP-complete.

    Theorem 7.1. TWO-COLORABLEPERFECT MATCHING is log-complete in NP.

    Comment. With addi tional arguments, which we donot give here, i t can be shown that this problemrestricted to planar cubic graphs in also NP-com-plete.

    Proof (sketch). Consider the graph shown in Figure~thr ee of whose nodes are labeled with thevariables x,y,z. Any coloring of this graph with

    the colors "0" and "l" can be interpreted as as-signing truth values to the variables x,y,z. Therequirement that the coloring be a solution to the2-colorable perfect matching problem is thus inter-preted as imposing a certain relation on these 3variables. I t is straightforward to veri fy thatthis relation is [( xvyv z) A(4x v-- yv~z )] --the only values the t ripl e (x,y,z) cannot assumeare (O,O,O) and ( l , l , l ) . Call this relat ion R andobserve that SAT({R}) is the NOT-ALL-EQUAL SATISFI-ABILITY problem, which, as noted in Section 2, isNP-complete as a consequence of Theorem 2.].

    Figure l (a)

    Figure l(b)

    A= R(x,x,y)AR(y,z,u)

    Z

    Figure l(c)

    Wewi ll reduce SAT({R}) to the 2-colorableperfect matching problem.

    Let an {R}-formula A be given. Construct agraph G as fol lows. Let Gn be the union of dis-joi nt copies of Figure l(a ), one copy for each con-junct of A. On each copy label the nodes "x","y"and "z" with the names of the variables occurringin the corresponding conjunct of A. Then, for eachpair nl,n 2 of nodes that are labeled with the samevariable, join n to n 2 by means of the structureshown in Figure 1(b). It may be verified thatthis structure forces n and n 2 to have the samecolor. Call the result lng graph G. Figure l( c)shows a simple example of this construction. Itcan be seen that G has a two-colorable perfectmatching if f A is satisfiable. Hence, TWO-COLOR-ABLE PERFECT MATCHING is NP-complete. [ ]

    The point we wish to make is that , in theabove proof, "almost any" graph could have beenused for Figure l(a) . We suspect that i f one sim-ply randomly generated a graph having lO or 15nodes, within a certain range of arc probabil ity,the result would be, with very high probabili ty, agraph representing a relation satisfying the condi-tions of Theorem 2.1 for NP-completeness, whichwould therefore serve just as Figure l (a) for aproof of NP-completeness.

    This raises the.intriguing possibility ofcomputer-assisted NP-completeness proofs. Oncethe researcher has established the basic frameworkfor simulating conjunctions of clauses, the rela-tional complexity could be explored with the helpof a computer. The computer would be instructedto randomly generate various input configurationsand test whether the defined relati on was non-af-fine, non-bijunctive, etc. The fruit fulness ofsuch an approach remains to be proved: the enumer-ation of the elements of a relation on lO or 15variables is Surely not a light computational task.

    2 2 5

  • 8/11/2019 p216 Schaefer

    11/11

    8. PROBLEMSFORFU RTHER RESEARCH

    I. Ge nera l ize the Dichotomy Theorem f rom 2-va luedv a r i a b l e s t o k - v a lu e d v a r i a b l e s ( i . e . , a r e l a -t i o n o f r a n k n i s a s u b se t o f { 0 , I . . . . . k - I }n ) .An ana logue for k=3 would imply the (a l rea dyknown) NP-comple teness o f th e g raph 3-c o l or ab i l -i t y p r ob le m . I t w o u ld b e i n t e r e s t i n g t o s ee i fa ny ne w p o l y n o m i a l - t im e d e c i d a b l e c as es a r i s e ,w h i c h a r e n o t o b v i o u s g e n e r a l i z a t i o n s o f t h ecase k=2.

    2 . S t u d y th e c o m p l e x i t y o f d e c i d i n g w h e t h e r a r e -l a t i o n i s a f f i n e , b i j u n c t i v e , o r w e ak ly p o s i t i v e .From Lemmas 3.1A and 3.1B, i t can be seen th ati t can be dec ided in po lynom ia l t ime whether ag i ve n r e l a t i o n , p r es e n te d a s a l i s t o f i t s e l e -m e n ts , i s a f f i n e o r b i j u n c t i v e . B u t w e d o n o tk no w o f a ny e f f i c i e n t a l g o r i th m f o r r e c o g n i z in gw e a k ly p o s i t i v e r e l a t i o n s .

    9. CONCLUSION

    We h a ve s t u d i e d t h e c o m p l e x i t y o f a n i n f i n i t ec l a s s o f s a t i s f i a b i l i t y p ro ble m s an d o b t a in e dc l a s s i f i c a t i o n th e or em s w h ic h in c l u d e a n d e x t e n dv a r io u s p r e v i o u s co m p l e x i ty r e s u l t s , t h e r e b y u n i f y -

    i n g t h e se e a r l i e r r e s u l t s w i t h i n a l a r g e r f r a m e -work.By way of ex p lo r ing th i s p rob lem, we were l ed

    t o a f a i r l y r i c h t h e o ry o f c l a s s i f i c a t i o n o f l o g i -c a l r e l a t i o n s , w h i ch is i n d e p e n d e n t o f , a l t h o u g hm o t i va t e d b y, c o m p l e x i t y - t h e o r e t i c n o t io n s . I tse em s l i k e l y t h a t t h i s t h e o r y w i l l l e ad to ah e i g h t e n e d u n d e r s t a n d i n g o f t h e i n h e r e n t c o m p l e x i t yo f v a ri o u s c la s s e s o f l o g i c a l r e l a t i o n s .

    Since Cook's NP-completeness p roo f [C ], thes t a n d a rd CNF s a t i s f i a b i l i t y p r ob l em h a s b ec om e ak ind of ca nonica l NP-comple te p rob lem, be ing proba-b l y u se d m o r e w i d e l y i n r e d u c t i o n s t h a n a ny o t h e rNP-comple te p rob lem. We fee l th a t the usefu lne sso f t h i s p ro b le m f o r r e d u c t i o n s i s a p r o p e r t y w h ic his p robab ly shared to some degree by o th er c on jun c-t i v e s a t i s f i a b i l i t y p r o b le m s , su ch a s t h o s e w e h a v econs id ered , Th us we fee l tha t p roblems such asONE-IN-THREE SATIS FIABILITY and NOT-ALL-EQUAL SAT -I S F IA B I L IT Y w i l l l i k e w i s e p r o ve t o h a ve w i d e a p p l i -c a b i l i t y i n c o m p le t en e s s p r o o f s .

    APPENDIX

    C o m p l e x i t y - T h e o r e t i c D e f i n i t i o n s

    Inputs to a l l dec i s ion prob lems a re assumedto be presen ted as s t r ing s o f symbols f rom somef i x e d f i n i t e a l p h a be t ~ .

    A log-spac e bounded Tu r in 9 machine i s a Tur-ing machine , hav ing a two-way rea d-on ly in pu t t ap e ,a o ne -w a y w r i t e - o n l y o u t p u t t a p e , a nd a s i n g l ew o r k t a p e , w h i c h , o n a n y i n p u t w e Z * , n e v e r v i s i t s

    m o re t h a n c l o g ( l w I ) fr am e s o f i t s w o rk t a p e , f o rsome con sta nt c depending on the machine. Them a ch in e i s a ss um e d d e t e r m i n i s t i c u n l e s s o t h e r w i s es t a t e d .

    A f u n c t i o n f : ~ * ~ * i s l o g - sp a c e co m p ut ab lei f the re i s some log-space bounded Tur ing machinew h i c h o n i n p u t w e Z * o u t p u t s f ( w ) a n d h a l t s .

    L e t A , B ~ * . T h e n A