Artificial Intelligence · Knowledge Representation
Logic Resolution and Unification
Overview
Resolution is a single, sound and refutation‑complete inference rule for propositional and first‑order logic.
Unification is the matching procedure that makes resolution work in first‑order logic by finding substitutions that make two literals identical.
These two ideas underpin automated theorem proving, logic programming (Prolog uses SLD resolution and unification), and knowledge‑based systems that reason with Horn clauses.
The topic sits in the Knowledge Representation chapter of AI, after propositional logic, first‑order logic, and clause form.
Before studying it, you should know the syntax of first‑order logic (predicates, functions, variables, quantifiers), the meaning of entailment, and the basic equivalences (implication elimination, De Morgan’s laws).
Key concepts
- Literal: an atomic proposition or its negation. A clause is a disjunction of literals.
- Empty clause (□): a clause with no literals; it represents contradiction (false).
- Resolution rule (propositional): from clauses and infer . The literal and its negation cancel.
- Resolution rule (first‑order): from clauses and that contain complementary literals and , if a substitution is the most general unifier (MGU) of and , infer the resolvent .
- Substitution: a finite set where each is a variable and is a term. Applying it replaces variables by terms simultaneously.
- Unification: finding a substitution that makes two expressions (terms, atoms, or literals) syntactically identical.
A unifier is such a substitution; the most general unifier (MGU) is the unifier that imposes the fewest constraints (all other unifiers are instances of it). - Occurs check: during unification, when trying to bind variable to term , if occurs inside , the unification fails. Without it, infinite terms arise.
- Horn clause: a clause with at most one positive literal. Definite clause: exactly one positive literal, written as or . Goal clause: no positive literals, e.g., .
- Skolemization: eliminating existential quantifiers by introducing Skolem constants (if no universal quantifier precedes) or Skolem functions (if universal quantifiers precede).
It preserves satisfiability, not logical equivalence. - Resolution refutation: to prove , show that is unsatisfiable by deriving the empty clause.
- Modus Ponens (MP): from and , infer . Modus Tollens (MT): from and , infer .
- Forward chaining and backward chaining are natural inference algorithms for Horn clauses; they are sound and complete for definite clauses.
- Prolog uses SLD resolution (a form of linear resolution) with unification; its semantic foundation is first‑order predicate calculus.
How it works
Resolution refutation procedure (first‑order)
- Convert all sentences of the knowledge base to clause form (see below).
- Negate the goal and add the resulting clauses to the knowledge base.
- Repeat until the empty clause is found or no new clauses can be added:
- Select two clauses that contain complementary literals.
- Unify the complementary literals to obtain the MGU .
- Form the resolvent by applying to both clauses and removing the complementary literals.
- Add the resolvent to the clause set.
- If the empty clause is derived, the original knowledge base entails .
Conversion to clause form (standard steps)
- Eliminate implications: .
- Move negations inward using De Morgan’s laws and double negation.
- Standardize variables apart (rename so each quantifier uses a distinct variable).
- Move quantifiers to the front (prenex normal form).
- Skolemize: eliminate existential quantifiers.
- If is not inside the scope of any universal quantifier, replace by a new Skolem constant.
- If is inside the scope of universal quantifiers , replace by a new Skolem function .
- Drop universal quantifiers (all remaining variables are universally quantified).
- Distribute over to obtain a conjunction of disjunctions.
- Split into separate clauses.
- Rename variables if necessary so that no two clauses share a variable.
Unification algorithm (informal)
Given two atoms (or terms) and :
- If both are identical constants or variables, they already match.
- If one is a variable and the other is a term :
- If occurs in (occurs check), fail.
- Otherwise add to the substitution.
- If both are compound terms with the same function/predicate symbol and same arity, recursively unify their arguments.
- If symbols differ or arities differ, fail.
- The result is the MGU if the algorithm succeeds.
Resolution with Horn clauses
- A definite clause is written .
- Forward chaining starts from known facts and applies rules to derive new facts.
- Backward chaining starts from the goal and works backward through rules to find supporting facts.
- Both are efficient and complete for definite Horn clauses.
Drawing the diagram…
Formulas
- Resolution (propositional):
- Resolution (first‑order): where .
- Substitution composition: if and , then applies then .
- MGU condition: for any unifier of expressions and , there exists a substitution such that .
- Horn clause: at most one positive literal. Definite clause: exactly one positive literal.
- Skolemization: becomes (new constant ). becomes (new function ).
- Entailment: iff is unsatisfiable.
- Modus Ponens: . Modus Tollens: .
Worked examples
Example 1 (Unification, easy). Find the MGU of and .
- Match arguments: with → .
- with → unify with → add .
- with → already .
- No occurs check violation. MGU is .
Example 2 (Resolution, medium). Resolve and on .
- Complementary literals: and .
- MGU is empty (propositional case).
- Resolvent: .
Example 3 (Resolution refutation, hard). Prove from:
- Clause form of (2): .
- Negate goal: .
- Resolve (1) and (2) with : .
- Resolve with negated goal: empty clause. Therefore entailment holds.
Example 4 (Skolemization, hard). Convert to clause form.
- Eliminate implication: .
- Move quantifiers: .
- Skolemize : no preceding universals → new constant .
- Skolemize : preceded by → new function .
- Result: .
- Drop universals and write as clause: .
Example 5 (Match logical forms to clauses, medium).
| Logical form | Clause form |
|---|---|
Comparison
| Concept | Definition | Key property |
|---|---|---|
| Unification | Finding a substitution that makes two expressions identical | Produces MGU; occurs check prevents infinite terms |
| Substitution | Mapping of variables to terms | Applied to expressions to instantiate them |
| Resolution | Inference rule that cancels complementary literals | Refutation‑complete; requires clause form |
| Skolemization | Replacing existentially quantified variables with constants/functions | Preserves satisfiability, not equivalence |
| Modus Ponens | From and infer | Forward reasoning |
| Modus Tollens | From and infer | Backward reasoning |
| Horn clause type | Positive literals | Form | Use |
|---|---|---|---|
| Definite clause | Exactly one | Forward/backward chaining | |
| Goal clause | Zero | Query in Prolog | |
| Horn clause (general) | At most one | e.g., | Resolution |
| Propositional resolution | First‑order resolution |
|---|---|
| No variables, no unification | Uses unification and MGU |
| Literals are propositions | Literals are predicates with terms |
| Decidable | Semi‑decidable (refutation‑complete) |
Revision summary
- Horn clause: at most one positive literal. Definite clause: exactly one positive literal.
- Resolution proves entailment by refutation: add negated goal, derive empty clause.
- MGU is the most general unifier; apply occurs check to avoid infinite terms.
- Skolem constant for existential not under universal; Skolem function when under universals.
- Modus Ponens = ; Modus Tollens = .
Do not swap names. - Prolog uses SLD resolution and unification; its foundation is first‑order predicate calculus.
- Forward chaining is data‑driven; backward chaining is goal‑driven.
- Resolution is sound and refutation‑complete; it is not a decision procedure for all FOL.
- Propositional logic does not scale to unbounded environments; first‑order logic handles objects and relations.
- For resolution, clauses must be in clause form (conjunction of disjunctions).
- Empty clause represents contradiction; deriving it means the negated goal is inconsistent with KB.
Previous-year exam insights
- Questions often test direct definitions: Horn clause (at most one positive literal), definite clause, MGU, Skolemization.
- Resolution problems ask for the resolvent of two clauses; check complementary literals and apply MGU correctly.
- Unification problems give two atoms and ask for MGU; always perform occurs check and match symbols/arity.
- Statement‑type questions compare Modus Ponens vs Modus Tollens and their names; the names are frequently swapped in wrong options.
- Skolemization questions show a formula and its transformed version; identify the process as Skolemization, not simplification or unification.
- Horn clause properties: the resolvent of two Horn clauses is a Horn clause (key property).
- Resolution refutation order: negate goal, add to KB, convert to clauses, resolve until empty clause.
- Trap: thinking resolution is complete for all first‑order logic; it is refutation‑complete.
Also, without occurs check, unification can produce infinite terms.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- Write the resolution rule for propositional and first‑order logic and explain the role of the MGU.
- Given two atoms, compute their MGU step by step and state whether the occurs check fails.
- Convert a first‑order sentence to clause form, including correct Skolemization.
- Prove a simple entailment using resolution refutation and show every resolvent.
- Identify whether a clause is a Horn clause, definite clause, or goal clause.
- Distinguish Modus Ponens from Modus Tollens by their premises and conclusions.
- Explain forward chaining and backward chaining for Horn clauses.
- Describe the steps of the unification algorithm and why the occurs check is necessary.
- Match logical forms to their equivalent clause representations.
- Explain why Prolog’s inference is based on resolution and unification.
Attempt the sub-topic test first, then the subject test.