19 Resolution
19 Resolution
Propositional and
First-Order Logic
Inference rules
• Logical inference creates new sentences that
logically follow from a set of sentences (KB)
• An inference rule is sound if every sentence X it
produces when operating on a KB logically
follows from the KB
– i.e., inference rule creates no contradictions
• An inference rule is complete if it can produce
every expression that logically follows from (is
entailed by) the KB.
– Note analogy to complete search algorithms
Sound rules of inference
• Here are some examples of sound rules of inference
• Each can be shown to be sound using a truth table
RULE PREMISE CONCLUSION
Modus Ponens A, A → B B
And Introduction A, B A∧B
And Elimination A∧B A
Double Negation ¬¬A A
Unit Resolution A ∨ B, ¬B A
Resolution A ∨ B, ¬B ∨ C A ∨ C
Soundness of modus ponens
A B A→B OK?
True True True
√
True False False
√
False True True
√
False False True
√
Resolution
• Resolution is a valid inference rule producing a new
clause implied by two clauses containing
complementary literals
– A literal is an atomic symbol or its negation, i.e., P, ~P
• Amazingly, this is the only interference rule you
need to build a sound and complete theorem prover
– Based on proof by contradiction and usually called
resolution refutation
• The resolution rule was discovered by Alan
Robinson (CS, U. of Syracuse) in the mid 60s
Resolution
• A KB is actually a set of sentences all of which are
true, i.e., a conjunction of sentences.
• To use resolution, put KB into conjunctive normal
form (CNF), where each sentence written as a disjunc-
tion of (one or more) literals
Tautologies
Example (A→B)↔(~A∨B)
• KB: [P→Q , Q→R∧S] (A∨(B∧C)) ↔(A∨B)∧(A∨C)
• KB in CNF: [~P∨Q , ~Q∨R , ~Q∨S]
• Resolve KB(1) and KB(2) producing: ~P∨R (i.e., P→R)
• Resolve KB(1) and KB(3) producing: ~P∨S (i.e., P→S)
• New KB: [~P∨Q , ~Q∨~R∨~S , ~P∨R , ~P∨S]
Soundness of the
resolution inference rule
~P(w) v S(w)
~R(w) v S(w)
S(x) v R(x)
S(A)
Resolution refutation
• Given a consistent set of axioms KB and goal sentence
Q, show that KB |= Q
• Proof by contradiction: Add ¬Q to KB and try to
prove false, i.e.:
(KB |- Q) ↔ (KB ∧ ¬Q |- False)
• Resolution is refutation complete: it can establish
that a given sentence Q is entailed by KB, but can’t
(in general) generate all logical consequences of a set
of sentences
• Also, it cannot be used to prove that Q is not entailed
by KB
• Resolution won’t always give an answer since
entailment is only semi-decidable
– And you can’t just run two proofs in parallel, one trying
to prove Q and the other trying to prove ¬Q, since KB
might not entail either one
Resolution example
• KB:
– allergies(X) → sneeze(X)
– cat(Y) ∧ allergicToCats(X) → allergies(X)
– cat(felix)
– allergicToCats(mary)
• Goal:
– sneeze(mary)
Refutation resolution proof tree
¬allergies(w) v sneeze(w) ¬cat(y) v ¬allergicToCats(z) ∨ allergies(z)
w/z
y/felix
sneeze(z) v ¬allergicToCats(z) allergicToCats(mary)
z/mary
sneeze(mary) ¬sneeze(mary)
Notation
old/new false
negated query