The phase transition in random horn satisfiability and its algorithmic implications

15

Transcript of The phase transition in random horn satisfiability and its algorithmic implications

The phase transition in random Horn satis�abilityGabriel Istrate Mitsunori OgiharaThe University of RochesterComputer Science DepartmentRochester, New York 14627Technical Report 669AbstractThis paper studies the phase transition in random Horn satis�ability: under the random model(n;m) in which a formula is obtained by choosing m clauses independently, uniformly at random,and with repetition from all Horn clauses in n variables, �(n) = 2n is the satis�ability thresholdfor the Horn satis�ability. The threshold is coarse since, if �(n) = c � 2n thenlimn!1Pr�2(n;�(n)) [� is satis�able] = 1� F (e�c);where F (x) = (1� x)(1� x2)(1 � x4)(1� x8) � � �This resolves both of the two remaining cases of the problem of analyzing phase transitions ofthe six maximally tractable cases in Schaefer's Dichotomy Theorem.

Supported in part by the NSF CAREER Award CCR-9701911 and by the DARPA/NSF Grant 9725021.

1 IntroductionPhase transitions in combinatorial problems were �rst displayed in the seminal work by Erd}os andR�enyi [ER60] on random graphs. They showed that, for many properties Q, the probability thata random graph has Q exhibits a sharp increase at some critical value of the edge probability.The empirical observation from [CKT91], that phase transitions coincide with a peak in averagecomplexity, sparked a lot of interest, both in the Theory of Computing and the Arti�cial Intelligencecommunities. From a practical point of view, phase transitions are most appealing in problems thatare thought to be \hard", in particular, in NP-complete problems. Therefore a lot of recent workhas been directed towards locating phase transitions in NP-complete problems, most important ofwhich is the satis�ability problem.However, with a small number of exceptions (such as the Hamiltonian cycle [KS83]), �ndingthe exact location of the phase transition, or even proving its existence, is very di�cult. In mostproblems (e.g., 3-SAT [FS96, KKKS96] and graph-coloring [Chv91, AM97]), there still exists a largegap between the best proven lower and upper bounds.An approach to this problem would be to study phase transitions in tractable subcases. Thesatis�ability has been well-studied in this regard. Out of the six maximally tractable cases of SATthat Schaefer identi�ed in his Dichotomy Theorem [Sch78], two are trivially satis�able and twohave completely analyzed phase transitions (the transition for 2-SAT, the satis�ability problem forCNF formulas with clauses of size two, has been studied in [CR92, Goe96] and that for XOR-SAT,the satis�ability problem for linear systems of equations with boolean variables, has been studiedin [CD96]). The remaining two cases are the Horn formulas and the negative Horn formulas (whichare, of course, dual).The mathematical de�nition of phase transitions involves the concept of satis�ability thresholdfrom random graph theory. However, in order to correspond to the intuitive \step function" pictureassociated with phase transitions, a restricted version of this property has to be considered, calledsharp satis�ability threshold. A satis�ability threshold always exists for problems satisfying a certainmonotonicity property [BT86], but may or may not be sharp (we speak of a coarse threshold in thelatter case).In this paper we determine the satis�ability threshold for Horn satis�ability, (and its dualproblem). Unlike all other cases of satis�ability, we prove that the threshold is coarse. This meansthat, if we require (as usual) the sharpness of the threshold for the existence of the phase transition,one can make the point thatHorn satis�ability is a practically motivated problem lacking aphase transition. We also obtain a �ne analysis of the transition from almost certain satis�abilityto almost certain unsatis�ability, a task accomplished previously in some other cases, such as graphconnectivity [ER60], Hamiltonian cycle [KS83], and XOR-SAT [CD96].From a practical perspective, our results show that, if we allow Horn clauses of arbitrary length,a random Horn formula is almost certainly satis�able, unless it is very large. Also, we obtain ourresult by analyzing an algorithm that is a version of positive unit resolution, a topic of independentinterest. 1

