You are on page 1of 44

Chapter 4

Resolution
Part-1

Dr. Abdelaziz Said

1
Chapter 4

Resolution
Part-1

Dr. Abdelaziz Said

2
Contents

1 Conjunctive Normal Form

2 Propositional Resolution

3 Resolution Strategies

3
Introduction

❖ Propositional resolution: is an extremely powerful rule of


inference for propositional logic.

❖ Using propositional resolution, it is possible to build a


theorem prover that is sound and complete for all
propositional logic.

4
Why Resolution?

❖ Inference rules and replacement rules are complex (what


rules to apply) , particularly when the search space is
large.

❖ Resolution use only one rule to build a complete


inference procedure.

❖ It is used as the inference engine in PROLOG.

❖ Resolution rule only applies to clausal form.

5
Clausal Form

❖ A literal is either statement letter or a negation of statement letter


EX: P
p

❖ A clause expression is either a literal or a disjunction of literals


EX: P
pq

❖ A clause is the set of literals in a clause expression. For example,


the following are the set of clauses corresponding to the clause
expressions above.
EX: {p}
{p, q}

❖ Contradiction (False) is represented by empty clause { } or Ø

6
Converting PL to CNF

❖ Resolution rule only applies to disjunctions

❖ To apply resolution, put your clauses into conjunctive normal


form(CNF), where each sentence written as a disjunction of (one or
more) literals

❖ In other words, a formula is in CNF if and only if :

❖ Its only connectives are  , & , ¬


❖ ¬ applies only to statement letters
❖ Formulas are on product of sum form

7
Converting PL to CNF
INDO-Steps

8
PL to CNF, Example

Convert :

9
PL to CNF, Example

Convert :

10
PL to CNF, Example

Convert :

11
PL to CNF, Example

Convert :

12
PL to CNF, Example

Convert :

13
PL to CNF, Example

Convert :

14
PL to CNF, Example

Convert :

15
PL to CNF, Example

Convert :

16
PL to CNF, Example

Convert :

17
PL to CNF, Example

Convert :

18
Propositional Resolution

❖ Suppose we have one clause contains p, and the other clause


contains p

❖ If p is false, then by the first clause q must be true. If p is true,


then, by the second clause, r must be true

19
Propositional Resolution

❖ More generally, given a clause containing a literal  and another


clause containing the literal  , we can infer the clause
consisting of all the literals of both clauses without the
complementary pair.
❖ This rule of inference is called propositional resolution

20
Propositional Resolution

Multiple occurrences

❖ In drawing a conclusion from two clauses that share a literal,


we merge the two occurrences into one, as in the following
example

21
Propositional Resolution

Empty clause
❖ Resolving two singleton clauses leads to the empty clause; i.e.
the clause consisting of no literals at all, as shown below. The
derivation of the empty clause means that there is contradiction

22
Propositional Resolution

Resolvent
❖ Note that when resolving two clauses, only one pair of literals
may be resolved at a time, even though there are multiple
resolvable pairs. For example, the following is not a legal
application of propositional resolution.

23
Propositional Resolution

Resolvent
❖ If two clauses resolve, they may have more than one resolvent
because there may be more than one way in which to choose
the resolvent . Consider the following example:

24
Resolution Vs. Inference Rules

Disjunctive syllogism(DS):

25
Resolution Vs. Inference Rules

Hypothetical Syllogism (HS):

26
Resolution Vs. Inference Rules

Modus Tollens (MT):

27
Propositional Resolution, Example

❖ In order to determine whether a set of clauses is unsatisfiable,


we look for a resolution proof of the empty clause from the set
of premises
1) {p,q} Premise
2) {p,q} Premise

3) {p, q} Premise

4) {p,q} Premise

5) {q} 1,2
6) {q} 3,4
7) {} 5,6

28
Propositional Resolution, Example

Resolution Tree:

29
Propositional Resolution
Validity Checking
❖ In order to determine that a set of clauses is valid (tautology) ,
resolution proof is generally not complete, i.e. there is no direct
way to derive all consequences from a set of premises.
❖ EX: consider this tautology statement : p →(q→p)

p →(q→p)
I p  (q→p)
p  ( q  p)
N p  ( q  p)
D p  ( q  p)
O { p, p, q}

There no clauses to resolve !!

30
Propositional Resolution

❖ When resolution is used to prove inconsistency, it is called


refutation

❖ Refutation is complete
➢ If we derive a contradiction, then the conclusion follows from the
premises
➢ If we can’t apply any more, then the conclusion cannot be proved
from the premises.
❖ All inconsistencies can be reached by refutation

31
Propositional Resolution

❖ The resolution algorithm uses the principle of proof by contradiction

❖ Suppose the following argument:

❖ In order to apply resolution to validate this argument, we will negate


the goal and then add it to the premises:
➢ p→q
➢ q→r
➢  (p→r)

32
Propositional Resolution, Example

33
Propositional Resolution, Quiz
❖ If Mary loves Pat, then Mary loves Quincy. We also know that, if
it is Monday, then Mary loves Pat or Quincy. Our job is to prove
that, if it is Monday, then Mary loves Quincy.

34
Propositional Resolution

35
Resolution Strategies

❖ When doing resolution automatically, one has to decide in which


order to resolve the clauses. This order can greatly affect the
time needed to find a contradiction.

❖ There are various strategies to control this process

❖ Unit preference
❖ Set of support
❖ Davis-Putnam Procedure (DPP)

36
Resolution Strategies

❖ Unit preference: choose a resolution step involving an unit


clause (clause with one literal). Moreover, preference is given to
clauses that have not been used yet.
➢ Produces a shorter clause, which is good since we are
trying to produce a zero-length clause, that is, a contradiction.

37
Unit preference, Example

1) {p1,p2} Premise
2) {p2} Premise

3) {p1,p3, p4} Premise


4) {p3,p5} Premise
5) {p6, p5} Premise
6) {p6} Premise
7) {p4} Negated goal
8) {p1} 1,2
9) {p5} 5,6
10) {p1, p3} 3,7
11) {p3} 8,10
12) {p3} 4,9
13) { } 11,12
38
Resolution Strategies

❖ The unit resolution is not complete

❖ If we have premises: (q  r) , (q  ¬q) , and (¬ q  q) ,


and the conclusion is (r & q)

❖ In this case there is no unit clause, which makes unit


resolution impossible.

39
Resolution Strategies

❖ Set of support: Choose a resolution involving the


negated goal or any clause derived from the negated
goal
➢ We’re trying to produce a contradiction that follows from the negated
goal, so these are “relevant” clauses

➢ If a contradiction exists, it could be found using the set-of support


strategy

❖ Resolution with the set of support strategy is complete.

40
Set of support, Example

41
Resolution Strategies

❖ Davis-Putnam Procedure (DPP): treats clauses as sets, given


input of nonempty set of clauses in the propositional form
P1 , P2, ……, Pn , the DPP repeats the following steps until there
are no variables left:

1. Choose a variable P appearing in one of the clauses


2. Add all possible resolvents using resolution on P to the set of
clauses
3. Discard all clauses with P or ¬ P in them

❖ Resolution with DPP strategy is complete

42
DPP, Example

43
43
Chapter 4

44

You might also like