Almost 2-SAT is Fixed-Parameter Tractable
aa r X i v : . [ c s . D S ] A p r Almost 2-SAT is Fixed-Parameter Tractable
Igor Razgon and Barry O’Sullivan { i.razgon,b.osullivan } @cs.ucc.ie Computer Science Department, University College Cork, Ireland
Abstract.
We consider the following problem. Given a 2-CNF formula,is it possible to remove at most k clauses so that the resulting 2-CNFformula is satisfiable? This problem is known to different research com-munities in Theoretical Computer Science under the names ’Almost 2-SAT’, ’All-but- k O (15 k ∗ k ∗ m ) and thus we show that this problem is fixed-parametertractable. We consider the following problem. Given a formula, is it possible toremove at most k clauses so that the resulting formula is satisfiable? Thisproblem is known to different research communities in Theoretical ComputerScience under the names ’Almost 2-SAT’, ’All-but- k deletion’,’2-SAT deletion’. The status of fixed-parameter tractability of this problem isa long-standing open question in the area of Parameterized Complexity. Thequestion regarding the fixed-parameter tractability of this problem was firstraised in 1997 by Mahajan and Raman [12] (see [13] for the journal version). Thisquestion has been posed in the book of Niedermeier [16] being referred as one ofcentral challenges for parameterized algorithms design. Finally, in July 2007, thisquestion was included by Fellows in the list of open problems of the Dagstuhlseminar on Parameterized Complexity [6]. In this paper we resolve this openquestion by proposing an algorithm that solves this problem in O (15 k ∗ k ∗ m )time. Thus we show that this problem is fixed-parameter tractable ( fpt ). We start from the terminology we adopt regarding the names of the consideredproblems. We call
Almost 2-SAT (abbreviated as ) the optimizationproblem whose output is the smallest subset of clauses that have to be removedfrom the given 2-CNF formula so that the resulting 2-CNF formula is satisfiable.The parameterized 2-ASAT problem gets as additional input a parameter k andthe output of this problem is a set of at most k clauses whose removal makesthe given 2-CNF formula satisfiable, in case such a set exists. If there is no such set, the output is ’NO’. So, the algorithm proposed in this paper solves theparameterized 2-ASAT problem.We introduce a variation of the 2-ASAT problem called the annotated 2-ASAT problem with a single literal abbreviated as . The input ofthis problem is ( F, L, l ), where F is a 2-CNF formula, L is a set of literalssuch that F is satisfiable w.r.t. L (i.e. has a satisfying assignment which doesnot include negations of literals of L ), l is a single literal. The task is to find asmallest subset of clauses of F such that after their removal the resulting formulais satisfiable w.r.t. ( L ∪ { l } ). The parameterized versions of the 2-ASLASATproblem is defined analogously to the parameterized 2-ASAT problem.The description of the algorithm for the parameterized 2-ASAT problem isdivided into two parts. In the first part (which is the most important one) weprovide an algorithm which solves the parameterized 2-ASLASAT problem in O ∗ (5 k ) time. In the second part we show that the parameterized 2-ASAT problemcan be solved by O ∗ (3 k ) applications of the algorithm solving the parameterized2-ASLASAT problem. The resulting runtime follows from the product of thelast two complexity expressions. The transformation of the 2-ASAT probleminto the 2-ASLASAT problem is based on the iterative compression and can beseen as an adaptation of the method employed in [9] in order to solve the graphbipartization problem. In the rest of the subsection we overview the first part.In order to show that the 2-ASLASAT problem is FPT, we represent the2-ASLASAT problem as a separation problem and prove a number of theoremsbased on this view. In particular, we introduce a notion of a walk from a literal l ′ to a literal l ′′ in a 2-CNF formula F . We define the walk as a sequence ( l ′ ∨ l ) , ( ¬ l ∨ l ) , . . . , ( ¬ l k − ∨ l k ) , ( ¬ l k ∨ l ′′ ) of clauses of F such that literals areordered within each clause so that the second literal of each clause except thelast one is the negation of the first literal of the next clause. Then we prove that,given an instance ( F, L, l ) of the 2-ASLASAT problem, F is insatisfiable w.r.t. L ∪ { l } if and only if there is a walk from ¬ L (i.e. from the set of negations ofthe literals of L ) to ¬ l or a walk from ¬ l to ¬ l . Thus the 2-ASLASAT problemcan be viewed as a problem of finding the smallest set of clauses whose removalbreaks all these walks.Next we define the notion of a path of F as a walk of F with no repeatedclauses. Based on this notion we prove a Menger’s like theorem. In particular,given an instance ( F, L, l ) of the 2-ASLASAT problem, we show that the smallestnumber of clauses whose removal breaks all the paths from ¬ L to ¬ l equalsthe largest number of clause-disjoint paths from ¬ L to ¬ l (for this result itis essential that F is satisfiable w.r.t. L ). Based on this result, we show thatthe size of the above smallest separator of ¬ L from from ¬ l can be computedin a polynomial time by a Ford-Fulkerson-like procedure. Thus this size is apolynomially computable lower bound on the size of the solution of ( F, L, l ).Next we introduce the notion of a neutral literal l ∗ of ( F, L, l ) whose mainproperty is that the number of clauses which separate ¬ ( L ∪ { l ∗ } ) from ¬ l equalsthe number of clauses separating ¬ L from ¬ l . Then we prove a theorem statingthat in this case the size of a solution of ( F, L ∪ { l ∗ } , l ) does not exceed the sizef a solution of ( F, L, l ). The strategy of the proof is similar to the strategy ofthe proof of the main theorem of [2].Having proved all the above theorems, we present the algorithm solving theparameterized 2-ASLASAT problem on input (
F, L, l, k ). The algorithm selectsa clause C . If C includes a neutral literal l ∗ then the algorithm applies itselfrecursively to ( F, L ∪ { l ∗ } , l, k ) (this operation is justified by the theorem inthe previous paragraph). If not, the algorithm produces at most three brancheson one of them it removes C from F and decreases the parameter. On each ofthe other branches the algorithm adds one of literals of C to L and applies itselfrecursively without changing the size of the parameter. The search tree producedby the algorithm is bounded because on each branch either the parameter isdecreased or the lower bound on the solution size is increased (because the literalsof the selected clause are not neutral ). Thus on each branch the gap between theparameter and the lower bound of the solution size is decreased which ensuresthat the size of the search tree exponentially depends only on k and not on thesize of F . As said above, the parameterized problem has been introduced in [12]. In[11], this problem was shown to be a generalization of the parameterized graphbipartization problem, which was also an open problem at that time. The latterproblem has been resolved in [18]. The additional contribution of [18] was intro-ducing a method of iterative compression which has had a considerable impacton the design of parameterized algorithms. The most recent algorithms basedon this method are currently the best algorithm for the undirected FeedbackVertex Set [3] and the first parameterized algorithm for the famous Direct FVSproblem [4]. For earlier results based on the iterative compression, we refer thereader to a survey article [10].The study of parameterized graph separation problems has been initiatedin [14]. The technique introduced by the author allowed him to design fixed-parameter algorithms for the multiterminal cut problem and for a more generalmulticut problem, the latter assumed that the number of pairs of terminals to beseparated was also a parameter. The latter result has been extended in [8] wherefixed-parameter algorithms for multicut problems on several classes of graphshave been proposed. The first O ( c k ∗ poly ( n )) algorithm for the multiterminalcut problem has been proposed in [2]. A reformulation of the main theorem of [2]is an essential part of the parameterized algorithm for the Directed FVS problem[4] mentioned in the previous paragraph. In the present paper, we applied thestrategy of proof of this theorem in order to show that adding a neutral literalto the set of literals of the input does not increase the solution size. Along withcomputing the separators, the methods of computing disjoint paths have beeninvestigated. The research led to intractability results [19] and parameterizedapproximability results [7].The parameterized MAX-SAT problem (a complementary problem to the oneconsidered in the present paper) where the goal is to satisfy at least k clauses ofrbitrary sizes received a considerable attention from the researchers resulted ina series of improvements of the worst-case upper bound on the runtime of thisproblem. Currently the best algorithm is given in [5] and solves this problem in O (1 . k + | F | ), where | F | is the size of the given formula. In Section 2 we introduce the terminology which we use in the rest of the paper.In Section 3 we prove the theorems mentioned in the above overview subsection.In Section 4 we present an algorithm for the parameterized 2-ASLASAT problem,prove its correctness and evaluate the runtime. In Section 5 we present theiterative compression based transformation from parameterized 2-ASAT problemto the parameterized 2-SLASAT problem.
A CNF formula F is called a if each clause of F is of size at most2. Throughout the paper we make two assumptions regarding the considered 2-CNF formulas. First, we assume that all the clauses of the considered formulasare of size 2. If a formula has a clause ( l ) of size 1 then this clause is representedas ( l ∨ l ). Second, everywhere except the very last theorem, we assume that allthe clauses of any considered formula are pairwise distinct. This assumptionallows us to represent the operation of removal clauses from a formula in a set-theoretical manner. In particular, let S be a set of clauses . Then F \ S is a2-CNF formula which is the AN D of clauses of F that are not contained in S .The result of removal a single clause C is denoted by F \ C rather than F \ { C } .Let F , S , C , L be a 2-CNF formula, a set of clauses, a single clause, and a setof literals. Then V ar ( F ), V ar ( S ), V ar ( C ), V ar ( L ) denote the set of variableswhose literals appear in F , S , C , and L , respectively. For a single literal l , wedenote by V ar ( l ) the variable of l . Also we denote by Clauses ( F ) the set ofclauses of F .A set of literals L is called non-contradictory if it does not contain a literaland its negation. A literal l satisfies a clause ( l ∨ l ) if l = l or l = l . Given a 2-CNF formula F , a non-contradictory set of literals L such that V ar ( F ) = V ar ( L )and each clause of F is satisfied by at least one literal of L , we call L a satisfyingassignment of F . F is satisfiable if it has at least one satisfying assignment.Given a set of literals L , we denote by ¬ L the set consisting of negations of allthe literals of L . For example, if L = { l , l , ¬ l } then ¬ L = {¬ l , ¬ l , l } .Let F be a 2-CNF formula and L be a set of literals. F is satisfiable withrespect to L if F has a satisfying assignment P which does not intersect with Note that the clause ( l ∨ l ) is the same as the clause ( l ∨ l ). We implicitly assume that all the clauses considered in this paper have size 2 L . The notion of satisfiability of a 2-CNF formula with respect to the givenset of literals will be very frequently used in the paper, hence, in order to savethe space, we introduce a special notation for this notion. In particular, we saythat SW RT ( F, L ) is true (false) if F is, respectively, satisfiable (not satisfiable)with respect to L . If L consists of a single literal l then we write SW RT ( F, l )rather than
SW RT ( F, { l } ). A walk of the given 2-CNF formula F is a non-empty sequence w = ( C , . . . , C q ) of (not necessarily distinct) clauses of F having the followingproperty. For each C i one of its literals is specified as the first literal of C i , theother literal is the second literal , and for any two consecutive clauses C i and C i +1 the second literal of C i is the negation of the first literal of C i +1 . Let w = ( C , . . . , C q ) be a walk and let l ′ and l ′′ be the first literal of C and the second literal of C q , respectively. Then we say that l ′ is the first literalof w , that l ′′ is the last literal of w , and that w is a walk from l ′ to l ′′ . Let L be a set of literals such that l ′ ∈ L . Then we say that w is a walk from L . Let C = ( l ∨ l ) be a clause of w . Then l is a first literal of C with respect to(w.r.t.) w if l is the first literal of some C i such that C = C i . A second literalof a clause with respect to a walk is defined accordingly. (Generally a literal ofa clause may be both a first and a second with respect to the given walk, whichis shown in the example below). We denote by reverse ( w ) a walk ( C q , . . . , C )in which the first and the second literals of each entry are exchanged w.r.t. w .Given a clause C ′′ = ( ¬ l ′′ ∨ l ∗ ), we denote by w + ( ¬ l ′′ ∨ l ∗ ) the walk obtained byappending C ′′ to the end of w and setting ¬ l ′′ to be the first literal of the lastentry of w + ( ¬ l ′′ ∨ l ∗ ) and l ∗ to be the second one. More generally, let w ′ be awalk whose first literal is ¬ l ′′ . Then w + w ′ is the walk obtained by concatenationof w ′ to the end of w with the first and second literals of all entries in w and w ′ preserving their roles in w + w ′ . Definition 2.
A path of a 2-CNF formula F is a walk of F all clauses of whichare pairwise distinct. Consider an example demonstrating the above notions. Let w = ( l ∨ l ) , ( ¬ l ∨ l ) , ( ¬ l ∨ l ) , ( ¬ l ∨ ¬ l ) , ( l ∨ ¬ l ) , ( l ∨ l ) be a walk of some 2-CNF formulapresented so that the first literals of all entries appear before the second lit-erals. Then l and l are the first and the last literals of w , respectively, andhence w is a walk from l to l . The clause ( ¬ l ∨ l ) has an interesting prop-erty that both its literals are first literals of this clause with respect to w (andtherefore the second literals as well). The second item of w witnesses ¬ l be-ing a first literal of ( ¬ l ∨ l ) w.r.t. w (and hence l being a second one),while the second item of w from the end provides the witness for l being We do not say ’ P contains L ’ because generally V ar ( L ) may be not a subset of V ar ( F ) first literal of ( ¬ l ∨ l ) w.r.t. w (and hence ¬ l being a second one). Therest of clauses do not possess this property. For example l is the first literalof ( l ∨ l ) w.r.t. w (as witnessed by the first entry) but not the second one.Next, reverse ( w ) = ( l ∨ l ) , ( ¬ l ∨ l ) , ( ¬ l ∨ ¬ l ) , ( l ∨ ¬ l ) , ( l ∨ ¬ l ) , ( l ∨ l ).Let w be the prefix of w containing all the clauses except the last one. Then w = w + ( l ∨ l ). Let w be the prefix of w containing the first 4 entries, w bethe suffix of w containing the last 2 entries. Then w = w + w . Finally, observethat w is not a path due to the repeated occurrence of clause ( ¬ l ∨ l ), while w is a path.
1. A Culprit Set (CS) of a 2-CNF formula F is a subset S of Clauses ( F ) such that F \ S is satisfiable.2. Let ( F, L, l ) be a triple where F is a 2-CNF formula, L is a non-contradictoryset of literals such that SW RT ( F, L ) is true and l s a literal such that V ar ( l ) / ∈ V ar ( L ) . A CS of ( F, L, l ) is a subset S of Clauses ( F ) such that SW RT ( F \ S, L ∪ { l } ) is true. Having defined a CS with respect to two different structures, we define prob-lems of finding a smallest CS (SCS) with respect to these structures. In particular
Almost 2-SAT problem (2-ASAT problem) is defined as follows: given a 2-CNFformula F , find an SCS of F . The Annotated Almost 2-SAT problem with singleliteral (2-ASLASAT problem) is defined as follows: given the triplet (
F, L, l ) asin the last item of Definition 3, find an SCS of (
F, L, l ).Now we introduce parameterized versions of the 2-ASAT and 2-ASLASATproblems, where the parameter restricts the size of a CS. In particular, the inputof the parameterized 2-ASAT problem is (
F, k ), where F is a 2-CNF formulaand k is a non-negative integer. The output is a CS of F of size at most k , ifone exists. Otherwise, the output is ’NO’. The input of the parameterized 2-ASLASAT problem is ( F, L, l, k ) where (
F, L, l ) is as specified in Definition 3.The output is a CS of (
F, L, l ) of size at most k , if there is such one. Otherwise,the output is ’NO’. Let F be a formula and w be a walk of F . Let l x and l y be thefirst and the last literals of w , respectively. Then SW RT ( F, {¬ l x , ¬ l y } ) is false.In particular, if l x = l y then SW RT ( F, ¬ l x ) is false. Proof.
Since w is a walk of F , V ar ( l x ) ∈ V ar ( F ) and V ar ( l y ) ∈ V ar ( F ).Consequently for any satisfying assignment P of F both V ar ( l x ) and V ar ( l y )belong to V ar ( P ). Therefore SW RT ( F, {¬ l x , ¬ l y } ) may be true only if there isa satisfying assignment of F containing both ¬ l x and ¬ l y . We going to show thathis is impossible by induction on the length of w This is clear if | w | = 1 becausein this case w = ( l x ∨ l y ). Assume that | w | > w = w ′ + ( l t ∨ l y ), where w ′ is a walk of w from l x to ¬ l t . By the induction assumption SW RT ( F, {¬ l x , l t } ) is false and hence anysatisfying assignment of F containing ¬ l x contains ¬ l t and hence contains l y . Aswe noted above in the proof, this implies that SW RT ( F, {¬ l x , ¬ l y } ) is false. (cid:4) Lemma 2.
Let F be a formula and let L be a set of literals such that SW RT ( F, L ) is true. Let C = ( l ∨ l ) be a clause of F and let w be a walk of F from ¬ L containing C and assume that l is a first literal of C w.r.t. w . Then l is not a second literal of C w.r.t. any walk from ¬ L . Proof.
Let w ′ be a walk of F from ¬ L which contains C so that l is a secondliteral of C w.r.t. w ′ . Then w ′ has a prefix w ′′ whose last literal is l . Let l ′ be thefirst literal of w ′ (and hence of w ′′ ). According to Lemma 1, SW RT ( F, {¬ l , ¬ l ′ } )is false. Therefore if l ∈ ¬ L then SW RT ( F, L ) is false (because {¬ l , ¬ l ′ } ⊆ L )in contradiction to the conditions of the lemma. Thus l / ∈ ¬ L and hence l isnot the first literal of w . Consequently, w has a prefix w ∗ whose last literal is ¬ l .Let l ∗ be the first literal of w (and hence of w ∗ ). Then w ∗ + reverse ( w ′′ ) is a walkfrom l ∗ to l ′ , both belong to ¬ L . According to Lemma 1, SW RT ( F, {¬ l ∗ , ¬ l ′ } )is false and hence SW RT ( F, L ) is false in contradiction to the conditions ofthe lemma. It follows that the walk w ′ does not exist and the present lemma iscorrect. (cid:4) Lemma 3.
Let F be a formula, let L be a set of literals such that SW RT ( F, L ) is true, and let w be a walk from ¬ L . Then F has a path p withthe same first and last literals as w and the set of clauses of p is a subset of theset of clauses of w . Proof.
The proof is by induction on the length of w . The statement is clear if | w | = 1 because w itself is the desired path. Assume that | w | > ¬ L . If all clauses of w are distinct then w is thedesired path. Otherwise, let w = ( C , . . . , C q ) and assume that C i = C j where1 ≤ i < j ≤ q . By Lemma 2, C i and C j have the same first (and, of course, thesecond) literal. If i = 1, let w ′ be the suffix of w starting at C j . Otherwise, if C j = q , let w ′ be the prefix of w ending at C i . If none of the above happens then w ′ = ( C , . . . , C i , C j +1 , C q ). In all the cases, w ′ is a walk of F with the samefirst and last literals as w such that | w ′ | < | w | and the set of clauses of w ′ is asubset of the set of clauses of w . The desired path is extracted from w ′ by theinduction assumption. (cid:4) F, L, l ): necessary and sufficient conditionTheorem 1.
Let ( F, L, l ) be an instance of the 2-ASLASAT problem. Then SW RT ( F, L ∪ { l } ) is false if and only if F has a walk from ¬ l to ¬ l or awalk from ¬ L to ¬ l . roof. Assume that F has a walk from ¬ l to ¬ l or from ¬ l ′ to ¬ l such that l ′ ∈ L . Then, according to Lemma 1, SW RT ( F, l ) is false or
SW RT ( F, { l ′ , l } )is false, respectively. Clearly in both cases SW RT ( F, L ∪ { l } ) is false as L ∪ { l } is, by definition, a superset of both { l } and { l ′ , l } .Assume now that SW RT ( F, L ∪{ l } ) is false. Let I be a set of literals including l and all literals l ′ such that F has a walk from ¬ l to l ′ . Let S be the set of allclauses of F satisfied by I .Assume that I is non-contradictory and does not intersect with ¬ L . Let P be a satisfying assignment of F which does not intersect with ¬ L (such anassignment exists according to definition of the problem). Let P ′ be the subset of P such that V ar ( P ′ ) = V ar ( F ) \ V ar ( I ). Observe that P ′ ∪ I is non-contradictory. Indeed, P ′ is non-contradictory as being a subset of asatisfying assignment P of F , I is non-contradictory by assumption, and due tothe disjointness of V ar ( I ) and V ar ( P ′ ), there is no literal l ′ ∈ I and ¬ l ′ ∈ P ′ .Next, note that every clause C of F is satisfied by P ′ ∪ I . Indeed, if C ∈ S then C is satisfied by I , by definition of I . Otherwise, assume first that V ar ( C ) ∩ V ar ( I ) = ∅ . Then C = ( ¬ l ′ ∨ l ′′ ), where l ′ ∈ I . Then either l ′ = l or F hasa walk w from ¬ l to l ′ . Consequently, either ( ¬ l ′ ∨ l ′′ ) or w + ( ¬ l ′ ∨ l ′′ ) is awalk from ¬ l to l ′′ witnessing that l ′′ ∈ I and hence C ∈ S , a contradiction. Itremains to conclude that V ar ( C ) ∩ V ar ( I ) = ∅ , i.e. that V ar ( C ) ⊆ V ar ( P ′ ). If P ′ contains contradictions of both literals of C then P \ P ′ contains at least oneliteral of C implying that P contains a literal and its negation in contradiction tothe definition of P . Consequently, C is satisfied by P ′ . Taking into account that V ar ( P ′ ∪ I ) = V ar ( F ), P ′ ∪ I is a satisfying assignment of F . Observe that P ′ ∪ I does not intersect with ¬ ( L ∪ l ). Indeed, both I and P ′ do not intersect with ¬ L ,the former by assumption the latter by definition. Next, l ∈ I and P ′ ∪ I is non-contradictory, hence ¬ l / ∈ P ′ ∪ I . Thus P ′ ∪ I witnesses that SW RT ( F, L ∪{ l } ) istrue in contradiction to our assumption. Thus our assumption regarding I madein the beginning of the present paragraph is incorrect.It follows from the previous paragraph that either I contains a literal and itsnegation or I intersects with ¬ L . In the former case if ¬ l ∈ I then by definitionof I there is a walk from ¬ l to ¬ l . Otherwise I contains l ′ and ¬ l ′ such that V ar ( l ′ ) = V ar ( l ). Let w be the walk from ¬ l to l ′ and let w be the walk from ¬ l to ¬ l ′ (both walks exist according tot he definition of I ). Clearly w + reverse ( w )is a walk from ¬ l to ¬ l . In the latter case, F has a walk w from ¬ l to ¬ l ′ suchthat l ′ ∈ L . Clearly reverse ( w ) is a walk from ¬ L to ¬ l . Thus we have shownthat if SW RT ( F, L ∪ { l } ) is false then F has a walk from ¬ l to ¬ l or a walkfrom ¬ L to ¬ l , which completes the proof of the theorem. (cid:4) A set SC of clauses of a 2-CNF formula F is a separator withrespect to a set of literals L and literal l y if F \ SC does not have a path from L to l y . e denote by SepSize ( F, L, l y ) the size of a smallest separator of F w.r.t. L and l y and by OptSep ( F, L, l y ) the set of all smallest separators of F w.r.t. L and l y . Thus for any S ∈ OptSep ( F, L, l y ), | S | = SepSize ( F, L, l y ).Given the above definition, we derive an easy corollary from Lemma 1. Corollary 1.
Let ( F, L, l ) be an instance of the 2-ASLASAT problem. Then thesize of an SCS of this instance is greater than or equal to SepSize ( F, ¬ L, ¬ l ) . Proof.
Assume by contradiction that S is a CS of ( F, L, l ) such that | S | Let D = ( V, A ) be the implication graph on F which is a digraph whose set V ( D ) of nodes corresponds to the set of literals of the variables of F and ( l , l )is an arc in its set A ( D ) of arcs if and only if ( ¬ l ∨ l ) ∈ Clauses ( F ). We saythat arc ( l , l ) represents the clause ( ¬ l ∨ l ). Note that each arc representsexactly one clause while a clause including two distinct literals is representedby two different arcs. In particular, if ¬ l = l , the other arc which represents( ¬ l ∨ l ) is ( ¬ l , ¬ l ). In the context of D we denote by L and ¬ L the setof nodes corresponding to the literals of L and ¬ L , respectively. We adopt thedefinition of a walk and a path of a digraph given in [1]. Taking into account thatall the walks of D considered in this paper are non-empty we represent themas the sequences of arcs instead of alternative sequences of arcs and nodes. Inother words, if w = ( x , e , . . . , x q , e q , x q +1 ) is a walk of D , we represent it as( e , . . . , e q ). The arc separator of D w.r.t. a set of literals L and a literal l is a setof arcs such that the graph resulting from their removal has no path from L to l . Similarly to the case with formulas, we denote by ArcSepSize ( D, L, l )the size of the smallest arc separator of D w.r.t. L and l . Theorem 2. Let F be a formula, let L be a set of literals such that SW RT ( F, ¬ L ) is true. Let l y be a literal such that V ar ( l y ) / ∈ V ar ( L ) . Then thefollowing statements hold.1. The largest number M axP aths ( F, L, l y ) of clause-disjoint paths from L to l y in F equals the largest number M axP aths ( D, ¬ L, l y ) of arc-disjoint pathsfrom ¬ L to l y in D .2. SepSize ( F, L, l y ) = ArcSepSize ( D, ¬ L, l y ) M axP aths ( F, L, l y ) = SepSize ( F, L, l y ) . Note that generally (if there is no requirement that SW RT ( F, ¬ L ) is true) SepSize ( F, L, l y ) may differ from ArcSepSize ( D, ¬ L, l y ). The reason is that aseparator of D may correspond to a smaller separator of F due to the factthat some arcs may represent the same clause. As we will see in the proof, therequirement that SW RT ( F, ¬ L ) is true rules out this possibility. Proof of Theorem 2. We may safely assume that V ar ( L ) ⊆ V ar ( F ) be-cause literals whose variables do not belong to V ar ( F ) cannot be starting pointsf paths in F . Also since l y / ∈ ¬ L any walk from ¬ L to l y in D is non-empty. Weuse this fact implicitly in the proof without referring to it.Let w = ( C , . . . , C q ) be a walk from l ′ to l ′′ in F . Let w ( D ) = ( a , . . . , a q )be the sequence of arcs of D constructed as follows. For each C i = ( l ∨ l ) (weassume that l is the first literal of C i ), a i = ( ¬ l , l ). Then ¬ l ′ is the tail of a and l ′′ is the head of a q . Also, by definition of w , for any two arcs a i and a i +1 ,the head of a i is the same as the tail of a i +1 . It follows that w ( D ) is a walk from ¬ l ′ to l ′′ in D such that each a i represents C i . Now, let P = { p , . . . , p t } be aset of clause-disjoint paths from L to l y in F . Then { p ( D ) , . . . , p q ( D ) } is a setof walks from ¬ L to l y in D which are arc-disjoint. Indeed, if an arc a belongsto both p i ( D ) and p j ( D ) (where i = j ) then, due to the disjointness of p i and p j , this arc a represents two different clauses which is impossible by definition.Since every p i ( D ) includes a path p ′ i ( D ) with the same first and last nodes andthe set of arcs being a subset of the set of arcs of p i ( D ) (see [1], Proposition4.1.), we can specify t arc-disjoint paths { p ′ ( D ) , . . . p ′ t ( D ) } from ¬ L to l y , whichshows that M axP aths ( D, ¬ L, l y ) ≥ M axP aths ( F, L, l y ).Conversely, let p = ( a , . . . , a q ) be a path from ¬ l ′ to l ′′ in D . Let p ( F ) bethe sequence ( C , . . . , C q ) of clauses defined as follows. For each a i = ( ¬ l , l ), C i = ( l ∨ l ), l and l are specified as the first and the second literals of C i ,respectively. Then l ′ is the first literal of C , l ′′ is the last literal of C q and foreach consecutive pair C i and C i +1 the second literal of C i is the negation of thefirst literal of C i +1 . In other words, p ( F ) is a walk from l ′ to l ′′ in F where each C i is represented by a i . Now, let P = { p , . . . , p t } be a set of arc-disjoint pathsfrom ¬ L to l y in D . Then { p ( F ) , . . . p t ( F ) } is a set of walks from L to l y in F . Observe that these walks are clause-disjoint. Indeed, if a clause C = ( l ∨ l )belongs to both p i ( F ) and p j ( F ) (where i = j ) then ( l ∨ l ) is representedby arc, say, ( ¬ l , l ) in p i and by arc ( ¬ l , l ) in p j . By construction of p i ( F )and p j ( F ), l is the first literal of C w.r.t. p i ( F ) and the second literal of C w.r.t. p j ( F ) which contradicts Lemma 2. That is the walks of { p ( F ) , . . . , p t ( F ) } are clause-disjoint. Also, by Lemma 3, for each p i ( F ), there is a path p ′ i ( F ) of F with the same first and last literals as p i ( F ) and whose set of clauses is asubset of the set of clauses of p i ( F ). Clearly the paths { p ′ ( F ) , . . . , p ′ t ( F ) } areclause disjoint. Thus M axP aths ( D, ¬ L, l y ) ≤ M axP aths ( F, L, l y ). Combiningthis statement with the statement proven in the previous paragraph, we concludethat M axP aths ( D, ¬ L, l y ) = M axP aths ( F, L, l y ).Let S ∈ OptSep ( F, L, l y ). For each C ∈ S , let p C be a path of F from L to l y including C (such a path necessarily exists due to the minimality of S ). Let a ( C ) be an arc of p C ( D ) which represents C . Let S ( D ) be the set of all a ( C ). Weare going to show that S ( D ) separates ¬ L from l y in D . Assume that this is notso and let p ∗ be a path from ¬ L to l y in D \ S ( D ). Then, according to Lemma3, p ∗ ( F ) necessarily includes a path from L to l y and hence p ∗ ( F ) contains atleast one clause C = ( l ∨ l ) of S . Let a ∗ be an arc of p ∗ which represents C . By definition of of p ∗ , a ∗ = a ( C ) and hence a ( C ) is, say ( ¬ l , l ) and a ∗ is( ¬ l , l ). By definition of p C ( D ) and p ∗ ( F ), l is the first literal of C w.r.t. p C and the second one w.r.t. p ∗ ( F ) which contradicts Lemma 2. This shows that ( D ) separates ¬ L from l y in D and, consequently, taking into account that | S ( D ) | = | S | , ArcSepSize ( D, ¬ L, l y ) ≤ SepSize ( F, L, l y ).Let S be a smallest arc separator of D w.r.t. ¬ L and l y . For each a ∈ S , let p a be a path of D from ¬ L to l y which includes a . Let C ( a ) be a clause of p a ( F )which is represented by a . Denote the set of all C ( a ) by S ( F ). Then we can showthat S ( F ) is a separator w.r.t. L and l y in F . In particular, let p ∗ be a path from L to l y in F \ S ( F ). Then p ∗ ( D ) necessarily includes an arc a ∈ S . Let C ∗ be a clauseof p ∗ represented by a . Since C ∗ = C ( a ), the arc a represents two different clausesin contradiction to the definition of D . Consequently, taking into account that | S ( F ) | ≤ | S | , ArcSepSize ( D, ¬ L, l y ) ≥ SepSize ( F, L, l y ). Considering the pre-vious paragraph we conclude that ArcSepSize ( D, ¬ L, l y ) = SepSize ( F, L, l y ).Let PF be a largest set of clause-disjoint paths from L to l y in F and let PD be a largest set of arc-disjoint paths from ¬ L to l y in D . It follows from theabove proof that in order to show that | PF | = SepSize ( F, L, l y ), it is sufficientto show that | PD | = ArcSepSize ( D, ¬ L, l y ). Taking into account that by ourassumption l y / ∈ ¬ L , the latter can be easily derived by contracting the verticesof ¬ L into one vertex and applying the arc version of Menger’s Theorem fordirected graphs [1]. (cid:4) Let ( F, L, l ) be an instance of the problem. A literal l ∗ is a neutral literal of ( F, L, l ) if ( F, L ∪ { l ∗ } , l ) is a valid instance of problem and SepSize ( F, ¬ L, ¬ l ) = SepSize ( F, ¬ ( L ∪ { l ∗ } ) , ¬ l ) . The following theorem has a crucial role in the design of the algorithm pro-vided in the next section. Theorem 3. Let ( F, L, l ) be an instance of the 2-ASALSAT problem and let l ∗ be a neutral literal of ( F, L, l ) . Then there is a CS of ( F, L ∪ { l ∗ } , l ) of sizesmaller than or equal to the size of an SCS of ( F, L, l ) . Before we prove Theorem 3, we extend our terminology. Definition 6. Let ( F, L, l ) be an instance of the 2-ASLASAT problem. A clause C = ( l ∨ l ) of F is reachable from ¬ L if there is a walk w from ¬ L including C . Assume that l is a first literal of C w.r.t. w . Then l is called the main literal of C w.r.t. ( F, L, l ) . Given Definition 6, Lemma 2 immediately implies the following corollary. Corollary 2. Let ( F, L, l ) be an instance of the 2-ASLASAT problem and let C = ( l ∨ l ) be a clause reachable from ¬ L . Assume that l is the main literal of C w.r.t. ( F, L, l ) . Then l is not a second literal of C w.r.t. any walk w ′ startingfrom ¬ L and including C . ow we are ready to prove Theorem 3. Proof of Theorem 3. Let SP ∈ OptSep ( F, ¬ ( L ∪ { l ∗ } ) , ¬ l ). Since ¬ L is asubset of ¬ ( L ∪ { l ∗ } ), SP is a separator w.r.t. ¬ L and ¬ l in F . Moreover, since l ∗ is a neutral literal of ( F, L, l ), SP ∈ OptSet ( F, ¬ L, ¬ l ).In the F \ SP , let R be the set of clauses reachable from ¬ L and let N R be the rest of the clauses of F \ SP . Observe that the sets R, N R, SP area partition of the set of clauses of F .Let X be a SCS of ( F, L, l ). Denote X ∩ R , X ∩ SP , X ∩ N R by XR , XSP , XN R respectively. Observe that the sets XR, XSP, XN R are a partition of X .Let Y be the subset of SP \ XSP including all clauses C = ( l ∨ l ) (weassume that l is the main literal of C ) such that there is a walk w from l to ¬ l with C being the first clause of w and all clauses of w following C (if any)belong to N R \ XN R . We call this walk w a witness walk of C . By definition, SP \ XP = SP \ X and N R \ XN R = N R \ X , hence the clauses of w do notintersect with X . Claim 1 | Y | ≤ | XR | . Proof. By definition of the problem, SW RT ( F, L ) is true. There-fore, according to Theorem 2, there is a set P of | SP | clause-disjoint paths from ¬ L to ¬ l . Clearly each C ∈ SP participates in exactly one path of P and each p ∈ P includes exactly one clause of SP . In other words, we can make one-to-onecorrespondence between paths of P and the clauses of SP they include. Let PY be the subset of P consisting of the paths corresponding to the clauses of Y . Weare going to show that for each p ∈ PY the clause of SP corresponding to p ispreceded in p by a clause of XR .Assume by contradiction that this is not true for some p ∈ PY and let C = ( l ∨ l ) be the clause of SP corresponding to p with l being the main literalof C w.r.t. ( F, L, l ). By our assumption, C is the only clause of SP participatingin p , hence all the clauses of p preceding C belong to R . Consequently, the onlypossibility of those preceding clauses to intersect with X is intersection with XR . Since this possibility is ruled out according to our assumption, we concludethat no clause of p preceding C belongs to X . Next, according to Corollary 2, l is the first literal of C w.r.t p , hence the suffix of p starting at C can bereplaced by the witness walk of C and as a result of this replacement, a walk w ′ from ¬ L to ¬ l is obtained. Taking into account that the witness walk of C doesnot intersect with X , we get that w ′ does not intersect with X . By Theorem 1, SW RT ( F \ X, L ∪ { l } ) is false in contradiction to being X a CS of ( F, L, l ). Thiscontradiction shows that our initial assumption fails and C is preceded in p bya clause of XR .In other words, each path of PY intersects with a clause of XR . Since thepaths of PY are clause-disjoint, | XR | ≥ | PY | = | Y | , as required. (cid:3) Consider the set X ∗ = Y ∪ XSP ∪ XN R . Observe that | X ∗ | = | Y | + | XSP | + | XN R | ≤ | XR | + | XSP | + | XN R | = | X | , the first equality follows from themutual disjointness of Y , XSP and XN R by their definition, the inequalityfollows from Claim 1, the last equality was justified in the paragraph where theets XP , XSP , XN R , and X have been defined. We are going to show that X ∗ is a CS of ( F, L ∪ { l ∗ } , l ) which will complete the proof of the present theorem. Claim 2 F \ X ∗ has no walk from ¬ ( L ∩ { l ∗ } ) to ¬ l . Proof. Assume by contradiction that w is a walk from ¬ ( L ∩ { l ∗ } ) to ¬ l in F \ X ∗ . Taking into account that SW RT ( F \ X ∗ , L ∪ { l ∗ } ) is true (becausewe know that SW RT ( F, L ∪ { l ∗ } ) is true), and applying Lemma 3, we get that F \ X ∗ has a path p from ¬ ( L ∩ { l ∗ } ) to ¬ l . As p is a path in F , it includes atleast one clause of SP (recall that SP is a separator w.r.t. ¬ ( L ∩ { l ∗ } ) and ¬ l in F ). Let C = ( l ∨ l ) be the last clause of SP as we traverse p from ¬ ( L ∩{ l ∗ } ) to ¬ l and assume w.l.o.g. that l is the main literal of C w.r.t. ( F \ X ∗ , L ∪ { l ∗ } , l )(and hence of ( F, L ∪ { l ∗ } , l )). Let p ∗ be the suffix of p starting at C .According to Corollary 2, l is the first literal of p ∗ . In the next paragraphwe will show that no clause of R follows C is p ∗ . Combining this statement withthe observation that the clauses of F \ X ∗ can be partitioned into R , SP \ XSP and N R \ XN R (the rest of clauses belong to X ∗ ) we conclude that p ∗ is awalk witnessing that C ∈ Y . But this is a contradiction because by definition Y ⊆ X ∗ . This contradiction will complete the proof of the present claim.Assume by contradiction that C is followed in p ∗ by a clause C ′ = ( l ′ ∨ l ′ ) of R (we assume w.l.o.g. that l ′ is the main literal of C ′ w.r.t. ( F \ X ∗ , L ∪ { l ∗ } , l )).Let p ′ be a suffix of p ∗ starting at C ′ . It follows from Corollary 2 that the firstliteral of p ′ is l ′ . By definition of R and taking into account that R ∩ X ∗ = ∅ , F \ X ∗ has a walk w from ¬ L whose last clause is C ′ and all clauses of whichbelong to R . By Corollary 2, the last literal of w is l ′ . Therefore we can replace C ′ by w in p ′ . As a result we get a walk w from ¬ L to ¬ l in F \ X ∗ . By Lemma3, there is a path p from ¬ L to ¬ l whose set of clauses is a subset of the set ofclauses of w . As p is also a path of F , it includes a clause of SP . However, w does not include any clause of SP by definition. Therefore, p ′ includes a clauseof SP . Consequently, p ∗ includes a clause of SP following C in contradiction tothe selection of C . This contradiction shows that clause C ′ does not exist, whichcompletes the proof of the present claim as noted in the previous paragraph. (cid:3) Claim 3 F \ X ∗ has no walk from ¬ l to ¬ l . Proof. Assume by contradiction that F \ X ∗ has a walk w from ¬ l to ¬ l . Bydefinition of X and Theorem 1, w contains at least one clause of X . Since XSP and XN R are subsets of X ∗ , w contains a clause C ′ = ( l ′ ∨ l ′ ) of XR . Assumew.l.o.g. that l ′ is the main literal of C ′ w.r.t. ( F, L, l ). If l ′ is a first literal of C ′ w.r.t. w then let w ∗ be a suffix of w whose first clause is C ′ and first literalis l ′ . Otherwise, let w ∗ be a suffix of reverse ( w ) having the same properties. Inany case, w ∗ is a walk from l ′ to ¬ l in F \ X ∗ whose first clause is C ′ . Arguingas in the last paragraph of proof of Claim 2, we see that F \ X ∗ has a walk w from ¬ L to l ′ whose last clause is C ′ . Therefore we can replace C ′ by w in w ∗ and get a walk w from ¬ L to ¬ l in F \ X ∗ in contradiction to Claim 2. Thiscontradiction shows that our initial assumption regarding the existence of w isincorrect and hence completes the proof of the present claim. (cid:3) t follows from Combination of Theorem 1, Claim 2, and Claim 3 that X ∗ isa CS of ( F, L ∪ { l ∗ } , l ), which completes the proof of the present theorem. (cid:4) FindCS ( F, L, l, k ) Input: An instance ( F, L, l, k ) of the parameterized problem. Output: A CS of ( F, L, l ) of size at most k if one exists. Otherwise ’NO’ is returned.1. if SW RT ( F, L ∪ { l } ) is true then return ∅ if k = 0 then Return ’NO’3. if k ≥ | Clauses ( F ) | then return Clauses ( F )4. if SepSize ( F, ¬ L, ¬ l ) > k then return ’NO’ if F has a walk from ¬ L to ¬ l then Let C = ( l ∨ l ) be a clause such that l ∈ ¬ L and V ar ( l ) / ∈ V ar ( L )6. else Let C = ( l ∨ l ) be a clause which belongs to a walk of F from ¬ l to ¬ l and SW RT ( F, { l , l } ) is true if Both l and l belong to ¬ ( L ∪ { l } ) then S ← FindCS ( F \ C, L, l, k − if S is not ’NO’ then Return S ∪ { C } if Both l and l do not belong to ¬ ( L ∪ { l } ) then S ← FindCS ( F, L ∪ { l } , l, k )8.2 if S is not ’NO’ then Return S S ← FindCS ( F, L ∪ { l } , l, k )8.4 if S is not ’NO’ then Return S S ← FindCS ( F \ C, L, l, k − if S is not ’NO’ then Return S ∪ { C } C belongs to ¬ ( L ∪ { l } ). W.l.o.g. we assume that this literal is l )9. if l is not neutral in ( F, L, l )9.1 S ← FindCS ( F, L ∪ { l } , l, k )9.2 if S is not ’NO’ then Return S S ← FindCS ( F \ C, L, l, k − if S is not ’NO’ then Return S ∪ { C } FindCS ( F, L ∪ { l } , l, k ) The correctness of this step follows from Corollary 1 Doing the analysis, we will prove that on Steps 5 and 6 F has at least one clausewith the required property .2 Additional Terminology and Auxiliary Lemmas In order to analyze the above algorithm, we extend our terminology. Let uscall a quadruple ( F, L, l, k ) a valid input if ( F, L, l, k ) is a valid instance of theparameterized 2-ASLASAT problem (as specified in Section 2.3.).Now we introduce the notion of the search tree ST ( F, L, l, k ) produced by FindCS ( F, L, l, k ). The root of the tree is identified with ( F, L, l, k ). If FindCS ( F, L, l, k )does not apply itself recursively then ( F, L, l, k ) is the only node of the tree. Oth-erwise the children of ( F, L, l, k ) correspond to the inputs of the calls applied within the call FindCS ( F, L, l, k ). For example, if FindCS ( F, L, l, k ) performsStep 9 then the children of ( F, L, l, k ) are ( F, L ∪ { l } , l, k ) and ( F \ C, L, l, k − F ′ , L ′ , l ′ , k ′ ) of ( F, L, l, k ), the subtree of ST ( F, L, l, k ) rooted by( F ′ , L ′ , l ′ , k ′ ) is ST ( F ′ , L ′ , l ′ , k ′ ). It is clear from the description of FindCS thatthe third item of a valid input is not changed for its children hence in the restof the section when we denote a child or descendant of ( F, L, l, k ) we will leavethe third item unchanged, e.g. ( F , L , l, k ). Lemma 4. Let ( F, L, l, k ) be a valid input. The Solve ASLASAT ( F, L, l, k ) succeeds to select a clause on Steps 5 and 6. Proof. Assume that F has a walk from ¬ L to ¬ l and let w be the shortestpossible such walk. Let l be the first literal of w and let C = ( l ∨ l ) be the firstclause of F . By definition l ∈ ¬ L . We claim that V ar ( l ) / ∈ V ar ( L ). Indeed,assume that this is not true. If l ∈ ¬ L then SW RT ( F, {¬ l , ¬ l } ) is false andhence SW RT ( F, L ) is false as L is a superset of {¬ l , ¬ l } . But this contradictsthe definition of the problem. Assume now that l ∈ L . By definitionof the problem, V ar ( l ) / ∈ V ar ( L ), hence C is not the last clause of w . Consequently the first literal of the second clause of w belongs to ¬ L . Thusif we remove the first clause from w we obtain a shorter walk from ¬ L to ¬ l in contradiction to the definition of w . It follows that our claim is true and therequired clause C can be selected if the condition of Step 5 is satisfied.Consider now the case where the condition of Step 5 is not satisfied. Note that SW RT ( F, L ∪ { l } ) is false because otherwise the algorithm would have finishedat Step 1. Consequently by Theorem 1, F has a walk from ¬ l to ¬ l . We claimthat any such walk w contains a clause C = ( l ∨ l ) such that SW RT ( F, { l , l } )is true. Let P be a satisfying assignment of F (which exists by definition of the problem). Let F ′ be the formula created by the clauses of w and let P ′ be the subset of P such that V ar ( P ′ ) = V ar ( F ′ ). By Lemma 1, SW RT ( F ′ , l ) is false and hence, taking into account that V ar ( l ) ∈ V ar ( F ′ ), ¬ l ∈ P ′ . Consequently l ∈ ¬ P ′ . Therefore ¬ P ′ is not a satisfying assignment of F ′ i.e. ¬ P ′ does not satisfy at least one clause of F ′ . Taking into account that V ar ( ¬ P ′ ) = V ar ( F ′ ), it contains negations of both literals of at least one clause C of F ′ . Therefore P ′ (and hence P ) contains both literals of C . Clearly, C isthe required clause. (cid:4) The soundness of Steps 5 and 6 of FindCS is assumed in the rest of thepaper without explicit referring to Lemma 4. emma 5. Let ( F, L, l, k ) be a valid input and assume that Solve ASLASAT ( F, L, l, k ) applies itself recursively. Then all the children of ( F, L, l, k ) in the search treeare valid inputs. Proof. Let ( F , L , l, k ) be a child of ( F, L, l, k ) . Observe that k ≥ k − 1. Observe also that k > FindCS ( F, L, l, k ) would not apply itselfrecursively if k = 0. It follows that k ≥ F , L , l ) is a valid instance of the prob-lem. If k = k − F , L , l ) = ( F \ C, L, l ) where C is the clause selectedon Steps 5 and 6. In this case the validity of instance ( F \ C, L, l ) immedi-ately follows from the validity of ( F, L, l ). Consider the remaining case where( F , L , l, k ) = ( F, L ∪ { l ∗ } , l, k ) where l ∗ is a literal of the clause C = ( l ∨ l )selected on Steps 5 and 6. In particular, we are going to show that – L ∪ { l ∗ } is non-contradictory; – V ar ( l ) / ∈ V ar ( L ∪ { l ∗ } ; – SW RT ( F, L ∪ { l ∗ } ) is true.That L ∪ { l ∗ } is non-contradictory follows from description of the algorithmbecause it is explicitly stated that the literal being joined to L does not belongto ¬ ( L ∪ { l } ). This also implies that the second condition may be violated onlyif l ∗ = l . In this case assume that C is selected on Step 5. Then w.l.o.g. l ∈ ¬ L and l = l . Let P be a satisfying assignment of F which does not intersect with ¬ L (existing since ( SW RT ( F, L ) is true). Then l ∈ P , i.e. SW RT ( F, L ∪ { l } )is true, which is impossible since in this the algorithm would stop at Step 1. Theassumption that C is selected on Step 6 also leads to a contradiction becauseon the one hand SW RT ( F, l ) is false by Lemma 1 due to existence of a walkfrom ¬ l to ¬ l , on the other hand SW RT ( F, l ) is true by the selection criterion.It follows that V ar ( l ) / ∈ V ar ( L ∪ { l ∗ } ).Let us prove the last item. Assume first that C is selected on Step 5 andassume w.l.o.g. that l ∈ ¬ L . Then, by the first statement, l ∗ = l . Moreover, asnoted in the previous paragraph l ∈ P where P is a satisfying assignment of F which does intersect with ¬ L , i.e. SW RT ( F, L ∪ { l } ) is true in the consideredcase. Assume that C is selected on Step 6 and let w be the walk from ¬ l to ¬ l in F to which C belongs. Observe that F has a walk w ′ from l ∗ to ¬ l : if l ∗ isa first literal of C w.r.t. w then let w ′ be a suffix of w whose first literal is l ∗ ,otherwise let be the suffix of reverse ( w ) whose first literal is l ∗ . Assume that SW RT ( F, L ∪ { l ∗ } ) is false. Since L ∪ { l ∗ } is non-contradictory by the first item, V ar ( l ∗ ) / ∈ V ar ( L ). It follows that ( F, L, l ∗ ) is a valid instance of the problem. In this case, by Theorem 1, F has either a walk from ¬ L to ¬ l ∗ or awalk from ¬ l ∗ to ¬ l ∗ . The latter is ruled out by Lemma 1 because SW RT ( F, l ∗ )is true by selection of C . Let w ′′ be a walk from ¬ L to ¬ l ∗ in F . Then w ′′ + w ′ isa walk of F from ¬ L to ¬ l in contradiction to our assumption that C is selectedon Step 6. Thus SW RT ( F, L ∪ { l ∗ } ) is true. The proof of the present lemma isnow complete. (cid:4) Now we introduce two measures of the input of the Solve ASLASAT pro-cedure. Let α ( F, L, l, k ) = | V ar ( F ) \ V ar ( L ) | + k and β ( F, L, l, k ) = max (0 , k − SepSize ( F, ¬ L, ¬ l )). emma 6. Let ( F, L, l, k ) be a valid input and let ( F , L , l, k ) be a child of ( F, L, l, k ) . Then α ( F, L, l, k ) > α ( F , L , l, k ) . Proof. If k = k − α -measure does not increase and the second decreases. So,assume that ( F , L , l, k ) = ( F, L ∪ { l ∗ } , l, k ). In this case it is sufficient to provethat V ar ( l ∗ ) / ∈ V ar ( L ). Due to the validity of ( F, L ∪ { l ∗ } , l, k ) by Lemma 5, l ∗ / ∈ ¬ L , so it remains to prove that l ∗ / ∈ L . Assume that l ∗ ∈ L . Then theclause C is selected on Step 6. Indeed, if C is selected on Step 5 then one ofits literals belongs to ¬ L and hence cannot belong to L , due to the validity of( F, L, l, k ) (and hence being L non-contradictory), while the variable of the otherliteral does not belong to V ar ( L ) at all. Let w be the walk from ¬ l to ¬ l in F towhich C belongs. Due to the validity of ( F, L ∪ { l ∗ } , l, k ) by Lemma 5, l ∗ = ¬ l .Therefore either w or reverse ( w ) has a suffix which is a walk from ¬ l ∗ to ¬ l ,i.e. a walk from ¬ L to ¬ l . But this contradicts the selection of C on Step 6. So, l ∗ / ∈ L and the proof of the lemma is complete. (cid:4) For the next lemma we extend our terminology. We call a node ( F ′ , L ′ , l, k ′ )of ST ( F, L, l, k ) a trivial node if it is a leaf or its only child is of the form( F ′ , L ′ ∪ { l ∗ } , l, k ′ ) for some literal l ∗ . Lemma 7. Let ( F, L, l, k ) be a valid input and let ( F , L , l, k ) be a child of ( F, L, l, k ) . Then β ( F, L, l, k ) ≥ β ( F , L , l, k ) . Moreover if ( F, L, l, k ) is a non-trivial node then β ( F, L, l, k ) > β ( F , L , l, k ) . Proof. Note that β ( F, L, l, k ) > β ( F, L, l, k ) = 0 then FindCS ( F, L, l, k )does not apply itself recursively, i.e. does not have children. It follows that β ( F, L, l, k ) = 2 k − SepSize ( F, ¬ L, ¬ l ) > 0. Consequently, to show that β ( F, L, l, k ) >β ( F , L , l, k ) or that β ( F, L, l, k ) ≥ β ( F , L , l, k ) it is sufficient to show that2 k − SepSize ( F, ¬ L, ¬ l ) > k − SepSize ( F , ¬ L , ¬ l ) or 2 k − SepSize ( F, ¬ L, ¬ l ) ≥ k − SepSize ( F , ¬ L , ¬ l ), respectively.Assume first that ( F , L , l, k ) = ( F \ C, L, l, k − SepSize ( F \ C, ¬ L, ¬ l ) ≥ SepSize ( F, ¬ L, ¬ l ) − 1. Indeed assume the opposite and let S be aseparator w.r.t. to ¬ L and ¬ l in F \ C whose size is at most SepSize ( F, ¬ L, ¬ l ) − 2. Then S ∪{ C } is a separator w.r.t. ¬ L and ¬ l in F of size at most SepSize ( F, ¬ L, ¬ l ) − SepSize ( F, ¬ L, ¬ l ). Thus 2( k − − SepSize ( F \ C, ¬ L, ¬ l ) = 2 k − SepSize ( F \ C, ¬ L, ¬ l ) − ≤ k − SepSize ( F, ¬ L, ¬ l ) − < k − SepSize ( F, ¬ L, ¬ l ).Assume now that ( F , L , l, k ) = ( F, L ∪{ l ∗ } , l, k ) for some literal l ∗ . Clearly, SepSize ( F, ¬ L, ¬ l ) ≤ SepSize ( F, ¬ ( L ∪ { l ∗ } ) , ¬ l ) due to being ¬ L a subset of ¬ ( L ∪ { l ∗ } ). It follows that 2 k − SepSize ( F, ¬ L, ¬ l ) ≥ k − SepSize ( F, ¬ ( L ∪{ l ∗ } ) , ¬ l ). It remains to show that ≥ can be replaced by > in case where( F, L, l, k ) is a non-trivial node. It is sufficient to show that in this case SepSize ( F, ¬ L, ¬ l ) FindCS ( F, L ∪ { l ∗ } , l, k ) is applied on Steps 8.2, 8.4, or 9.3. In the lastcase, it is explicitly said that l ∗ is not a neutral literal in ( F, L, l ). Consequently, SepSize ( F, ¬ L, ¬ l ) < SepSize ( F, ¬ ( L ∪ { l ∗ } ) , ¬ l ) by definition.or the first two cases note that Step 8 is applied only if the clause C isselected on Step 6. That is, F has no walk from ¬ L to ¬ l . In particular, F hasno path from ¬ L to ¬ l , i.e. SepSize ( ¬ L, ¬ l ) = 0. Let w be the walk from ¬ l to ¬ l in F to which C belongs. Note that by Lemma 5, ( F, L ∪ { l ∗ } , l, k ) is a validinput, in particular V ar ( l ∗ ) = V ar ( l ). Therefore either w or reverse ( w ) has asuffix which is a walk from ¬ l ∗ to ¬ l , i.e. a walk from ¬ ( L ∪{ l ∗ } ) to ¬ l . ApplyingLemma 3 together with Lemma 5, we see that F has a path from ¬ ( L ∪ { l ∗ } ) to ¬ l , i.e. SepSize ( F, ¬ ( L ∪ { l ∗ } , ¬ l ) > (cid:4) Lemma 8. Let ( F, L, l, k ) be a valid input. Then the following statements aretrue regarding ST ( F, L, l, k ) . – The height of ST ( F, L, l, k ) is at most α ( F, L, l, k ) . – Each node ( F ′ , L ′ , l, k ′ ) of ST ( F, L, l, k ) is a valid input, the subtree rootedby ( F ′ , L ′ , l, k ′ ) is ST ( F ′ , L ′ , l, k ′ ) and α ( F ′ , L ′ , l, k ′ ) < α ( F, L, l, k ) . – For each node ( F ′ , L ′ , l, k ′ ) of ST ( F, L, l, k ) , β ( F ′ , L ′ , l, k ′ ) ≤ β ( F, L, l, k ) − t where t is the number of non-trivial nodes besides ( F ′ , L ′ , l, k ′ ) in the pathfrom ( F, L, l, k ) to ( F ′ , L ′ , l, k ′ ) of ST ( F, L, l, k ) . Proof. This lemma is clearly true if ( F, L, l, k ) has no children. Consequently,it is true if α ( F, L, l, k ) = 0. Now, apply induction on the size of α ( F, L, l, k )and assume that α ( F, L, l, k ) > 0. By the induction assumption, Lemma 5,and Lemma 6, the present lemma is true for any child of ( F, L, l, k ). Conse-quently, for any child ( F ∗ , L ∗ , l, k ∗ ) of ( F, L, l, k ), the height of ST ( F ∗ , L ∗ , l, k ∗ )is at most α ( F ∗ , L ∗ , l, k ∗ ). Hence the first statement follows by Lemma 6. Fur-thermore, any node ( F ′ , L ′ , l, k ′ ) of ST ( F, L, l, k ) belongs to ST ( F ∗ , L ∗ , l, k ∗ ) ofsome child ( F ∗ , L ∗ , l, k ∗ ) of ( F, L, l, k ) and the subtree rooted by ( F ′ , L ′ , l, k ′ ) in ST ( F, L, l, k ) is the subtree rooted by ( F ′ , L ′ , l, k ′ ) in ST ( F ∗ , L ∗ , l, k ∗ ). Conse-quently, ( F ′ , L ′ , l, k ′ ) is a valid input, the subtree rooted by it is ST ( F ′ , L ′ , l, k ′ ),and α ( F ′ , L ′ , l, k ′ ) ≤ α ( F ∗ , L ∗ , l, k ∗ ) < α ( F, L, l, k ), the last inequality followsfrom Lemma 6. Finally, β ( F ′ , L ′ , l, k ′ ) ≤ β ( F ∗ , L ∗ , l, k ∗ ) − t ∗ where t ∗ is thenumber of non-trivial nodes besides ( F ′ , L ′ , l, k ′ ) in the path from ( F ∗ , L ∗ , l, k ∗ )to ( F ′ , L ′ , l, k ′ ) in ST ( F ∗ , L ∗ , l, k ∗ ), and hence in ST ( F, L, l, k ) . If ( F, L, l, k )is a trivial node then t = t ∗ and the last statement of the present lemma is trueby Lemma 7. Otherwise t = t ∗ + 1 and by another application of Lemma 7 weget that β ( F ′ , L ′ , l, k ′ ) ≤ β ( F, L, l, k ) − t ∗ − β ( F, L, l, k ) − t . (cid:4) Let ( F, L, l, k ) be a valid input. Then FindCS ( F, L, l, k ) correctlysolves the parameterized problem. That is, if FindCS ( F, L, l, k ) re-turns a set, this set is a CS of ( F, L, l ) of size at most k . If FindCS ( F, L, l, k ) returns ’NO’ then ( F, L, l ) has no CS of size at most k . Besides providing the upper bound on the height of ST ( F, L, l, k ), this statementclaims that ST ( F, L, l, k ) is finite and hence we may safely refer to a path betweentwo nodes. Note that this inequality applies to the case where ( F ′ , L ′ , l, k ′ ) = ( F ∗ , L ∗ , l, k ∗ ). roof. Let us prove first the correctness of FindCS ( F, L, l, k ) for the caseswhen the procedure does not apply itself recursively. It is only possible whenthe procedure returns an answer on Steps 1-4. If the answer is returned onStep 1 then the validity is clear because nothing has to be removed from F to make it satisfiable w.r.t. L and l . If the answer is returned on Step 2 then SW RT ( F, L ∪ { l } ) is false (since the condition of Step 1 is not satisfied) andconsequently the size of a CS of ( F, L, l ) is at least 1. On the other hand, k =0 and hence the answer ’NO’ is valid in the considered case. For the answerreturned on Step 3 observe that Clauses ( F ) is clearly a CS of ( F, L, l ) (since SW RT ( ∅ , L ∪ { l } ) is true) and the size of Clauses ( F ) does not exceed k by thecondition of Step 3. Therefore the answer returned on this step is valid. Finallyif the answer is returned on Step 4 then the condition of Step 4 is satisfied.According to Corollary 1, this condition implies that any CS of ( F, L, l ) has thesize greater than k , which justifies the answer ’NO’ in the considered step.Now we prove correctness of FindCS ( F, L, l, k ) by induction on α ( F, L, l, k ).Assume first that α ( F, L, l, k ) = 0. Then it follows that k = 0 and, consequently, FindCS ( F, L, l, k ) does not apply itself recursively (the output is returned onStep 1 or Step 2). Therefore, the correctness of FindCS ( F, L, l, k ) follows fromthe previous paragraph. Assume now that α ( F, L, l, k ) > F ′ , L ′ , l, k ′ ) such that α ( F ′ , L ′ , l, k ′ ) < α ( F, L, l, k ).Due to the previous paragraph we may assume that FindCS ( F, L, l, k ) appliesitself recursively, i.e. the node ( F, L, l, k ) has children in ST ( F, L, l, k ). Claim 4 Let ( F , l , l, k ) be a child of ( F, L, l, k ) . Then FindCS ( F , L , l, k ) is correct. Proof. By Lemma 5, ( F , L , l, k ) is a valid input. By Lemma 6, α ( F , L , l, k ) <α ( F, L, l, k ). The claim follows by the induction assumption. (cid:3) Assume that FindCS ( F, L, l, k ) returns a set S . By description of the algo-rithm, either S is returned by FindCS ( F, L ∪{ l ∗ } , l, k ) for a child ( F, L ∪{ l ∗ } , l, k )of ( F, L, l, k ) or S = S ∪{ C } and S is returned by FindCS ( F \ C, L, l, k − 1) fora child ( F \ C, L, l, k − 1) of ( F, L, l, k ). In the former case, the validity of outputfollows from Claim 4 and from the easy observation that a CS of ( F, L ∪{ l ∗ } , l, k )is a CS of ( F, L, l, k ) because L is a subset of L ∪ { l ∗ } . In the latter case, it fol-lows from Claim 4 that | S | ≤ k − S is a CS of ( F \ C, L, l ) i.e. SW RT (( F \ C ) \ S , L ∪ { l } ) is true. But ( F \ C ) \ S = F \ ( S ∪ { C } ) = F \ S .Consequently S is a CS of ( F, L, l ) of size at most k , hence the output is validin the considered case.Consider now the case where FindCS ( F, L, l, k ) returns ’NO’ and assume bycontradiction that there is a CS S of ( F, L, l ) of size at most k . Assume first that’NO’ is returned on Step 7.3. It follows that C / ∈ S because otherwise S \ C isa CS of ( F \ C, L, l ) of size at most k − F \ S which does not intersect with ¬ ( L ∪ { l } ) (which exists bydefinition) cannot satisfy clause C , a contradiction. Assume now that ’NO’ isreturned on Step 10. By Claim 4, ( F, L ∪ { l } , l ) has no CS of size at most k .herefore, according to Theorem 3, the size of a SCS of ( F, L, l ) is at least k + 1which contradicts the existence of S . Finally assume that ’NO’ is returned onStep 8.7. or on Step 9.5. Assume first that the clause C selected on Steps 5 and6 does not belong to S . Let P be a satisfying assignment of ( F \ S ) which doesnot intersect with ¬ ( L ∪ { l } ). Then at least one literal l ∗ of C is contained in P .This literal does not belong to ¬ ( L ∪ { l } ) and hence FindCS ( F, L ∪ { l ∗ } , l, k )has been applied and returned ’NO’. However, P witnesses that S is a CS of( F, L ∪ { l ∗ } , l, k ) of size at most k , that is FindCS ( F, L ∪ { l ∗ } , l, k ) returned anincorrect answer in contradiction to Claim 4. Finally assume that C ∈ S . Then S \ C is a CS of ( F \ C, L, l ) of size at most k − FindCS ( F \ C, L, l ) contradicts Claim 4. Thus the answer ’NO’ returned by FindCS ( F, L, l, k ) is valid. (cid:4) Let ( F, L, l, k ) be a valid input. Then the number of leaves of ST ( F, L, l, k ) is at most √ t , where t = β ( F, L, l, k ) . Proof of Theorem 5 Since β ( F, L, l, k ) ≥ √ t ≥ 1. Henceif FindCS ( F, L, l, k ) does not apply itself recursively, i.e. ST ( F, L, l, k ) has onlyone node, the theorem clearly holds. We prove the theorem by induction on α ( F, L, l, k ). If α ( F, L, l, k ) = 0 then as we have shown in the proof of Theorem4, FindCS ( F, L, l, k ) does not apply itself recursively and hence the theoremholds as shown above. Assume that α ( F, L, l, k ) > F ′ , L ′ , l, k ′ ) such that α ( F ′ , L ′ , l, k ′ ) < α ( F, L, l, k ). Clearlywe may assume that ( F, L, l, k ) applies itself recursively i.e. ST ( F, L, l, k ) hasmore than 1 node. Claim 5 For any non-root node ( F ′ , L ′ , l, k ′ ) of ST ( F, L, l, k ) , the subtree of ST ( F, L, l, k ) rooted by ( F ′ , L ′ , l, k ′ ) has at most √ t ′ leaves, where t ′ = β ( F ′ , L ′ , l, k ′ ) . Proof. According to Lemma 8, ( F ′ , L ′ , l, k ′ ) is a valid input, α ( F ′ , L ′ , l, k ′ ) <α ( F, L, l, k ), and the subtree of ST ( F, L, l, k ) rooted by ( F ′ , L ′ , l, k ′ ) is ST ( F ′ , L ′ , l, k ′ ).Therefore the claim follows by the induction assumption. (cid:3) If ( F, L, l, k ) has only one child ( F , L , l, k ) then clearly the number ofleaves of ST ( F, L, l, k ) equals the number of leaves of the subtree rooted by( F , L , l, k ) which, by Claim 5, is at most √ t , where t = β ( F , L , l, k ).According to Lemma 7, t ≤ t so the present theorem holds for the consideredcase. If ( F, L, l, k ) has 2 children ( F , L , l, k ) and ( F , L , l, k ) then the numberof leaves of ST ( F, L, l, k ) is the sum of the numbers of leaves of subtrees rootedby ( F , L , l, k ) and ( F , L , l, k ) which, by Claim 5, is at most √ t + √ t ,where t i = β ( F i , L i , l, k i ) for i = 1 , 2. Taking into account that ( F, L, l, k ) is anon-trivial node and applying Lemma 7, we get that t < t and t < t . hencethe number of leaves of ST ( F, L, l, k ) is at most (2 / √ ∗ ( √ t ) < √ t , so thetheorem holds for the considered case as well.or the case where ( F, L, l, k ) has 3 children, denote them by ( F i , L i , l, k i ), i = 1 , , 3. Assume w.l.o.g. that ( F , L , l, k ) = ( F, L ∪{ l } , l, k ), ( F , L , l, k ) =( F, L ∪{ l } , l, k ), ( F , L , l, k ) = ( F \ C, l, k − C = ( l ∨ l ) is the clauseselected on steps 5 and 6. Let t i = β ( F i , L i , l, k i ) for i = 1 , , Claim 6 t ≥ and t ≤ t − . Proof. Note that k > FindCS ( F, L, l, k ) does not applyitself recursively. Observe also that SepSize ( F, ¬ L, ¬ l ) = 0 because clause C canbe selected only on Step 6, which means that F has no walk from ¬ L to ¬ l and,in particular, F has no path from ¬ L to ¬ l . Therefore 2 k − Sepsize ( F, ¬ L, ¬ l ) =2 k ≥ t = β ( F, L, l, k ) = 2 k ≥ 2. If t = 0 the second statement ofthe claim is clear. Otherwise t = 2( k − − SepSize ( F \ ( l ∨ l ) , ¬ L, ¬ l ) =2( k − − k − t − (cid:3) Assume that some ST ( F i , L i , l, k i ) for i = 1 , ST ( F , L , l, k ). Then the number of leaves of ST ( F, L, l, k )is the sum of the numbers of leaves of the subtrees rooted by ( F , L , l, k )and ( F , L , l, k ) plus one. By Claims 5 and 6, and Lemma 7, this is at most √ t − + √ t − + 1. Then √ t − √ t − − √ t − − ≥ √ − √ − − √ − − − √ − > 0, the first inequality follows from Claim 6. That is, the presenttheorem holds for the considered case.It remains to assume that both ST ( F , L , l, k ) and ST ( F , L , l, k ) haveat least two leaves. Then for i = 1 , ST ( F i , L i , l, k i ) has a node having at leasttwo children. Let ( F F i , LL i , l, kk i ) be such a node of ST ( F i , L i , l, k i ) which liesat the smallest distance from ( F, L, l, k ) in ST ( F, L, l, k ). Claim 7 The number of leaves of the subtree rooted by ( F F i , LL i , l, kk i ) is atmost (2 / ∗ √ t . Proof. Assume that ( F F i , LL i , l, kk i ) has 2 children and denote them by( F F ∗ , LL ∗ , l, kk ∗ ) and ( F F ∗ , LL ∗ , l, kk ∗ ). Then the number of leaves of the sub-tree rooted by ( F F i , LL i , l, kk i ) equals the sum of numbers of leaves of thesubtrees rooted by ( F F ∗ , LL ∗ , l, kk ∗ ) and ( F F ∗ , LL ∗ , l, kk ∗ ). By Claim 5, thissum does not exceed 2 ∗√ t ∗ where t ∗ is the maximum of β ( F F ∗ j , LL ∗ j , l, kk ∗ j ) for j = 1 , 2. Note that the path from ( F, L, l, k ) to any ( F F ∗ j , LL ∗ j , l, kk ∗ j ) includesat least 2 non-trivial nodes besides ( F F ∗ j , LL ∗ j , l, kk ∗ j ), namely ( F, L, l, k ) and( F F i , LL i , l, kk i ). Consequently, t ∗ ≤ t − F F i , LL i , l, kk i ) has 3 children. Then let tt i = β ( F F i , LL i , l, kk i )and note that according to Claim 5, the number of leaves of the subtree rooted by( F F i , LL i , l, kk i ) is at most √ tt i . Taking into account that ( F F i , LL i , l, kk i ) isa valid input by Lemma 8 and arguing analogously to the second sentence of theproof of Claim 6, we see that SepSize ( F F i , ¬ LL i , ¬ l ) = 0. On the other hand, us-ing the argumentation in the last paragraph of the proof of Lemma 7, we can seethat SepSize ( F i , ¬ L i , l ) > 0. This means that ( F i , L i , l, k i ) = ( F F i , LL i , l, kk i ).oreover, the path from ( F i , L i , l, k i ) to ( F F i , LL i , l, kk i ) includes a pair of con-secutive nodes ( F ′ , L ′ , l, k ′ ) and ( F ′′ , L ′′ , l, k ′′ ), being the former the parent ofthe latter, such that SepSize ( F ′ , ¬ L ′ , ¬ l ) > SepSize ( F ′′ , ¬ L ′′ , ¬ l ). This onlycan happen if k ′′ = k ′ − F ′′ , L ′′ , l, k ′′ ) = ( F ′ , L ′ ∪ { l ′ } , l, k ′ ) forsome literal l ′ and clearly adding a literal to L ′ does not decrease the size of theseparator). Consequently, ( F ′ , L ′ , l, k ′ ) is a non-trivial node. Therefore, the pathfrom ( F, L, l, k ) to ( F F i , LL i , l, kk i ) includes at least 2 non-trivial nodes besides( F F i , LL i , l, kk i ): ( F, L, l, k ) and ( F ′ , L ′ , l, k ′ ). That is tt i ≤ t − (cid:3) It remains to notice that the number of leaves of ST ( F, L, l, k ) is the sum ofthe numbers of leaves of subtrees rooted by ( F F , LL , l, kk ), ( F F , LL , l, kk ),and ( F , L , l, k ) which, according to Claims 5 6 and 7, is at most 5 ∗ √ t − = √ t . (cid:4) Theorem 6. Let ( F, L, l, k ) be an instance of the parameterized problem. Then the problem can be solved in time O (5 k ∗ k ( n + k ) ∗ ( m + | L | )) ,where n = | V ar ( F ) | , m = | Clauses ( F ) | . Proof. According to assumptions of the theorem, ( F, L, l, k ) is a valid in-put. Assume that F is represented by its implication graph D = ( V, A ) whichis almost identical to the implication graph of F with the only difference that V ( D ) corresponds to V ar ( F ) ∪ V ar ( L ) ∪ V ar ( l ′ ), that is if for any literal l ′ such that V ar ( l ′ ) ∈ ( V ar ( L ) ∪ { V ar ( l ) } ) \ V ar ( F ), D has isolated nodes cor-responding to l ′ and ¬ l ′ . We also assume that the nodes corresponding to L , ¬ L , l , ¬ l are specifically marked. This representation of ( F, L, l, k ) can be ob-tained in a polynomial time from any other reasonable representation. It followsfrom Theorem 4 that FindCS ( F, L, l, k ) correctly solves the parameterized problem with respect to the given input. Let us evaluate the complexityof FindCS ( F, L, l, k ). According to Lemma 8, the height of the search tree isat most α ( F, L, l, k ) ≤ n + k . Theorem 5 states that the number of leaves of ST ( F, L, l, k ) is at most √ t where t = β ( F, L, l, k ). Taking into account that t ≤ k , the number of leaves of ST ( F, L, l, k ) is at most 5 k . Consequently, thenumber of nodes of the search tree is at most 5 k ∗ ( n + k ). The complexity of FindCS ( F, L, l, k ) can be represented as the number of nodes multiplied by thecomplexity of the operations performed within the given recursive call.Let us evaluate the complexity of FindCS ( F, L, l, k ) without taking intoaccount the complexity of the subsequent recursive calls. First of all note thateach literal of F belongs to a clause and each clause contains at most 2 distinctliterals. Consequently, the number of clauses of F is at least half of the numberof literals of F and, as a result, at least half of the number of variables. Thisnotice is important because most of operations of FindCS ( F, L, l, k ) involvedoing Depth-First Search (DFS) or Breadth-First Search (BFS) on graph D ,which take O ( V + A ). In our case | V | = O ( n + | L | ) and | A | = O ( m ). Since n = O ( m ), O ( V + A ) can be replaced by O ( m + | L | ).The first operation performed by FindCS ( F, L, l, k ) is checking whether SW RT ( F, L ∪ { l } ) is true. Note that this is equivalent to checking the satis-ability of a F ′ which is obtained from F by adding clauses ( l ′ ∨ l ′ ) foreach l ′ ∈ L ∪ { l } . It is well known [17] that the given formula F ′ is not satisfiable if and only if there are literals l ′ and ¬ l ′ which belong to the samestrongly connected component of the implication graph of F ′ . The implicationgraph D ′ of F ′ can be obtained from D by adding arcs that correspond to theadditional clauses. The resulting graph has O ( m + | L | ) vertices and O ( m + | L | )arcs. The partition into the strongly connected components can be done by aconstant number of applications of the DFS algorithm. Hence the whole Step1 takes O ( m + | L | ). Steps 2 and 3 take O (1). According to Theorem 2, Step 4can be performed by assigning all the arcs of D a unit flow, contracting all thevertices of L into a source s , identifying ¬ l with the sink t , and checking whether k + 1 units of flow can be delivered from s to t . This can be done by O ( k ) itera-tions of the Ford-Fulkerson algorithm, where each iteration is a run of BFS andhence can be performed on O ( m + | L | ). Consequently, Step 4 can be performedin O (( m + | L | ) ∗ k ). Checking the condition of Step 5 can be done by BFS andhence takes O ( m + | L | ). Moreover, if the required walk exists, BFS finds theshortest one and, as noted in the proof of Lemma 4, a required clause is the firstclause of this walk. Hence, the whole Step 5 can be performed in O ( m + | L | ).The proof of Lemma 4 also outlines an algorithm implementing Step 6: choosean arbitrary walk w from ¬ l to ¬ l in F , (which, as noted in the proof of The-orem 2, corresponds to a walk from l to ¬ l in D ), find a satisfying assignment P of F which does not intersect with ¬ L and choose a clause of w whose bothliterals are satisfied by P . Taking into account the above discussion, all the op-erations take O ( m + | L | ), hence Step 6 takes this time. Note that preparing aninput for a recursive call takes O (1) because this preparation includes removalof one clause from F or adding one literal to L (with introducing appropriatechanges to the implication graph). Therefore Steps 7 and 8 take O (1). Step 9takes O (( m + | L | ) ∗ k ) on the account of neutrality checking: O ( k ) iterations ofthe Ford-Fulkerson algorithm are sufficient because SepSize ( F, ¬ L, ¬ l ) ≤ k dueto insatisfaction of the condition of Step 4. Step 10 takes O (1) on the accountof input preparation for the recursive call. Thus the complexity of processing( F, L, l, k ) is O (( m + | L | ) ∗ k ).Finally, note that for any subsequent recursive call ( F ′ , L ′ , l, k ′ ) the implica-tion graph of ( F ′ , L ′ , l ) is a subgraph of the graph of ( F, L, l ): every change ofgraph in the path from ( F, L, l, k ) to ( F ′ , L ′ , l, k ′ ) is caused by removal of a clauseor adding to the second parameter a literal of a variable of F . Consequently, thecomplexity of any recursive call is O (( m + | L | ) ∗ k ) and the time taken by theentire run of FindCS ( F, L, l, k ) is O (5 k ∗ k ( n + k ) ∗ ( m + | L | )) as required. (cid:4) In this section we prove the main result of the paper, fixed-parameter tractabilityof the 2-ASAT problem. heorem 7. The problem with input ( F, k ) where F is a formulawith possible repeated occurrences of clauses, can be solved in O (15 k ∗ k ∗ m ) ,where m is the number of clauses of F . Proof. We introduce the following 2 intermediate problems. Problem I1 Input: A satisfiable formula F , a non-contradictory set of literals L , a parameter k Output: A set S ⊆ Clauses ( F ) such that | S | ≤ k and SW RT ( F \ S, L )is true, if there is such a set S ; ’NO’ otherwise. Problem I2 Input: A formula F , a parameter k , and a set S ⊆ Clauses ( F )such | S | = k + 1 and F \ S is satisfiable Output: A set Y ⊆ Clauses ( F ) such that | Y | < | S | and F \ Y is satisfi-able, if there is such a set Y ; ’NO’ otherwise.The following two claims prove the fixed-parameter tractability of ProblemI1 through transformation of its instance into an instance of prob-lem and of Problem I2 through transformation of its instance into an instanceof Problem I1. Then we will show that the problem with no repeatedoccurrence of clauses can be solved through transformation of its instance intoan instance of Problem I2. Finally, we show that the problem with re-peated occurrences of clauses is fpt through transformation of its instance intoan instance of without repeated occurrences of clauses. Claim 8 Problem I1 with the input ( F, L, k ) can be solved in O (5 k ∗ k ∗ m ) ,where, m = | Clauses ( F ) | . Proof. Observe that we may assume that V ar ( L ) ⊆ V ar ( F ). Otherwise wecan take a subset L ′ such that V ar ( L ′ ) = V ar ( F ) ∩ V ar ( L ) and solve problemI1 w.r.t. the instance ( F, L ′ , k ). It is not hard to see that the resulting solutionapplies to ( F, L, k ) as well.Let P be a satisfying assignment of F . If L ⊆ P then the empty set can beimmediately returned. Otherwise partition L into two subsets L and L suchthat L ⊆ P and ¬ L ⊆ P .We apply a two stages transformation of formula F . On the first stage weassign each clause of F a unique index from 1 to m , introduce new literals l , . . . , l m of distinct variables which do not intersect with V ar ( F ), and replacethe i -th clause ( l ′ ∨ l ′′ ) by two clauses ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ). Denote the resultingformula by F ′ . On the second stage we introduce two new literals l ∗ and l ∗ suchthat V ar ( l ∗ ) / ∈ V ar ( F ′ ), V ar ( l ∗ ) / ∈ V ar ( F ′ ), and V ar ( l ∗ ) = V ar ( l ∗ ). Thenwe replace in the clauses of F ′ each occurrence of a literal of L by l ∗ , eachoccurrence of a literal of ¬ L by ¬ l ∗ , each occurrence of a literal of L by l ∗ ,and each occurrence of a literal of ¬ L by ¬ l ∗ . Let F ∗ be the resulting formula.e claim that ( F ∗ , { l ∗ } , l ∗ ) is a valid instance of the problem. Toshow this we have to demonstrate that all the clauses of F ∗ are pairwise differentand that SW RT ( F ∗ , l ∗ ) is true.For the former, notice that all the clauses of F ∗ are pairwise different becauseeach clause is associated with the unique literal l i or ¬ l i . This also allows us tointroduce new notation. In particular, we denote the clause of F ∗ containing l i by C ( l i ) and the clause containing ¬ l i by C ( ¬ l i ).For the latter let P ∗ be a set of literals obtained from P by replacing L by l ∗ and ¬ L by ¬ l ∗ . Observe that for each i , P ∗ satisfies either C ( l i ) or C ( ¬ l i ).Indeed, let ( l ′ ∨ l ′′ ) be the origin of C ( l i ) and C ( ¬ l i ) i.e. the clause which istransformed into ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ) in F ′ , then ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ) becomerespectively C ( l i ) and C ( ¬ l i ) in F ∗ (with possible replacement of l ′ or l ′′ orboth). Since P is a satisfying assignment of F , l ′ ∈ P or l ′′ ∈ P . Assume theformer. Then if C ( l i ) = ( l ′ ∨ l i ), l ′ ∈ P ∗ . Otherwise, l ′ ∈ L or l ′ ∈ ¬ L . Inthe former case C ( l i ) = ( l ∗ ∨ l i ) and l ∗ ∈ P ∗ by definition; in the latter case C ( l i ) = ( ¬ l ∗ ∨ l i ) and ¬ l ∗ ∈ P ∗ by definition. So, in all the cases P ∗ satisfies C ( l i ). It can be shown analogously that if l ′′ ∈ P then P ∗ satisfies C ( ¬ l i ). Now,let P ∗ be a set of literals which includes P ∗ and for each i exactly one of { l i ¬ l i } selected as follows. If P ∗ satisfies C ( l i ) then ¬ l i ∈ P ∗ . Otherwise l i ∈ P ∗ . Thus P ∗ satisfies all the clauses of F ∗ . By definition l ∗ ∈ P ∗ ⊆ P ∗ . It is also not hardto show that P ∗ is non-contradictory and that V ar ( P ∗ ) = V ar ( F ∗ ). Thus P ∗ is a satisfying assignment of F ∗ containing l ∗ which witnesses SW RT ( F ∗ , l ∗ ) istrue.We are going to show that there is a set S ⊆ Clauses ( F ) such that | S | ≤ k and SW RT ( F \ S, L ) is true if and only if ( F ∗ , { l ∗ } , l ∗ ) has a CS of size at most k . Assume that there is a set S as above. Let S ∗ ⊆ Clauses ( F ∗ ) be the setconsisting of all clauses C ( l i ) such that the clause with index i belongs to S . Itis clear that | S ∗ | = | S | . Let us show that S ∗ is a CS of ( F ∗ , { l ∗ } , l ∗ ). Let P bea satisfying assignment of F \ S which does not intersect with ¬ L . Let P bethe set of literals obtained from P by replacing the set of all the occurrences ofliterals of L by l ∗ and the set of all the occurrences of literals of L by l ∗ .Observe that for each i , at least one of { C ( l i ) , C ( ¬ l i ) } either belongs to S ∗ or is satisfied by P . In particular, assume that for some i , C ( l i ) / ∈ S ∗ . Then theorigin of C ( l i ) and C ( ¬ l i ) belongs to F \ S and it can be shown that P satisfies C ( l i ) or C ( ¬ l i ) similarly to the way we have shown that P ∗ satisfies C ( l i ) or C ( ¬ l i ) three paragraphs above.For each i , add to P an appropriate l i or ¬ l i so that the remaining clausesof F ∗ \ S ∗ are satisfied, let P be the resulting set of literals. Add to P onearbitrary literal of each variable of V ar ( F ∗ \ S ∗ ) \ V ar ( P ). It is not hard to seethat the resulting set of literals P is a satisfying assignment of F ∗ \ S ∗ , whichdoes not contain ¬ l ∗ nor ¬ l ∗ . It follows that S ∗ is a CS of ( F ∗ , { l ∗ } , l ∗ ) of sizeat most k .Conversely, let S ∗ be a CS of ( F ∗ , { l ∗ } , l ∗ ) of size at most k . Let S be aset of clauses of F such that the clause of index i belongs to S if and only if ( l i ) ∈ S ∗ or C ( ¬ l i ) ∈ S ∗ . Clearly | S | ≤ | S ∗ | . Let S ∗ ⊆ Clauses ( F ∗ ) be theset of all clauses C ( l i ) and C ( ¬ l i ) such that the clause of index i belongs to S .Since S ∗ ⊆ S ∗ , we can specify a satisfying assignment P ∗ of F ∗ \ S ∗ which doesnot contain ¬ l ∗ nor ¬ l ∗ .Let P be a set of literals obtained from P ∗ by removal of all l i , ¬ l i , removalof l ∗ and l ∗ , and adding all the literals l ′ of L such that l ′ or ¬ l ′ appear in theclauses of F \ S . It is not hard to see that V ar ( P ) = V ar ( F \ S ) and that P does not intersect with ¬ L .To observe that P is a satisfying assignment of F \ S , note that there is a bijec-tion between the pairs C ( l i ) , C ( ¬ l i ) of clauses of F ∗ \ S ∗ and the clauses of F \ S .In particular, each clause of F \ S is the origin of exactly one pair { C ( l i ) , C ( ¬ l i ) } of F ∗ \ S ∗ in the form described above and each pair { C ( l i ) , C ( ¬ l i ) } of F ∗ \ S ∗ has exactly one origin in F \ S .Now, let ( l ′ ∨ l ′′ ) be a clause of F \ S which is the origin of C ( l i ) = ( t ′ ∨ l i ) and C ( ¬ l i ) = ( ¬ l i ∨ t ′′ ) of F ∗ \ S ∗ , where l ′ = t ′ or t ′ is the result of replacement of l ′ , t ′′ has the analogous correspondence to l ′′ . By definition of P ∗ , either t ′ ∈ P ∗ or t ′′ ∈ P ∗ . Assume the former. In this case if l ′ = t ′ then l ′ ∈ P . Otherwise t ′ ∈ { l ∗ , l ∗ } and, consequently l ′ ∈ L . By definition of P , l ′ ∈ P . It can be shownanalogously that if t ′′ ∈ P ∗ then l ′′ ∈ P . It follows that any clause of F \ S issatisfied by P .It follows from the above argumentation that Problem I1 with input ( F, L, k )can be solved by solving the parameterized problem with input( F ∗ , { l ∗ } , l ∗ , k ). In particular, if the output of the problem on ( F ∗ , { l ∗ } , l ∗ , k )is a set S ∗ , this set can be transformed into S as shown above and S can bereturned; otherwise ’NO’ is returned. Observe that | Clauses ( F ∗ ) | = O ( m ) and | V ar ( F ∗ ) | = O ( m + | V ar ( F ) | ). Taking into account our note in the proof ofTheorem 6 that | V ar ( F ) | = O ( m ), | V ar ( F ∗ ) | = O ( m ). Also note that we mayassume that k < m because otherwise the algorithm can immediately returns Clauses ( F ∗ ).Substituting this data into the runtime of problem following fromTheorem 6, we obtain that problem I1 can be solved in time O (5 k ∗ k ∗ m ∗ ( m + |{ l ∗ }| )) = O (5 k ∗ k ∗ m ). (cid:3) Claim 9 Problem I2 with input ( F, S, k ) can be solved in time O (15 k ∗ k ∗ m ) ,where, m = | Clauses ( F ) | . Proof We solve Problem I2 by the following algorithm. Explore all possiblesubsets E of S of size at most k . For the given set E explore all the sets ofliterals L obtained by choosing l or l for each clause ( l ∨ l ) of S \ E andcreating L as the set of all chosen literals. For all the resulting pairs ( E, L ) suchthat L is non-contradictory, solve Problem I1 for input ( F ∗ , L, k − | E | ) where F ∗ = F \ S . If for at least one pair ( E, L ) the output is a set S ∗ then return E ∪ S ∗ .Otherwise return ’NO’. Assume that this algorithm returns E ∪ S ∗ such that S ∗ has been obtained for a pair ( E, L ). Let P be a satisfying assignment of F ∗ \ S ∗ which does not intersect with ¬ L . Observe that P ∪ L is non-contradictory,that P ∪ L satisfies all the clauses of Clauses ( F ∗ \ S ∗ ) ∪ ( S \ E ) and that lauses ( F ∗ \ S ∗ ) ∪ ( S \ E ) = Clauses ( F \ ( S ∗ ∪ E )). Let L ′ be a set of literals,one for each variable of V ar ( S \ E ) \ V ar ( P ∪ L ). Then P ∪ L ∪ L ′ is a satisfyingassignment of F \ ( S ∗ ∪ E ), i.e. the output ( S ∗ ∪ E ) is valid. Assume that theoutput of Problem I1 is ’NO’ for all inputs but there is a set Y ⊆ Clauses ( F )such that | Y | ≤ k and F \ Y is satisfiable. Let E = Y ∩ S , S ∗ = Y \ S . Let P be a satisfying assignment of F \ Y and let L be a set of literals obtained byselecting for each clause C of S \ E a literal of C which belongs to P . Then thesubsets of P on the variables of F ∗ \ S ∗ witnesses that SW RT ( F ∗ \ S ∗ , L ) is truethat is the output of problem I1 on ( E, L ) cannot be ’NO’. This contradictionshows that when the proposed algorithm returns ’NO’ this output is valid, i.e.the proposed algorithm correctly solves Problem I2.In order to evaluate the complexity of the proposed algorithm, we bound thenumber of considered combinations ( E, L ). Each clause C = ( l ∨ l ) ∈ S canbe taken to E or l can be taken to L or l can be taken to L . That is, thereare 3 possibilities for each clause, and hence there are at most 3 k +1 possiblecombinations ( E, L ). Multiplying 3 k +1 to the runtime of solving Problem I1following from Claim 8, we obtain the desired runtime for Problem I2. (cid:3) Let ( F, k ) be an instance of problem without repeated occurrences ofclauses. Let C , . . . , C m be the clauses of F . Let F , . . . , F m be formulassuch that F is the empty formula and for each i from 1 to m , Clauses ( F i ) = { C , . . . C i } . We solve ( F, k ) by the method of iterative compression [16]. Inparticular we solve the problems ( F , k ) , . . . ( F m , k ) in the given order.For each ( F i , k ), the output is either a CS S i of F i of size at most k or ’NO’.If ’NO’ is returned for any ( F i , k ), i ≤ m , then clearly ’NO’ can be returnedfor ( F, k ). Clearly, for ( F , k ), S = ∅ . It remains to show how to get S i from S i − . Let S ′ i = S i ∪ { C } . If | S ′ i | ≤ k then S i = S ′ i . Otherwise, we solve problem I F i , S ′ i , k ). If the output of this problem is a set then this setis S i , otherwise the whole iterative compression procedure returns ’NO’. Thecorrectness of this procedure can be easily shown by induction on i . In followsthat problem with input ( F, k ) = ( F m , k ) can be solved by at most m applications of an algorithm solving Problem I2. According to Claim 9, ProblemI2 can be solved in O (15 k ∗ k ∗ m ), so problem with input ( F, k ) can besolved in O (15 k ∗ k ∗ m ).Finally we show that if ( F, k ) contains repeated occurrences of clauses thenthe problem remains fpt and even can be solved in the same runtime.In order to do that, we transform F into a formula F ∗ with all clauses beingpairwise distinct and show that F can be made satisfiable by removal of at most k clauses if and only if F ∗ can.Assign each clause of F a unique index from 1 to m . Introduce new literals l , . . . , l m of distinct variables which do not intersect with V ar ( F ). Replace the i -th clause ( l ′ ∨ l ′′ ) by two clauses ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ). Denote the resultingformula by F ∗ . It is easy to observe that all the clauses of F ∗ are distinct. Let I be the set of indices of clauses of F such that the formula resulting fromtheir removal is satisfiable and let P be a satisfying assignment of this resultingformula. Let S ∗ = { ( l ′ ∨ l i ) | i ∈ I } . Clearly, | S ∗ | = | I | . Observe that F ∗ \ S ∗ isatisfiable. In particular, for every pair of clauses ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ) at leastone clause is either satisfied by P or belongs to S ∗ . Hence F ∗ \ S ∗ can be satisfiedby assignment which is obtained from P by adding for each i either l i or ¬ l i sothat the remaining clauses are satisfied. Conversely, let S ∗ be a set of clauses of F ∗ of size at most k such that F ∗ \ S ∗ is satisfiable and let P ∗ be a satisfyingassignment of F ∗ \ S ∗ . Then for the set of indices I which consists of those i -s such that the clause containing l i or the clause containing ¬ l i belong to S ∗ .Clearly | S ∗ | ≥ | I | . Let F ′ be the formula obtained from F by removal the clauseswhose indices belong to I . Observe that a clause ( l ′ ∨ l ′′ ) belongs to Clauses ( F ′ )if and only if both ( l ′ ∨ l i ) and ( ¬ l i ∨ l ′′ ) belong to Clauses ( F ∗ \ S ∗ ). It followsthat either l ′ or l ′′ belong to P ∗ . Consequently the subset of P ∗ consisting of theliterals of variables of F ′ is a satisfying assignment of F ′ .The argumentation in the previous paragraph shows that the problemwith input ( F, k ) can be solved by solving the problem with input ( F ∗ , k ).If the output on ( F ∗ , k ) is a set S ∗ then S ∗ is transformed into a set of indices I as shown in the previous paragraph and the multiset of clauses correspondingto this set of indices is returned. If the output of the problem on input( F ∗ , k ) is ’NO’ then the output on input ( F, k ) is ’NO’ as well. To obtain thedesired runtime, note that F ∗ has 2 m clauses and O ( m ) variables and substitutethis data to the runtime for problem without repeated occurrences ofliterals. (cid:4) We conclude the paper by presenting a number of by-products of the main re-sult. It is noticed in [6] that the parameterized problem is fpt -equivalentto the vertex cover problem parameterized above the prefect matching ( vc-pm ).It is shown [15] that the vc-pm problem is fpt -equivalent to the vertex coverproblem parameterized above the size of a maximum matching and that the lat-ter problem is fpt -equivalent to a problem of finding whether at most k verticescan be removed from the given graph so that the size of the minimum vertexcover of the resulting graph equals its size of maximum matching. It follows fromTheorem 7 that all these problems are fpt . Acknowledgements We thank Venkatesh Raman for pointing out several relevant references. References J. Bang-Jensen, G. Gutin D igraphs: Theory, Algorithms and Applications,Springer-Verlag, 2001.2. J. Chen, Y. Liu, S. Lu A n Improved Parameterized Algorithm for the MinimumNode Multiway Cut Problem., WADS 2007, pp. 495-506.3. J. Chen, F. Fomin, Y. Liu, S. Lu, Y. Villanger , Improved Algorithms for theFeedback Vertex Set Problems. , WADS 2007, pp. 422-433.4. J. Chen, Y. Liu, S. Lu, B. O’Sullivan, I. Razgon , Directed Feedback Vertex Setis Fixed-Parameter Tractable , STOC 2008, to appear.. J. Chen, I. Kanj , Improved Exact Algorithms for MAX-SAT , Discrete AppliedMathematics, 142(1-3),2004,pp. 17-27.6. E. Demaine, G. Gutin, D. Marx, U. Stege , Open Prob-lems from Dagstuhl Seminar 07281 , avaiable electronically at http://drops.dagstuhl.de/opus/volltexte/2007/1254/pdf/07281.SWM.Paper.1254.pdf M. Grohe, M. Gr¨uber , Parameterized Approximability of the Disjoint CycleProblem. , ICALP 2007, pp. 363-374.8. J. Guo, F. H¨uffner E. Kenar, R. Niedermeier, J. Uhlmann Complexity andExact Algorithms for Multicut. , SOFSEM 2006, pp. 303-312.9. F. H¨uffner Algorithm Engineering for Optimal Graph Bipartization. , WEA 2005,pp.240-252.10. F. H¨uffner, R. Niedermeier, S. Wernicke , Techniques for Practical Fixed-Parameter Algorithms. , The Computer Journal, 51(1), 2008, pp. 7-25.11. S. Khot, V. Raman , Parameterized Complexity of Finding Subgraphs with Hered-itary Properties. , COCOON 2000, pp. 137-147.12. M. Mahajan, V. Raman Parametrizing Above Guaranteed Values: MaxSatand MaxCut , Electronic Colloquium on Computational Complexity (ECCC),4(33),1997.13. M. Mahajan, V. Raman Parametrizing Above Guaranteed Values: MaxSat andMaxCut , Journal of Algorithms, 31(2), 1999, pp. 335-354.14. D. Marx Parameterized graph separation problems. , Theoretical Computer Sci-ence, 351(3), 2006, pp. 394-406.15. S. Mishra, V. Raman, S. Saurabh, S. Sikdar, C.R. Subramanian The Com-plexity of Finding Subgraphs Whose Matching Number Equals the Vertex CoverNumber , ISAAC 2007, pp. 268-279.16. R. Niedermeier , Invitation to fixed-parameter algorithms , Oxford Lecture Seriesin Mathematics and its Applications, volume 31, 2006.17. C. Papadimitriou , Computational Complexity , Addision-Wesley, 1994.18. B. Reed, K. Smith, A. Vetta , Finding odd cycle transversals. , Operations Re-search Letters 32(4),2004, pp.299-301.19.