Resolution is a single inference rule that, with refutation, is sound and complete for all of propositional and first-order logic.
The Resolution Rule
Resolution works on sentences in conjunctive normal form (CNF): a conjunction of clauses, each clause a disjunction of literals. The resolution rule takes two clauses with complementary literals, one containing L and the other ¬L, and produces their resolvent: the disjunction of all remaining literals. From (A ∨ B ∨ L) and (¬L ∨ C) infer (A ∨ B ∨ C). Modus ponens is a special case: from (¬P ∨ Q) i.e. P → Q and (P) infer (Q). Resolving two unit clauses L and ¬L gives the empty clause, a contradiction.
Proof by Refutation
To prove that the KB entails α, show that KB ∧ ¬α is unsatisfiable: convert KB and ¬α to CNF, then resolve pairs of clauses repeatedly and add the resolvents; if the empty clause is derived, the assumption ¬α is false and α follows. If no new clauses can be added without deriving the empty clause, α is not entailed. Resolution is refutation-complete: it will always find the contradiction if one exists.
Definition: Resolution. An inference rule that from two clauses containing complementary literals derives a resolvent containing the remaining literals; used with refutation, it proves a query by deriving the empty clause from the knowledge base and the negated query.
Conversion to CNF
Steps: (1) eliminate ↔ and → using P → Q ≡ ¬P ∨ Q; (2) move ¬ inward with De Morgan's laws and double negation; (3) standardise variable names; (4) Skolemise (remove ∃ by Skolem constants or functions) in FOL; (5) drop ∀ quantifiers; (6) distribute ∨ over ∧. In FOL, resolution uses unification to match complementary literals, so the substitution is applied to the resolvent. Resolution strategies such as unit preference, set of support and input resolution reduce the search.
Example Proof
KB: P → Q, Q → R, P. Query: R. Convert: (¬P ∨ Q), (¬Q ∨ R), (P). Negate the query: (¬R). Resolve (P) with (¬P ∨ Q) to get (Q); resolve (Q) with (¬Q ∨ R) to get (R); resolve (R) with (¬R) to get the empty clause. So R is entailed.
Table 3.5: Resolution terms
| Term | Meaning | Example |
|---|---|---|
| Clause | Disjunction of literals | ¬P ∨ Q |
| Resolvent | Result of resolving two clauses | From (¬P ∨ Q), (P) get (Q) |
| Empty clause | Contradiction, written □ | From (R) and (¬R) |
| Refutation | Assume ¬α and derive □ | Proves α |
Example 3.5: Proof by resolution
Problem: Prove R from P → Q, Q → R and P using resolution.
Solution:
- Clauses: 1. ¬P ∨ Q; 2. ¬Q ∨ R; 3. P; 4. ¬R (negated goal).
- Resolve 1 and 3: Q (clause 5).
- Resolve 5 and 2: R (clause 6).
- Resolve 6 and 4: the empty clause.
Result: The empty clause is derived, so KB ∧ ¬R is unsatisfiable and R is entailed.
clauses = [{"~P", "Q"}, {"~Q", "R"}, {"P"}, {"~R"}]
def neg(l):
return l[1:] if l[0] == "~" else "~" + l
def refute(cl):
cl = [frozenset(c) for c in cl]
while True:
new = set()
for a in cl:
for b in cl:
for l in a:
if neg(l) in b:
r = (a | b) - {l, neg(l)}
if not r:
return True
new.add(frozenset(r))
if new <= set(cl):
return False
cl += [c for c in new if c not in cl]
print("empty clause derived:", refute(clauses))
print("without negated goal:", refute(clauses[:3]))
Output
empty clause derived: True
without negated goal: False
Common mistakes
- Forgetting to negate the query before starting the refutation.
- Resolving on two complementary pairs at once, which gives a tautology rather than a valid step.
- Skipping the CNF conversion or distributing ∨ and ∧ in the wrong order.
- Concluding "not entailed" before all resolvents have been tried.
Key takeaways
- Resolvent of (A ∨ L) and (B ∨ ¬L) is (A ∨ B).
- Prove KB ⊨ α by showing KB ∧ ¬α derives the empty clause.
- Resolution is sound and refutation-complete; clauses must be in CNF.
- In FOL, unification finds the matching literals.
Practice questions
- What is the resolvent of (A ∨ B) and (¬B ∨ C)?
- How does proof by refutation work?
- What is CNF?
Answers to the practice questions
- A ∨ C.
- Add the negated query to the KB and derive the empty clause.
- A conjunction of clauses, each a disjunction of literals.
Sources
- Official BCA syllabus Artificial Intelligence, course code 26BCA404DS04, Unit III
