0% found this document useful (0 votes)
55 views13 pages

The Resolution Algorithm

The Resolution algorithm takes as input a set of clauses and determines if it is satisfiable by performing resolution steps until either deriving the empty clause or saturating the clause set. It is described how resolution works, how steps are ordered, and how the algorithm terminates by proving or finding a satisfying assignment. An example is also provided.

Uploaded by

Harshit Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views13 pages

The Resolution Algorithm

The Resolution algorithm takes as input a set of clauses and determines if it is satisfiable by performing resolution steps until either deriving the empty clause or saturating the clause set. It is described how resolution works, how steps are ordered, and how the algorithm terminates by proving or finding a satisfying assignment. An example is also provided.

Uploaded by

Harshit Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

The Resolution Algorithm

Introduction

In this lecture we introduce the Resolution algorithm for solving instances of the NP-complete CNF-
SAT decision problem. Although the algorithm does not run in polynomial time for all instances, it
does offer the advantages of

1. being correct and terminating on all instances of CNF-SAT,

2. offering a formal proof in the case that an instance of CNF-SAT is unsatisfiable,

3. being easy to implement, and

4. having a reputation for efficiency when applied to practical instances of CNF-SAT (as opposed
to some provably-hard theoretical instances).

It should be noted that there has been much recent work performed in the development of randomized
local-search heuristics for solving CNF-SAT instances. One such heuristic is Bart Selman’s WalkSAT.
Although these heuristics do not offer the above advantages of 1. and 2., they do possess advantages
3. and 4., and have been shown to outperform Resolution in several studies. The interested reader
should consult Chapter 5 of the “Handbook of Constraint Programming”, Elsevier Press, 2008.

Algorithm Description

The Resolution algorithm takes as input a set C of clauses and returns true iff C is satisfiable. It does
this by performing a sequence of resolution steps, where each step consists of identfying two clauses
c1 , c2 ∈ C of the form c1 = P ∨x, and c2 = Q∨x, and then adding to C the resolvent clause c = P ∨Q,
where P and Q are disjunctions of literals, and x is a variable, called the resolved variable.
Moreover, the pair (c1 , c2 ) is called a resolution pair, while res(c1 , c2 ) denotes the resolvent of the
pair.

1
Proposition 1. Given a set of clauses C, if clause c is the resolvent of clauses c1 , c2 ∈ C, then C is
satisfiable iff C + c is satisfiable.

Proof of Proposition 1. Given c1 , c2 ∈ C, where c1 = P ∨ x, and c2 = Q ∨ x, and c = P ∨ Q is a


resolvent of c1 and c2 , it is an exercise to show that

(P ∨ x) ∧ (Q ∨ x)

is logically equivalent to
(P ∨ x) ∧ (Q ∨ x) ∧ (P ∨ Q).
In other words, any assignment that satisfies the former formula will also satisfy the latter formula
and vice versa. Therefore, C is satisfiable iff C + c is satisfiable.

Proposition 2. Given CNF-SAT instance C with c1 , c2 ∈ C and c1 ⊆ c2 , then C is satisfiable iff


C − c2 is satisfiable.

Proof of Proposition 2. Suppose C is satisfiable. Then C − c2 is also satisfiable. Conversely, if


C − c2 is satisfiable via assignment a, then a satisfies c1 , and hence must also satisfy c2 . Therefore,
C is satisfiable.

Whenever there are two clauses c1 , c2 ∈ C for which c1 ⊆ c2 , then c2 is said to be subsumed by c1 ,
and may be removed from C without affecting the (un)satisfiability of C. Therefore, a resolvent c
need only be added to C in case it is not subsumed by any clause that is already in C. Moreover,
upon adding resolvent c to C, we may subtract from C any clause that is subsumed by c. Thus, we
may always assume that C is subsumption free, meaning that it does not contain two clauses c1
and c2 for which c1 ⊆ c2 . Henceforth, all CNF-SAT instances C are assumed to be subsumption free.

Ordering the resolution steps

Since a set of clauses C may possess more than one resolution pair, we define a linear ordering on
such pairs that informs the Resolution algorithm on which pair to resolve next. To accomplish this
we first define linear orderings for literals and clauses.

To define a linear ordering on literals, first assume that the clause variables come from the set
V = {x1 , . . . , xn }, and let V denote the set of negations of variables that appear in V . Next,
define the one-to-one function order : V ∪ V → I that assigns each literal a unique integer, where
order(xi ) = i and order(xi ) = −i. Then literal l1 precedes literal l2 iff order(l1 ) < order(l2 ).

