Knowledge
Representation &
Reasoning
Resolution
Contents
Resolution
Algorithm
Steps for Resolution
Examples
RESOLUTION
• Resolution yields a complete inference algorithm when coupled with
any complete search algorithm.
• Resolution makes use of the inference rules.
• Resolution performs deductive inference.
• Resolution uses proof by contradiction.
• One can perform Resolution from a Knowledge Base.
• A Knowledge Base is a collection of facts or one can even call it a
database with all facts.
ALGORITHM
Let f be a set of given statements and S is a statement to be proved.
• 1. Covert all the statements of F to clause form.
• 2. Negate S and convert the result to clause form. Add it to the set of
clauses obtained in 1.
• 3. Repeat until either a contradiction is found or no progress can be
made or a predetermined amount of effort has been expended.
a. Select two clauses. Call them parent clauses.
b. Resolve them together. The resolvent will be the
disjunction of all of these literals of both clauses.
• If there is a pair of literals T1 and T2 such that one parent clause
contains T1 and the other contains T2 and if T1 and T2 are unifiable,
then neither T1 nor T2 should appear in the resolvent.
• Here T1 and T2 are called complimentary literals.
c. If the resolvent is the empty clause, then a contradiction has been
found. If it is not, then add it to the set of clauses available to the
procedure.
Steps for Resolution
1. Conversion of facts into first-order logic.
2. Convert FOL statements into CNF
3. Negate the statement which needs to prove (proof by contradiction)
4. Draw resolution graph (unification).
• To better understand all the above steps, we will take an example in
which we will apply resolution.
• Example:
• Convert the following sentence into predicate logic and then prove
"Was Marcus loyal to Caesar? using resolution:
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Romans were either loyal to Caesar or hated him.
6. Everyone is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
• Step-1: Conversion of Facts into FOL
• 1. Marcus was a man. man(Marcus)
• 2. Marcus was a Pompeian. Pompeian(Marcus)
• 3. All Pompeians were Romans. ∀x: Pompeian(x) → Roman(x)
• 4. Caesar was a ruler. ruler(Caesar)
• 5. All Romans were either loyal to Caesar or hated him.
∀x: Roman(x) → loyalto(X. Caesar) V hate(x, Caesar)
• 6. Everyone is loyal to someone.
∀x : → y: Ioyalto(x,y)
• 7. People only try to assassinate rulers they are not loyal to.
∀ x : ∀ y : person(x) ∧ ruler(y) ∧ tryassassinate(x,y) → ¬ Ioyalto(x,y)
• 8. Marcus tried to assassinate Caesar.
tryassassinate (Marcus, Caesar)
• Additional: ∀x: man(x) → person(x)
∀x: rman(x) V person(x)
• 9. rman(x) V person(x)
• Step-2: Conversion of FOL into CNF
• Eliminate all implication (→) and rewrite
• Move negation (¬)inwards and rewrite
• Rename variables or standardize variables
• Eliminate existential instantiation quantifier by elimination
• Drop Universal quantifiers
CNF
• man(Marcus)
• Pompeian(Marcus)
• ¬ Pompeian(x1) V Roman(x1)
• ruler(Caesar)
• ¬ Roman(x2) V loyalto(x2, Caesar) V hate(x2, Caesar)
• loyalto(x3, S1(x3))
• ¬ person(x4) V ¬ruler(y1) V ¬Vtryassassinate(x4, y1) V ¬loyalto(x4, y1)
• tryassassinate(Marcus, Caesar)
• Step-3: Negate the statement to be proved
• In this statement, we will apply negation to the conclusion
statements, which will be written as loyalto(M,C)
Resolution tree:
Step-4: Draw Resolution graph:
Thank
You