2 PreliminariesA Horn clause is a disjunction of literals containing at most one positive literal. A Horn formulais a conjunction of Horn clauses. Horn satis�ability (denoted by HORN-SAT) is the problem ofdeciding whether a given Horn formula has a satisfying assignment. As in many other paperson phase transitions in variations of the satis�ability problem, we use a two-parameter randommodel . For integers n and m, a random formula from (n;m) is obtained by choosing m clausesindependently, uniformly at random and with repetition from the set of all Horn clauses overvariables x1; : : : ; xn. Note that there are Nn = (n+ 2) � 2n � 1 such clauses.Let Q be any decision problem with a two-parameter random model �. A function � is thethreshold function for Q under � if for every � : N! N,1. if �(n) = o(�(n)) then limn!1Prx2�(n;�(n))[Q(x)] = 1, and2. if �(n) = !(�(n)) then limn!1Prx2�(n;�(n))[Q(x)] = 0,� is called a sharp threshold if in addition the following property holds:3. For every � > 0, the two functions �1(n); �2(n) de�ned by Prx2�(n;�1(n))[Q(x)] = 1 � �,Prx2�(n;�2(n))[Q(x)] = �, satisfy �2(n)� �1(n) = o(�(n)).3 The Main TheoremThe following theorem provides the location of the satis�ability threshold for Horn satis�ability, aswell as a �ne analysis that implies that the threshold is coarse:Theorem 1 �(n) = 2n is the satis�ability threshold for the Horn satis�ability.Furthermore, for every constant c > 0 and every function �(n) = 2n � (c+ o(1)),limn!1Pr�2(n;�(n))[� 2 HORN-SAT] = 1� F (e�c); (1)where F (x) = (1� x)(1� x2)(1� x4) � � � (1� x2k) � � � :1The proof of the theorem is by analyzing the behavior of a simple algorithm, called PUR,for HORN-SAT. PUR is essentially a variant of positive unit resolution [HW74]. For a di�erentrandom distribution such an analysis has been done in [HS92].The algorithm PUR decides HORN-SAT. Indeed, positive unit literals appearing during a re-cursive call necessarily take value 1, so the recursive step is correct. On the other hand, if a Hornformula contains no positive unit literals then every clause contains at least one negative literal,hence the formula is satis�ed by the assignment 000 : : : 0.11=F (n) is the generating function of binary partitions (partitions of n into powers of 2) [FS93]2

Procedure 1 PUR(�)if (� contains two opposite literals) thenreturn FALSEelseif (� contains no positive literals) thenreturn TRUE;elsechoose such a positive literal xlet �0 be the formula obtained by setting x to 1 in �return PUR(�0);end ifend if3.1 NotationHere we set down some notions and notation.We regard the algorithm PUR as working in stages, indexed by the number of variables still leftunassigned; thus, the stage number decreases as PUR moves on. Let � denote an input formulaover n variables. For i; 1 � i � n, Ai, Ri, and Si respectively denote the event that PUR acceptsat stage i, the event that PUR rejects at stage i, and the event that PUR reaches stage i. HereA, R, and S, respectively stand for \accept", \reject", and \survive". Also, for each i; 1 � i � n,�i denotes the � at the beginning of stage i, and Ni denotes the number of clauses of �i. Thesevalues are unde�ned if Si does not happen. Also, let � = � � 2�n. For n 2 N and p; 0 � p � 1,B(n; p) is a random variable having a Bernoulli distribution with parameters n; p.We will be concerned with three rational sequences fyigni�1, fzigni�1, and fpigni�1, de�ned asfollows:1. yn = 2n � � = �(n), and for i; 2 � i � n, yi�1 = (yi � 1) � (1� 1i+1).2. zn = 2n � � = �(n), and for i; 2 � i � n, zi�1 = (zi � 1) � (1� 1i+3).3. For all i; 1 � i � n, pt = 2t(t+2)�2t�2 .De�nition 1 For 1 � t � n, de�ne events Ct;Dt, and Et as follows:� Ct : Nt�1t+3 � B(Nt � 1; pt) � Nt�1t+1 ,� Dt : jB(Nt � 1; pt)� (Nt � 1)ptj > (Nt�1)ptt+3 , and� Et : yt � Nt � zt.3.2 Some useful resultsThe following are two conditional probability tricks.Fact 1 For every A;B, and C, if Pr[CjB] = 1� o(1) then Pr[AjB]� Pr[AjB ^ C] = o(1).3