Now let c1 6= c2 be two clauses. Then we have c1 < c2 in case c1 ⊂ c2 and c2 < c1 in case c2 ⊂ c1 .
Hence, assume both c1 6⊂ c2 and c2 6⊂ c1 are true. Then c1 < c2 iff order(l1 ) < order(l2 ), where, e.g.,
l1 ∈ c1 is the least literal that is not a member of c2 . As an example,

c1 = (x2 , x3 , x5 ) < c2 = (x3 , x5 , x7 ),

2
since order(x2 ) = 2 < order(x3 ) = 3.

Finally, we may now define an ordering on resolution pairs based on the size (i.e. number of literals) of
their respective resolvents. Indeed, letting size(c) denote the number of distinct literals in c, we have
(c1 , c2 ) < (c3 , c4 ) iff either i) size(res(c1 , c2 )) < size(res(c3 , c4 )) or ii) size(res(c1 , c2 )) = size(res(c3 , c4 ))
and res(c1 , c2 ) < res(c3 , c4 ), or iii) res(c1 , c2 ) = res(c3 , c4 ) and the resolving variable for (c1 , c2 ) has
lower index than that of (c3 , c4 ).

Algorithm termination

There are two possibilities for how the Resolution algorithm terminates: via a refutation step, or via
clause saturation.

In the first case, there is a step for which c1 = x and c2 = x, in which case P and Q are empty, and
hence the resolvent P ∨ Q is the empty clause, and is denoted by F, since it is logically equivalent
to false. Such a step is called a refutation step, and the algorithm is said to have performed
a refutation proof. In this case C is unsatisfiable since, by Proposition 1, any assignment that
satisfies C must also satisfy a resolvent (in this case F) derived from C.

In the second case, for each possible pair of clauses c1 = P ∨ x, and c2 = Q ∨ x, it is the case that
P ∨ Q is subsumed by a member of C, in which case no new resolvents (including F) can be added
to C. In this case C is said to be saturated. In the next section we prove that saturated instances
must be satisfiable. Conversely, if C is satisfiable, then, by Proposition 1, it cannot derive the empty
clause. Moreover, it must become saturated since there are at most 3n different possible resolvents
(why?).

3
Finding a satisfying assignment

Suppose subsumption-free CNF-SAT instance C is saturated. Then the following method can be used
to determine a satisfying assignment for C. While C is non-empty, choose a clause c ∈ C and a literal
l ∈ c and assign l to true. Remove c from C and any other clause from C that contains l. For any
clause c0 ∈ C that contains l, remove l from c0 . Note: when removing l from c0 , we may rest assured
that c0 does not become empty. Otherwise, it must be the case that c0 = (l), in which case c and
c0 could be resolved to form clause c2 that subsumes c, which contradicts the assumption that C is
both saturated and subsumption-free.

Claim: after i) removing clauses from C that contain l, ii) removing literal l from all remaining
clauses, and iii) removing any clause c2 ∈ C that is subsumed by another clause c1 ∈ C, the resulting
set of clauses is saturated.

Proof of Claim. Suppose C is no longer saturated. Then there are two clauses c1 , c2 ∈ C that can
be resolved to produce the resolvent c that is not subsumed by any clause in C. But prior to the
removal of clauses and literals described in i-iii, c was subsumed by some clause c0 . Moreover, if c0
remains in C, then the only possible change to c0 is the removal of l from c0 . But for any literal l,
and two claues c1 and c2 with c1 ⊆ c2 , we have both c1 − l ⊆ c2 , and c1 − l ⊆ c2 − l. Thus, c0 − l
still subsumes c, and so it must be the case that c0 was removed from C. Moreover, in the case that
c0 contains l, since c0 subsumes c, either c1 or c2 must have contained l, contradicting the fact that
both clauses remain in C. Finally, if c0 was removed because of being subsumed by c00 ∈ C, then c00
subsumes c by transitivity.

It follows from the above claim that either C will be empty (in which case any remaining unassigned
variables may be arbitrarily assigned), or the process of selecting clause c, along with a satisfying
literal l of c, can be successfully repeated until C becomes empty. Now suppose that the above process
is repeated until the set of clauses becomes empty,. Then letting L denote the set of literals that
were selected to be true at each stage, it follows that L is a consistent set, and hence the assignment
aL induced by L is well defined, and satisfies the original saturated set C. To see this, consider c ∈ C
from the original saturated set. If c was removed from C because l ∈ c and l was set to true during
one of the rounds, then l ∈ L and aL satisfies c. On the other hand, suppose c were removed because
of being subsumed by c0 . Then it is an exercise to show that there must be a clause d for which aL
satisfies d, and for which d ⊆ c. Thus, aL satisfies c.

4
Example 1. Use the above claim to construct a tree that enumerates all satisfying assignments for
the saturated set of clauses
{(x1 , x2 ), (x1 , x3 ), (x2 , x3 )}.

5
Resolution Examples

The following examples of the Resolution algorithm will use the following method for determining
the next resolution step. Begin by placing all clauses in a list L, and perform the following until
either L is saturated or a refutation is found. For each clause c1 ∈ L, find all clauses c2 ∈ L that
come after c1 , and for which c1 can be resolved with c2 , but has yet to be resolved with c2 . Append
the resolvent c of c1 and c2 to L provided it is not subsumed by an existing clause in L. Remove
all clauses from L that are subsumed by c. Repeat until L has been cycled through at least once
without any new clauses being added.

Example 2. Use the Resolution algorithm to determine if the following set of clauses is satisfiable.

C = {(x2 ), (x2 , x3 ), (x2 , x1 ), (x1 , x2 , x3 )}.

6
Example 3. Use the Resolution algorithm to determine if the following set of clauses is satisfiable.

C = {(a, b), (c, e), (b, c), (d, a), (a, b), (c, d), (d, e), (c, b)}.

7
An Exponential Lower Bound for the Running Time of Res-
olution

In this section we prove that, for every n, there exists an unsatifiable set of clauses Cn for which
the Resolution algorithm requires cn steps before a refutation step can be found, where c > 1 is a
constant. This proves that the Resolution algorithm has worst-case exponential running time.

The following definition will prove useful in establishing the lower-bound result. Let C be an unstat-
isfiable set of clauses, and let R(C) denote the set of resolvents (incuding C itself) that are produced
by the Resolution algorithm on input C. Then the refutation proof graph with respect to C is
the directed graph whose vertex set is R(C), and whose edge set is the set of edges (c1 , c2 ), where
c1 , c2 ∈ R(C), and c1 was resolved with some other clause c to produce resolvent c2 . Note: since G is
directed c1 is called the parent of c2 , and c2 is the child of c1 . It thus follows that, for every clause
c ∈ R(C), either c ∈ C and c has no parents, or c is a resolvent, and has two parents.

Without loss of generality, we henceforth assume that, for every vertex v of a proof graph, there is
a path from v to the empty clause. In other words, we may remove any part of the graph that does
not contribute to the derivation of empty clause F.

Example 4. Show the proof graph for the unsatisfiable set of clauses from Example 2.

8
To prove the exponential lower bound for the running time of Resolution, we prove that, for each
n ≥ 1, there is an unsatisfiable set of clauses Cn for which the size of any proof graph with respect
to Cn must exceed cn , where c > 1 is a constant to be determined later.

The set of clauses Cn will model the following two statements involving the Pigeonhole Principle.

1. Each of n + 1 pigeons is placed in exactly one of n holes.

2. No two pigeons share the same hole.

These statements taken together are false, and hence Cn is unsatisfiable. Now let xij be the Boolean
variable that evaluates to true iff hole i contains pigeon j, 1 ≤ i ≤ n, 1 ≤ j ≤ n + 1. Then Statement
1. can be modeled with the type-1 clauses

x1j ∨ · · · ∨ xnj ,

1 ≤ j ≤ n + 1, while Statement 2 can be modeled with the type-2 clauses

(xi1 , xi2 ), . . . , (xi1 , xi(n+1) ), (xi2 , xi3 ), . . . , (xi2 , xi(n+1) ), . . . (xin , xi(n+1) ),

1 ≤ i ≤ n.

Given the variables being used, it seems appropriate to use matrices to represent both assignments
and clauses. For example, any assignment over the variables of Cn may be represented with an
n × (n + 1) matrix a for which aij is the value assigned to variable xij . Similarly, any clause over the
variables of Cn can be represented with an n × (n + 1) matrix c for which

 ⊕ if xij ∈ c
cij = if xij ∈ c
blank otherwise

Example 5. For C3 , provide a matrix representation of i) the type-1 clause that asserts that Pigeon
1 is placed in some hole, and ii) the assignment that assisgns Pigeon 1 to holes 1 and 3, Pigeon 2 to
hole 2, and no hole to Pigeon 3.

9
Assignment a is said to be critical iff a assigns each of n pigeons to n different holes, and assigns
no hole to one of the pigeons. Thus, matrix a has n columns that have exactly one 1, and one zero
column with no 1’s.

Example 6. Give an example of a critical assignment for C4 in which column 3 serves as the zero
column.