Fact 2 If B is a random variable taking values in the interval I, then for every event A,min�2I fPr[Aj(B = �)]g � Pr[A] � max�2I fPr[Aj(B = �)]g:We will use the following version of the Cherno� bound:Lemma 1 If 0 < � < 1=4 then Pr[jB(n; p)� npj > �np] � e�np �24 .The following lemma gives lower and upper bounds on the values of yt; zt:Lemma 2 If �(n) � (n+ 3)2, then the following hold for all t; 1 � t � n:1. �(n) � (t+1)2(n+1)2 � yt � �(n) � t+1n+1 .2. �(n) � (t+3)2(n+3)2 � zt � �(n) � t+3n+3 .Proof. We prove only (1); the proof is quite similar for (2). For every t; 1 � t � n � 1, yt =(yt+1 � 1) t+1t+2 < yt+1 � t+1t+2 , so, yt < yn � t+1n+1 . Since yn = �(n), we have yt � �(n) � t+1n+1 for all t.The other side of (1) can be proven by induction on t proceeding from n towards 0. The basecase is trivial. For an induction step, let t < n, and suppose that the inequality holds for all j > t.So, yt = yn � t+ 1n+ 1 � �1� 1yn��1� 1yn�1� � � ��1� 1yt+1� :Combining our induction hypothesis with the assumption �(n) � (n + 3)2, we have for all j; t <j < n, xj � �(n) � (j + 1)2=(n+ 1)2 > (j + 1). So,�1� 1yn��1� 1yn�1� � � ��1� 1yt+1� � t+ 1n+ 1 :Thus, the inequality holds for t. 2Corollary 1 If �(n) � (n+ 3)2, then for all t � 2, �(n) t(t+1)(n+1)2 + 1 � yt.A crucial observation is that the behavior of PUR on a random Horn instance can be describedby a stochastic recurrence (Markov chain) for Nt.Lemma 3 Suppose � survives up to stage t. Then, conditional on Nt, the clauses of �t arerandom and independent of the previous steps of the algorithm. Also, the sequence fNigi satis�esthe following stochastic recurrenceNn = 2n � �, and for all i; t < i � n, Ni�1 = Ni � 1�B(Ni � 1; pi). (2)4

Proof. We provide a proof based on the deferred decision method [KMP90], The heart of thismethod is to consider the random formula � as being disclosed gradually as the algorithm proceeds,rather than as being completely determined at the very beginning of the algorithm. A formula willbe represented by an m � n table that is �lled as the algorithm proceeds. The rows of the tablecorrespond to the clauses in the formula, and the entries of the column are its literals. The entriesare gradually determined as the algorithm proceeds|decisions about the entries with respect tothe ith variable are made when that variable is the variable of the algorithm's current concern. Wesay that a row (or a clause) is \blocked" either if the clause is already satis�ed or the clause hasbeen turned into empty clause (by choosing the entries so that all the entries so far pick to be inthe clause are all dissatis�ed).Indeed, suppose PUR arrives at stage t on �. Then in stages i = n; n� 1; : : : ; t+ 1, �i shouldcontain a unit clause consisting of a positive literal but should not have contained complementaryunit clauses of the same variable. To carry out the disclosure at stage i, we �rst select uniformlyat random one variable, say u, among those that are currently available. Then we select a clauseC uniformly at random from those that are not blocked, �ll it with x and block. Next, for each ofthe remaining non-blocked clauses we perform the following:1. With probability 2i(i+2)�2i�2 �ll the �rst of its literals with x, �ll the rest with a randomdisjunction of the negations of the remaining i� 1 literals, and block it.2. With probability (i+1)2i�1�1(i+2)�2i�2 �ll the �rst of its literals with x and leave it non-blocked.The probabilities in the operation come from the following simple reasoning: among all (i +2) � 2i � 2 Horn clauses in i variables (all but x that is forbidden to appear, since � survives thisstage), 2i contain x, (i + 1)2i�1 � 1 of them contain but are not equal to x, and (i + 1)2i�1 � 1contain neither x not x. The uniformity condition is not hard to observe: a random clause of �icorresponds to the residual (not �lled) part of a clause of � that is still non-blocked at stage i. Sinceall the literals already �lled are negated, any of the non-empty Horn clauses in the remaining i� 1variables are equally likely to appear. Note that all clauses still non-blocked at step i correspondto real clauses of �i. Indeed, suppose that one such non-blocked clauses would not contain any ofthe i remaining variable (thereby corresponding to a null clause, rather than a clause of �i). Weinfer, from the fact that it is still non-blocked, that all the literals that have been �lled so far (ofwhich there must be at least one, otherwise the clause of � would have been null from the verybeginning) are negated. Consider the last such literal whose negation has been chosen as a variableat some earlier stage j. Then, at that stage, the corresponding clause of �j would consist only ofthis literal, a contradiction, since � survived that stage. Given this observation, it follows that thenumber of clauses of �i, other than the selected unit clause fxg, that are eliminated from � (i.e.blocked) as a result of performing step i has a Bernoulli distribution with parameters Ni � 1 andpi. 2The following lemma relates the events from De�nition 1.Lemma 4 If Nt > 1 and t � 3, then(i) Ct implies Dt, and(ii) Cn ^ Cn�1 ^ � � � ^Ct implies En ^En�1 ^ � � � ^Et�1.5

Proof. In order to prove (i), note, by de�nition, that Ct impliesjB(Nt � 1; pt)� (Nt � 1)ptj > (Nt � 1)min� 1t+ 1 � pt; pt � 1t+ 3� :The routine calculation shows that both terms in the minimum function are at least ptt+3 for t � 3.To prove (ii), it su�ces to show for an arbitrary i, that Ci ^ Ei ) Ei�1. Then combined withthe fact that En is true, it follows that Cn ^ Cn�1 ^ � � � ^Ct implies each of En�1; En�2; : : : ; Et�1.To prove Ci ^Ei ) Ei�1, we note that the property Ci and the recurrence (2) imply that(Ni � 1)(1� 1i+ 1) � Ni�1 � (Ni � 1)(1 � 1i+ 3):Assuming Ei this yields (yi � 1)(1 � 1i+ 1) � Ni�1 � (zi � 1)(1 � 1i+ 3);which is equivalent to Ei�1. 23.3 The proof outlineWe will prove only the second part of the theorem, since the �rst part directly follows from it. By theproof of Lemma 3 the behavior of the algorithm can be described by a stochastic recurrence (Markovchain) involving Nt. Proposition 1 below proves the important fact that with high probability Ntstays close to its expected value (although this value is not explicitly mentioned). We build theproof on three technical lemmas, Lemmas 5, 6, and 7. Intuitively, these lemmas show the following:� Lemma 5 states that if � = !(1), then with probability 1� o(1) PUR rejects at around stagelog n, given that � has reached that stage.� Lemma 6 states that if � = �(1), then with probability 1� o(1), PUR does not reject in any�xed number of steps.� Lemma 7 states that if � = c for some positive constant, then e�c � o(1) � Pr[� 2HORN-SAT] � e�c=41�e�c=4 + o(1).From Lemma 7 it follows that 2n is the satis�ability threshold, and thatlimn;c!1Pr�2(n;c�2n) [� 2 HORN-SAT] = 0: (3)Next we obtain a relation between the probability that PUR rejects �n and the probability thatPUR rejects �n�1 (�n�1 is de�ned with probability 1 � o(1) in the case when � = �(1) due toLemma 6): the former is equal to the latter multiplied by factor that approaches (1� e��). Thenwe observe that if � 2 (n; 2n�), then with high probability �n�1 is \close" to a formula from(n� 1; 2n�1 � 2�). So, a constant number, say k, of iteration \blows up" � so that the resulting2k� is so large that �n�k is, by equation (3), unsatis�able with high enough probability.6

3.4 The key lemmasProposition 1 If � = (1) and j � n, then Pr[En ^ En�1 ^ � � � ^ Ej jSj], i.e., the conditionalprobability that yi � Ni � zi holds for all i; j � i � n, in the event that PUR reaches stage j, is1� o(1).Proof. By Lemma 4,Pr[En _ � � � _Ej jSj]� Pr[Cn _ � � � _ Cj+1jSj]= Pr[CnjSj ] + Pr[Cn�1jSj ^ Cn] + � � �+Pr[CtjSj ^ Cn ^ � � � ^ Ct+1] + � � �+ Pr[Cj+1jSj ^ Cn ^ � � � ^ Cj+2]:By Lemma 4, Pr[CtjSj ^Cn^ � � �^Ct+1) � Pr[DtjSj ^Cn^ � � �^Ct+1]. Let I be the interval [yt; zt].Since Cn ^ � � � ^ Ct+1 implies Et, i.e., Nt 2 I, by Fact 2 we have Pr[DtjSj ^ Cn ^ � � � ^ Ct+1] �max�2I Pr[DtjSj ^ Cn ^ � � � ^ Ct+1 ^ (Nt = �)]. Now by Lemma 1, the right-hand side is boundedfrom above by max�2Ife� (��1)pt4(t+3)2 g. Since yt > 2n� t(t+1)(n+1)2 +1, if � 2 I then ��1 � 2n� t(t+1)(n+1)2 . Thus,Pr[CtjSj ^Cn ^ � � � ^Ct+1] � Pr[DtjSj ^Cn ^ � � � ^Ct+1]� e�2n� t(t+1)(n+1)2 pt� 14(t+3)2� e� 2n�32(n+1)2(n+2) ;since t(t+1)(t+2)(t+3) � 18 and pt � 1n+2 . Summing up all these upper bounds establishes the lemma. 2Lemma 5 Let c > 0, � > c ln 2 > 0, and p = bn � log2 n + log2 cc. Then Pr[RpjSp], i.e.,the conditional probability that PUR rejects at stage p in the event that PUR reaches stage p, is1� o(1).Proof. Let T denote the event En^En�1^� � �^Ep. It follows from Proposition 1 that Pr[T jSj ] =1� o(1). Then, by Fact 1, Pr[RpjSp] = Pr[RpjSp ^ T ] + o(1). Since T implies Np 2 I = [yp; zp],Pr[RpjSp ^ T ] � min�2I fPr[RpjSp ^ T ^ (Np = �)]g:Thus, the claim holds if for every � 2 I, that Pr[RpjSp ^ T ^ (Np = �)] = 1� o(1). By taking thecomplement of Rp, it su�ces to show for every � 2 I, that Pr[RpjSp ^ T ^ (Np = �)] = o(1).Suppose the event Sp holds. Without loss of generality, we can assume that u1; : : : ; up are theremaining variables of �p. Then Rp holds if and only if(*) for every i; 1 � i � p, �p lacks either the unit clause (ui) or the unit clause (ui).Then by Lemma 2, Pr[RpjSp ^T ^ (Np = �)] is equal to the probability that a formula of � clausesare picked under the uniform distribution on the Horn clauses of the variables fu1; : : : ; upg so that(*) holds. Consider the process of selecting for each i; 1 � i � p, one of the two unit clauses overui, and then picking � clauses with repetition from the remaining clauses uniformly at random.7

This process may generate formulas not satisfying (*), but will generate all the formulas satisfying(*) with equal probability. So,Pr[RpjSp ^ T ^ (Np = �)] � 2p �1� p(p+ 2)2p � 1�� :The right-hand side is at most2p �1� p(p+ 2)2p � 1�yp = e�[ pyp(p+2)2p�1�p ln 2]+o(1):Since p = bn � log2 n + log2 cc, for su�ciently large n, (p + 2)2p � 1 < 2n. By Lemma 2 (1),yp > 2n �� � (p+1)2=(n+1)2. Since � > c ln 2, the exponential on the right-hand side in the aboveis e�!(2n) = o(1). Thus, Pr[RpjSp ^ T ^ (Np = �)] = o(1), and the lemma is proven. 2Corollary 2 Let c > 0 and � > c ln 2 > 0. Let T (�) be the number of recursive calls that PURmakes on �. Then with probability 1� o(1), T (�) � log2 n� ln ln 2ln 2 + log2 �.Proposition 2 If � is equal to some constant c > 0, then with probability 1 � o(1), for a randomformula � in (n; 2nc), PUR does not reject � in stage n.Proof. Let U be the number of unit clauses in �. The variable U has a binomial distributionwith parameters 2nc and 2n(n+2)2n�1 , so it is asymptotically a Poisson distribution with parameter2c. A well-known result on the tail of the Poisson distribution [AES92, Theorem A.15]) shows that,with probability 1� o(1), U � 2c(1 + n1=3) � 4cn1=3.Consider the U unit clauses of � as being balls to be tossed into n bins. The probability thattwo of them end up in the same bin is at most �U2� � 1n , which, in view of the above upper bound onU , is o(1). So with probability 1� o(1) no variable appears more than once in a unit clause of �,and thus, PUR does not reject. 2Lemma 6 If � = �(1), then for every k > 0, with probability 1�o(1), PUR does not reject in anyof the stages n; n� 1; : : : ; n� k + 1.Proof. De�ne the event W byW = Rn _ (Sn ^Rn�1) _ � � � _ (Rn�k+1 ^ Sn ^ � � � ^ Sn�k+2):The lemma states that Pr[W ] = o(1). By the Bayes rule Pr[W ] is smaller thanPr[Rn] + Pr[Rn�1jSn] + � � �+ Pr[Rn�k+1jSn ^ Sn�1 ^ � � � ^ Sn�k+2]:By Proposition 1 and Fact 1,Pr[RijSn ^ Sn�1 ^ � � � ^ Si+1] � Pr[RijSn ^ Sn�1 ^ � � � ^ Si+1 ^Ei] + o(1):Then by Fact 2,Pr[RijSn ^ Sn�1 ^ � � � ^ Si+1 ^Ei] � max�2I fPr[RijSn ^ Sn�1 ^ : : : ^ Si+1 ^Ei ^ (Ni = �)]g;8

where I = [yi; zi]. By (2), Pr[RijSn ^ Sn�1 ^ : : : ^ Si+1 ^ Ei ^ (Ni = �)] is exactly the probabilitythat a random formula with i variables and � clauses is rejected by PUR at the �rst step.The probability is maximized when � is equal to zi. Since zi � 2nc = 2i(2n�ic), 0 � n� i < k,the more clauses the more likely to have con icting unit clauses. So, by Proposition 2, the statementholds. 2Lemma 7 If � is equal to some constant c > 0, then e�c � o(1) � Pr[� 2 HORN-SAT] �e�c=41�e�c=4 + o(1).Proof. Let � = c > 0 be a constant.Pr[� 2 HORN-SAT] � Pr[PUR accepts at the �rst step]= Pr[� contains no positive unit clauses]= �1� n(n+ 2) � 2n � 1�2nc= e� n2n�c(n+2)�2n�1 � o(1)� e�c � o(1);since n2n(n+2)�2n�1 � 1. This proves the lower bound.In order to prove the upper bound, de�ne p = log2 n� ln ln 2ln 2 + log2 c, let Y be the event \PURaccepts", and let Z the event \PUR stops in at most p iterations". By Corollary 2, Pr[Z] = 1�o(1),so Pr[Y ] � Pr[Y jZ] = o(1). Given Z, Y is equivalent to An_(An�1^Sn)_(An�p+1^Sn^� � �Sn�p+2),so, by the Bayes rule, Pr(Y jZ) is at mostPr[An] + Pr[An�1jSn] + � � �+ Pr[An�p+1jSn ^ Sn�1 ^ � � � ^ Sn�p+2]:Here we cannot apply Fact 1, because this sum has an unbounded number of terms. Instead, wewill use the following simple consequence of Bayes conditioning:Pr[AijSn ^ � � � ^ Si+1] � Pr[AijSn ^ � � � Si+1 ^Ei] + Pr[EijSn ^ � � � Si+1]:As in the proof of Proposition 1 the second term is at most ne� 2nc32(n+1)2(n+2) , so the sum of all the\second terms" is o(1). As to the �rst term, by analysis similar to that of Lemma 6, we havePr[AijSn ^ � � � ^ Si+1 ^Ei] � �1� i(i+ 2)2i � 1�yi :The right hand side is at most e� iyi(i+2)2i�1 , and this is at most e� i2nc�(i+2)(n+2)22i : Since i � n� p+ 1, fora su�ciently large n, i(i+2)(n+2)2 � 14 , so Pr[RijSn ^ � � � ^ Si+1] � e� 2n�ic4 . Summing up all such termsand observing the exponents as part of the progression f c4 � jg, we obtain the desired upper bounde�c=41�e�c=4 + o(1). 29

3.5 Putting it all togetherNow we complete the proof of Theorem 1 by proving (1). The rest of the theorem follows fromLemma 7 and the fact that adding clauses to a formula can only decrease the probability that it issatis�able. In order to prove (1), it su�ces to show that if � = c thenlimn!1Pr�2(m;n)[PUR rejects �] = F (e�c):It is easy to see that F is well-de�ned on (0; 1) and has the following Taylor series expansion~F (x) = (�1)b0 + (�1)b1x+ (�1)b2x2 + � � � (�1)bixi + � � �with bi being the number of ones in the binary representation of i. Also F is monotonicallydecreasing, positive on (0; 1), and has limit 1 at 0.Now �x � > 0. For simplicity, let � = F (e�c), let R be the event \PUR rejects �", and fori > 0, let �i be the product of all but the �rst i terms in the product �. What we need to show isthat for a su�ciently large n, (1� �)� � Pr[R] � (1 + �)�: (4)Since � converges and � > 0, the sequence �k converges to 1, so there exists some k0 such thatfor all k � k0, 11 + �=2 < �k < 1p1� �=2 : (5)By Lemma7, there exist some n0 > 0 and c0 > 0 such that, for every n > n0 and ev-ery c > c0, Pr�2(n;2nc)[PUR rejects �] > p1� �=2. Keeping in mind the fact that eventsAn; An�1; � � � ; An�k+1 are incompatible with R we obtain the equalityPr[R] = Pr[An]Pr[An�1jAn] � � �Pr[An�k+1jAn ^ � � � ^An�k+2] � Pr[RjAn ^ � � � ^An�k+1];for every �xed k.Albeit conceptually simple, the rest of the proof is a bit cumbersome. We �rst consider thecase when c > 4 ln 2 (this is when the upper bound provided by Lemma 7 is strictly smaller than1). We choose k so that yn�k > c0. We claim, for every i; n� k + 1 � i � n, thatPr[AijAn ^ � � � ^Ai+1] = Pr[AijSn ^ � � � ^ Si+1] + o(1); (6)and Pr[RjAn ^ � � � ^Ai+1] = Pr[RjSn ^ � � � ^ Si+1] + o(1): (7)We will postpone proving these equations and will see how the theorem can be proven from theseequations.By Proposition 1, Pr[EijSn ^ : : : ^ Si+1] = 1 � o(1). By Fact 1, Pr[AijSn ^ � � � ^ Si+1] =Pr[AijSn ^ � � � ^ Si+1 ^ Ei] + o(1). So, we can assume that the clauses of �i are chosen uniformlyat random and that the number of clauses in �i are between yi and zi. Since PUR accepts �i ifand only if �i contains no positive literals, we have1� �1� i(i+ 2)2i � 1�yi � o(1) � Pr[AijAn ^ � � � ^Ai+1]� 1� �1� i(i+ 2)2i � 1�zi + o(1):10

In a similar vein, we have for all i,q1� �=2 � Pr[RjAn ^ � � � ^Ai+1] � 1:The probability �k is equal toPr[RkjAn ^ � � � ^Ak+1] � Yk+1�i�nPr[AijAn ^ � � � ^Ai+1]:The above two equalities provide a lower bound and an upper bound of these multiplicative terms.If we take a large enough n, since n�k+1 � i � n, the second term in the above is asymptoticallyequal to 1� e�2n�ic, and thus asymptotically equal to ��k . Now by (5) we have (4).For a general c > 0, de�ne c� to be the in�mum of all c's for which (4) holds. Suppose c� > 0.The single-step version of (6) provides Pr[RjAn] = Pr[RjSn] + o(1), so Pr[R] = Pr[An] Pr[RjAn] +o(1). Let c < c� and let n1 be such that for all n � n1, 2c(1� 1n)2 > c�. By Fact 1 and Proposition 1we have Pr[RjSn] = Pr[RjSn ^ En�1] + o(1). Then by Fact 2 we have Pr[RjSn ^ En�1 ^ (Nn�1 =yn�1)] � Pr[RjSn ^ En�1] � Pr[RjSn ^ En�1 ^ (Nn�1 = yn�1)]. Conditional on surviving stage nand on the value of Ni, �n�1 is a random formula. Since both yn�1 and zn�1 are asymptoticallyequal to 2nc, for large n, �n�1 is a random formula with n � 1 variables and 2n�1 � (2c + o(1))clauses. Thus, limn!1Pr[RjSn] = F (e�2c). Since Pr[An] is asymptotically equal to 1 � e�c, andF (c) = (1� e�c)F (2c), (4) holds for c.Now what remains is to prove (6) and (7). We will prove only (6); proving the other is quitesimilar. Let T be the event that PUR rejects in one of the �rst k stages. Note that Pr[T ] = o(1),as seen in Lemma 6. Note that T = Rn _ (Sn ^Rn�1) _ � � � _ (Sn ^ � � � ^ Sn�k+2 ^Rn�k+1), so theprobability of each of the k terms in the disjunction is o(1).Note thatPr[An ^ � � � ^Ai] = Xk�i+1;�k2f�1;+1g Pr[An ^ � � � ^Ai ^R�nn ^ � � � ^R�i+1i+1 ];where X�1 denotes the opposite of the event X. All terms in the sum, other than Pr[An ^ � � � ^Ai^R�1n ^� � �^R�1i+1] are either inconsistent (the algorithm rejects twice) or imply one of the termsappearing in the disjunction of the decomposition of T . Thus,Pr[An ^ � � � ^Ai] = Pr[An ^Rn ^ � � � ^Ai+1 ^Ri+1 ^Ai] + o(1);that is, Pr[An ^ � � � ^Ai] = Pr[Sn ^ � � � ^ Si+1 ^Ai] + o(1):Similarly, Pr[An ^ � � � ^Ai+1] = Pr[(Sn ^ � � � ^ Si+1] + o(1). Here note for every event A and everyevent B with Pr[B] > 0, jPr[A]+o(1)Pr[B]+o(1)� Pr[A]Pr[B] j = o(1): So, it su�ces to show that Pr[Sn^� � �^Si+1] > 0.This probability is 1 � Pr[PUR accepts in one of the �rst k steps] �Pr[PUR rejects in one of the�rst k steps], and thus, is at least 1 � e�c=41�e�c=4 � o(1) � Pr[T ]. Since e�c=41�e�c=4 < 1, the last value is> 0. 211

4 Further discussions and open problemsThere are several versions of Horn satis�ability whose phase transition is worth studying. One ofthem is the class of extended Horn formulas [CH91, SAFS95], for which PUR is still a valid algorithm[CH91]. Another case, seemingly more practically motivated, is k-HORN-SAT (that is satis�abilityof Horn formulas with a bound on the length of clauses allowed). Indeed, our result says that(once we allow arbitrarily long Horn clauses) a random Horn formula is almost certainly satis�able,unless it is very big. On the other hand preliminary considerations suggest that the location of thephase transition in k-HORN-SAT is located at a considerably smaller value. Since this class is asubclass of the class of Horn formulas, PUR is still a good algorithm, but the uniformity result inLemma 3 breaks down. Nevertheless, it is still possible to set up a (more complex) Markov chainthat describes PUR in this case.The expected running time of PUR would, on the other hand, deserve a closer investigation.The estimate from Corollary 2 is pretty coarse. We believe that the running time is concentratedaround its expected value. If completed, such an analysis would provide rigorous intuition aboutthe conjectured relationship [CKT91] between phase transitions and hard instances.The result we prove may add weight to the intuition by Monasson and Zecchina [MZ] thatphase transitions in tractable problems are easier to study because they have e�cient algorithmsthat often can be analyzed. It would be interesting to see if this is true for XOR-SAT as well (thesolution from [CD96] does not appear to rely on any algorithm).One important issue to be studied is whether HORN-SAT has a second-order (continuous)phase transition. This would provide more evidence in favor of the intuition from [MZK+96]that tractability on the average corresponds to continuous phase transitions (for 2-SAT this was\proved" in [MZ] using the replica method from statistical mechanics). As a matter of fact, itwould be interesting to see whether our results can be re-derived using the replica method.Finally, as in the case of XOR-SAT, we were able to \look inside (and parameterize) the phasetransition in HORN-SAT", proving that 2n is a regular threshold (in the terminology of [CD96]).This leaves 2-SAT to be the only case where the existence of a regular threshold has not beenestablished.AcknowledgmentThe authors thank Jin-Yi Cai for insightful comments and enjoyable discussions. We would alsolike to thank Nadia Creignou for valuable bibliographical references.

12

References[AES92] N. Alon, P. Erd}os, and J. Spencer. The probabilistic method (second edition). JohnWiley and Sons, 1992.[AM97] D. Achlioptas and M. Molloy. The analysis of a list coloring algorithm on a randomgraph. In Proceedings of the 37th IEEE Symposium on Foundations of Computer Sci-ence, 1997. (to appear).[BT86] B. Bollob�as and A. Thomason. Threshold functions. Combinatorica, 7:35{38, 1986.[CD96] N. Creignou and H. Daud�e. Satis�ability threshold for random XOR-CNF formulae.Technical Report 96-20, IML/UPR 9016, 1996.[CH91] V. Chandru and J. Hooker. Extended Horn sets in propositional logic. Journal of theACM, 38(1):205{221, 1991.[Chv91] V. Chv�atal. Almost all graphs with 1:44n edges are 3-colorable. Random Structuresand Algorithms, 2(1):11{28, 1991.[CKT91] Peter Cheeseman, Bob Kanefsky, and William Taylor. Where the really hard problemsare. In Proceedings of the 11'th IJCAI, pages 331{337, San Mateo, CA, 1991.[CR92] V. Chv�atal and B. Reed. Mick gets some (the odds are on his side). In Proceedings ofthe 32nd IEEE Symposium on Foundations of Computer Science, pages 620{626, 1992.[ER60] P. Erd}os and A. R�enyi. On the evolution of random graphs. Publications of the Math-ematical Institute of the Hungarian Academy of Science, 5:17{61, 1960.[FS93] P. Flajolet and R. Sedgewick. Counting and generating functions. Technical ReportTR#1888, INRIA, 1993.[FS96] A. Frieze and S. Suen. Analysis of two simple heuristics for random instances of k-SAT.Journal of Algorithms, 20:312{355, 1996.[Goe96] A. Goerdt. A threshold for satis�ability. Journal of Computer and System Sciences,53(3):469{486, 1996.[HS92] D. Heusch and E. Speckenmeyer. Some aspects of the probabilistic behavior of variantsof resolution. In Springer Verlag, editor, Proceedings of the 5th International Conferenceon Computer Science Logic, volume LNCS 626, pages 164{172, 1992.[HW74] D. Henschen and L. Wos. Unit refutation and Horn sets. Journal of the ACM, 21:590{605, 1974.[KKKS96] L. Kirousis, P. Kranakis, D. Krizanc, and Y. Stamatiou. Approximating the unsatis�a-bility threshold of random formulas. Technical Report TR96-027, School of ComputerScience, Carleton University, November 1996.[KMP90] D. Knuth, R. Motwani, and B. Pittel. Stable husbands. Random Structures and Algo-rithms, 1(1):1{14, 1990. 13

[KS83] J. Koml�os and E. Szemer�edi. Limit distribution for the existence of hamiltonian cyclesin a random graph. Discrete Mathematics, 43(1):55{63, 1983.[MZ] R. Monasson and R. Zecchina. Statistical mechanics of the random k-SAT model.Physical Review E. (to appear).[MZK+96] R. Monasson, R. Zecchina, S. Kirkpatrick, B. Selman, and L. Troyansky. Phase tran-sitions and search cost in the 2 + p-SAT problem. In 4th Workshop on Physics andComputation, Boston University, November 1996. Preliminary form published in In-terJournal, at http://dynamics.bu.edu/.[SAFS95] J. Schlipf, F. Annexstein, J. Franco, and R. Swaminathan. On �nding solutions toextended Horn formulas. Information Processing Letters, 54(3):133{137, 1995.[Sch78] T. J. Schaefer. The complexity of satis�ability problems. In Proceedings of the 13thACM Symposium on Theory of Computing, pages 216{226, 1978.

14