Moreover, Exercise 6 implies that, for the proof graph Gn of Cn , and for any assignment a over
var(Cn ), there is a path in Gn from one of the clauses of Cn to the empty clause, for which each clause
in the path is unsatisfied by a. In particular, if a be a critical assignment in which Pigeon j is not
assigned to a hole, then the path Pa associated with a must begin with the type-1 clause

x1j ∨ · · · ∨ xnj .

This clause (as a matrix) has n ⊕’s in column j. Furthermore, since Pa ends at the empty clause,
which has zero ⊕’s in column j, and a single resolution step will produce a resolvent with at most
one fewer ⊕ than one of its parents, it follows that there must be a clause in Pa that has exactly n/2
⊕’s in column j.

Next, recall that, for any directed acyclic graph G = (V, E), the vertices of G can be topologically
ordered in such a way that, for every (u, v) ∈ E, u comes before v in the order. Assume such an
ordering for Gn . Now, for critical assignment a whose zero column is j, let ca be the first clause in
the ordering that has exactly n/2 ⊕’s in column j, and that is not satisfied by a. By the previous
paragraph, ca must exist. Why does ca have no in column j?

Now let s be a partial assignment that assigns values to exactly n/8 of the (n + 1) columns, where
each column is assigned exactly one 1 and (n−1) 0’s, and the n/8 1’s occur in different rows. In other
words, s assigns exactly n/8 pigeons to n/8 distinct holes. Then define cs as being the first clause ca
in the topological ordering for which critical assignment a is an extension of s. For each such s, cs
is called the complex clause associated with s. Notice that, for cs = ca , critical assignment a has
exactly n − n/2 − n/8 = 3n/8 1’s that were not assigned by s and are not in the same row as any of
the n/2 ⊕’s that occur in column j (the zero column of a) of ca . Any column of ca where one of the
3n/8 1’s is located is called a good column of ca .

10
Example 7. For n = 8, let s be the partial assignment that assigns column 1 the values (10000000)
from top to bottom. Give an example of a critical-assignment extension a of s with zero column 9,
along with a possible clause cs for which cs = ca .

Claim: every good column of cs = ca has either (exactly) one or at least n/2 ⊕’s.

Proof of claim. Let s, a, and cs = ca be given. First notice that no column of ca can have two or
more ’s (why?). Now suppose that good column k of ca has zero ’s and fewer than n/2 ⊕’s. Let
a∗ be the critical assignment obtained from a by changing the 1 in column k to 0, and changing the
0 in column j (the zero column of a) to a 1, where the changed 0 in column j is in the same row as
the changed 1 in column k. Notice that a∗ does not satisfy ca . This is true since i) a does not satisfy
ca , ii) a∗ has all 0’s in column k, but ca has no ’s in column k, and iii) the 0 that was changed to a
1 in column j is not in the same position as one of the n/2 ⊕’s of ca , since the row where the change
occurred was one of the 3n/8 rows that neither coincide with a 1 of s nor with an ⊕ in column j.

Since a∗ does not satisfy ca , we can trace a path back from ca to one of the original (type-1) clauses,
such that every clause on the path is not satisfied by a∗ . Moreover, the original type-1 clause of this
path has n ⊕’s in column k, and, since ca has fewer than n/2 ⊕’s in column k, there must be some
clause c along the path that has exactly n/2 ⊕’s in column k. Hence, c has the same form as ca∗
which implies that ca∗ ≤ c < ca in the topological ordering. But since a∗ is also an extension of s,
and cs is defined as the first ca for which a is an extension of s, ca∗ should have been chosen for cs
instead of ca , which is a contradiction. Therefore, ca must have either exactly one or at least n/2
⊕’s in each of its good columns.

Now let c1 , . . . , ct denote the complex clauses that occur in Gn . Each cr can be adjusted to form an
altered complex clause c0r . This is done by taking any column of cr that has an and replacing
it with a column that removes the and has n − 1 ⊕’s, with no ⊕ in the former position of the .
Now let s be a partial assignment that does not satisfy cr . Suppose that one of the n/8 columns of
s corresponds with a column of cr that was changed to form c0r . Since the unique 1 assigned by s in
this column occurs at the former location of , it follows that s does not satisfy c0r via this column,
and hence s does not satisfy c0r .

Let A = {c01 , . . . , c0t } denote the altered set of complex clauses. It follows by the above claim that
each clause in A has at least (3n/8 + 1) · (n/2) ⊕’s. Let Aij denote the set of altered complex clauses
that have an ⊕ in row i and column j, 1 ≤ i ≤ n, 1 ≤ j ≤ n + 1.

11
We now describe a greedy algorithm for constructing a partial assignment s. The algorithm greedily
attempts to construct s so that is satisfies as many of the t clauses of A as possible. The algorithm
works in n/8 rounds, where in each round a position is selected for where the next 1 will be assigned
by s. In round 1, the position is selected as (i, j), where |Aij | is a maximum. In other words, it
assigns a 1 at the position where the most number of ⊕’s are occurring with respect to clauses in
A1 = A. It then sets A2 = A1 − Aij .

Now, if an adversary, call him min, is attempting to spoil the ambitions of the algorithm, he would
distribute the t(3n/8 + 1) · (n/2) ⊕’s uniformly about each of the n(n + 1) positions. In this way
assigning a 1 to a single position would be guaranteed to satisfy at least
t(3n/8 + 1)(n/2) t(3n/8)(n/2) 3t
≥[ =
n(n + 1) n(n + 1) 16
3
clauses, or 16
of the entire set.

Now suppose the algorithm has been described up to round k − 1 for some k ≥ 2, and that Ak ⊆ A
has been defined. Let Akij denote those clauses of A that have an ⊕ in row i and column j, 1 ≤ i ≤ n,
1 ≤ j ≤ n + 1, and have not been satisfied by s in any of the previous rounds. Then in round k the
algorithm selects position (i, j) for which i) i is different from any row selected in a previous round,
ii) j is different from any column selected in a previous round, and iii) |Akij | is a maximum among all
such row-column combinations.

Similar to round 1, in round k + 1, if min wants to spoil the ambitions of the algorithm, he would
distribute the |Ak+1 |(3n/8+1−k)·(n/2−k) ⊕’s uniformly about each of the remaining (n−k)(n+1−k)
positions. In this way assigning a 1 to a single position would be guaranteed to satisfy a fraction of
(3n/8 + 1 − k)(n/2 − k) (3n/8 − k)(n/2 − k)
≥ .
(n − k)(n + 1 − k)) (n − k)2
Moreover, we can obtain a lower bound for this fraction by setting k = n/8 to get
(3n/8 − n/8)(n/2 − n/8) 6
2
= .
(n − n/8) 49
43 k
Thus, the number of clauses from A that remain unsatisfied after round k is no more than ( 49 ) |A|.
In other words,
43
|Ak | ≤ t( )k ,
49
k n/8
which, since |A | is an integer, implies |A | = 0 provided
43 n/8 49
t( ) < 1 ⇒ t < ( )n/8 = cn ≈ (1.0646)n .
49 43

Now suppose that t is in fact less than (1.0646)n . Then the above algorithm implies that there is a
partial assignment s that satisfies all complex clauses of Gn . But, by definition, cs = ca is a complex
clause of Gn , where a is an extension of s that does not satisfy ca . Thus, s does not satifsy cs = ca
which is a contradiction. Therefore, it must be the case that t ≥ cn , where c ≈ 1.0646. Therefore, the
proof graph Gn has a size that grows exponentially in n, and the Resolution algorithm has worst-case
exponential running time.

12
References

U. Schoning, R. Pruim, “Gems of Theoretical Computer Science”, Chapter 6


Springer, 1998

Exercises
1. We say that a clause c over a set of n variables is simple iff i) every literal appears at most
once in c, and ii) if l ∈ c, then l 6∈ c. Provide a counting argument to establish that there are
exactly 3n different simple clauses over n variables.

2. Use the method shown in Example 1 to determine all satisfying assignments for the saturated
set of clauses
{(x2 ), (x1 , x3 ), (x3 , x4 ), (x1 , x4 )}.

3. Perform the Resolution algorithm on the following set of satisfiable clauses

{(x2 , x3 ), (x2 , x4 ), (x1 , x3 ), (x2 , x3 ), (x1 , x4 ), (x1 , x4 ), (x1 , x2 )}.

Provide the final set of saturated clauses and use it to determine a satisfying assignment.

4. Repeat the previous exercise, but with the added clause of (x2 , x3 ). Draw the refutation proof
graph.

5. Let G be the proof graph for some set C of unstatisfiable clauses. Let a be any assignment
over the clause variables. Prove that if a does not satisfy some clause c in R(C), and if c has
parents, then a also does not satisfy one of its parents.

6. Let G be the proof graph for some set C of unstatisfiable clauses. Let a be any assignment over
the clause variables. Prove that there is a path in G from one of the clauses of C to the empty
clause, for which each clause in the path is unsatisfied by a. Hint: use the previous exercise
and work backwards from the empty clause.

7. How many critical assignments are there for Pigeon-Hole problem Cn ?

8. Given critical assignment a whose zero column is i, explain why ca cannot have a in column
i.

9. Given partial asignment s and critical assignment a for which cs = ca , prove that no column of
ca can have two or more ’s.

13

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy