Logic and Planning/First-Order Resolution

Lesson 3.62,213 words

First-Order Resolution

Chaining is complete only for Horn knowledge bases. General first-order sentences — with disjunctive conclusions and negations — need a single sound and complete rule: resolution.

╌╌╌╌

This builds on Inference in First-Order Logic, which lifted propositional inference to first order through unification and built the forward- and backward-chaining algorithms for Horn knowledge bases. Here we drop the Horn restriction and give a single complete rule for all of first-order logic.

Resolution

Chaining is complete only for definite clauses — Horn knowledge bases. General first-order sentences, with disjunctive conclusions and negations, need a single sound and complete rule: resolution.1 It proves by refutation — showing unsatisfiable — and it operates on sentences in conjunctive normal form.

Conversion to CNF

Every first-order sentence has an inferentially equivalent conjunctive normal form (CNF): a conjunction of clauses, each a disjunction of literals, with variables understood as universally quantified. The rule becomes the single clause

The conversion is mechanical but has one first-order-specific step. Consider

everyone who loves all animals is loved by someone,

We eliminate implications ( becomes ); push negations inward, using and ; and standardize apart any reused quantifier variables. The remaining step has no propositional analogue.

Naively replacing the two existentials with constants and would assert that everyone fails to love one particular animal or is loved by one particular entity — the wrong meaning. Because the object depends on , the Skolem entity must too, giving Skolem functions and :

Now every remaining variable is universal, so we drop the quantifiers, distribute over , and read off the clauses. Skolemization is the general form of the existential-instantiation trick from the start of the lesson; the Skolemized sentence is satisfiable exactly when the original is, which is all refutation needs.

Run all six stages on that sentence in full, so no step is left implicit. The starting point is

  1. Eliminate implications. Rewrite each as , both the outer one and the inner one:
  2. Move negation inward. Push the leading through the universal, turning into and negating the disjunction under it with De Morgan, so becomes :
  3. Standardize apart. The two quantifiers bind unrelated variables reusing the name ; rename the second to so no later step confuses them:
  4. Skolemize. Both existentials lie inside , so the witnesses depend on . Replace by the Skolem function and by , and drop the existentials:
  5. Drop universal quantifiers. Only remains, and every free variable is now understood as universally quantified, so erase it:
  6. Distribute over . The final form is a conjunction of clauses. Distributing the trailing disjunct across the conjunction splits the sentence into two clauses:

Those two clauses are the input resolution will use later. Nothing in the sequence changed the sentence's satisfiability, and only stage 4 has no propositional counterpart.

The CNF pipeline for first-order sentences. Every stage is mechanical; only skolemization is new — it replaces an existential with a Skolem function of the enclosing universals, so the witness can depend on them, then the bare universals are dropped.

The resolution rule

The first-order resolution rule is the lifted version of propositional resolution. Two clauses standardized apart can be resolved if one has a literal that unifies with the negation of a literal in the other; the resolvent is the union of the remaining literals with the unifier applied.

For instance, and resolve on the complementary and under , producing . Binary resolution alone is not quite complete; it must be paired with factoring, which collapses two literals in a clause to one when they are unifiable. The two together are complete.

Refutation

To prove , add to the knowledge base, convert everything to clauses, and resolve until the empty clause — a disjunction of no literals, denoting a contradiction — appears. On the crime example, negating the goal to and resolving against the clause forms of produces a proof with a characteristic shape: a single spine, the goal clause resolving against one knowledge-base clause at a time until the empty clause drops out.

The resolution refutation of the crime example. Beginning from the negated goal , each step resolves the current clause on the spine against one KB clause, shrinking it, until the empty clause (box) signals contradiction. This single spine is the mark of resolution on Horn clauses; it mirrors backward chaining's goals exactly.

On Horn knowledge bases the clauses along the spine correspond exactly to the successive goals of backward chaining: backward chaining is resolution with a fixed strategy for choosing the next step. General knowledge bases give bushier proofs.

Curiosity killed the cat, in full

The Curiosity killed the cat puzzle is the standard example of a proof that is not a single spine. In English: everyone who loves all animals is loved by someone; anyone who kills an animal is loved by no one; Jack loves all animals; either Jack or Curiosity killed the cat, who is named Tuna; and Tuna is a cat while all cats are animals. Does Curiosity kill Tuna? Converting every sentence to clauses gives the knowledge base (variables universal, and the Skolem functions from the CNF trace above):2

Clauses A and B come from loves all animals is loved by someone; C from kills an animal, loved by no one; and to refute the query we add its negation, . Now resolve, tracking each resolvent and the unifier that produced it.

  1. Resolve E with the negated goal on , unifier : the two literals are already ground and complementary, leaving .
  2. Resolve that with C on , unifier , giving .
  3. Resolve with D , unifier , discharging the first disjunct and leaving : no one loves Jack.
  4. Resolve with B on against , unifier , giving .
  5. Resolve with F , unifier : the two literals are complementary, and the resolvent is the empty clause.

The empty clause closes the proof, so . The paraphrase reads as ordinary deduction: if Curiosity did not kill Tuna, Jack did (step 1); Tuna is an animal, so whoever killed it is loved by no one, in particular Jack (steps 2–3); but Jack loves all animals, so someone loves Jack (steps 4–5) — a contradiction. Step 4 uses clause B, which skolemization produced, and the general accounting also needs factoring; the version above threads a single lineage for readability.

The resolution refutation of "Curiosity killed the cat." Unlike the Horn spine, this proof branches: the negated goal and several KB clauses (E, C, D, B, F) each feed resolvents, unifiers shown on the edges, down to the empty clause (box). Skolem functions , appear because the source sentences were existentially quantified.

One subtlety: for existential queries like who killed the cat? resolution can return a nonconstructive proof, deriving without committing to a single . Tracking an answer literal through the proof recovers the actual binding.

Completeness

Resolution is refutation-complete: if a set of clauses is unsatisfiable, a finite number of resolution steps derives the empty clause.3 The proof threads three results. Any unsatisfiable clause set has an unsatisfiable finite set of ground instances (Herbrand's theorem); propositional resolution is complete on those ground clauses (the ground resolution theorem); and a lifting lemma shows every ground resolution proof is the shadow of a first-order one, obtained by instantiating the MGU. So the empty clause reachable at the ground level is reachable with the original first-order clauses. Instantiating variables only as far as a proof requires, rather than exhaustively as propositionalization did, is resolution's advantage.

This refutation-completeness is the first-order side of a deep result. In 1930 Gödel proved that first-order logic has a complete proof procedure — every valid sentence is provable — and a refutation-complete resolution system is one way to realize it.

The result is not a promise of decidability — completeness says every entailment has a proof, while semidecidability says we cannot always tell when one is absent. And Gödel's later incompleteness theorem draws the boundary: extend the language with arithmetic and induction, and there are true sentences no proof system can reach. The completeness that resolution enjoys is a property of pure first-order logic, before that extension.

Resolution strategies

Refutation-completeness guarantees a proof exists; it says nothing about how long the search for it takes. Applying resolution to every pair of clauses generates a combinatorial flood of resolvents, most of them useless. A strategy is a rule restricting which pairs to resolve, chosen so the search reaches the empty clause sooner while keeping completeness.4

Two more devices prune rather than direct. Subsumption discards any clause already subsumed by one in the base — if is known, the more specific carries no new information and can be deleted, keeping the clause set free of redundancy. And clauses can be simplified by removing tautologies and duplicated literals before they ever enter the pool.

Four resolution strategies as restrictions on which clause pairs may be resolved. Unit preference and set of support steer the search toward the empty clause; input resolution constrains proof shape; subsumption deletes redundant clauses. Each keeps completeness under the stated conditions.

Handling equality

Resolution as stated treats as one more predicate, which is not enough: from and it will not derive without help, because the two terms never meet a complementary literal to resolve on. One remedy is to add the axioms of equality — reflexivity, symmetry, transitivity, and a substitution axiom for every function and predicate — but these generate large numbers of resolvents. The alternatives build equality reasoning into the inference rule.5

Paramodulation is the more general rule: it resolves on an equation without requiring it to be a separate unit clause, so equality reasoning interleaves with the rest of the proof. Resolution with paramodulation is refutation-complete for first-order logic with equality, and it is the equality machinery inside modern provers.

Modern automated theorem provers

The resolution and unification machinery in this lesson still runs inside the automated reasoning tools used today, though the winning provers refine it well past binary resolution. The dominant calculus is superposition, an ordered combination of resolution and paramodulation that uses term orderings to restrict which inferences are allowed. E, described by Stephan Schulz (2002, in the Journal of the AI Communications), and Vampire, described by Laura Kovács and Andrei Voronkov (2013, in Computer Aided Verification, CAV), are two saturation-based superposition provers built on this calculus; both take a first-order problem, saturate the clause set under the inference rules with the redundancy elimination and indexing sketched above, and search for the empty clause. These systems are compared each year at CASC, the CADE ATP System Competition, organized by Geoff Sutcliffe on the TPTP problem library.^byb-provers

A second line handles logic with background theories. SMT solvers — satisfiability modulo theories — pair a propositional SAT core with dedicated decision procedures for theories like linear arithmetic, arrays, and bit-vectors, so the Boolean search delegates theory-specific facts to a specialist rather than encoding them as clauses. Z3, described by Leonardo de Moura and Nikolaj Bjørner (2008, in Tools and Algorithms for the Construction and Analysis of Systems, TACAS), is one such solver, used widely in program verification and symbolic execution. The division of labor echoes this lesson's split between a general search procedure and specialized handling of equality: SMT generalizes that idea to a whole catalog of theories.

Two descendants of first-order resolution. Left: saturation provers (E, Vampire) run superposition — ordered resolution plus paramodulation — over a clause set toward the empty clause. Right: SMT solvers (Z3) split the work between a SAT core and theory solvers. Both build on the resolution and equality machinery of this lesson.

The heritage runs back through Prolog. The answer-set programming family and modern Datalog engines descend from the logic-programming and resolution tradition, with declarative languages whose execution is inference over Horn-like rules. What began as a proof procedure for pure first-order logic became a set of engines that verify programs, solve constraints, and answer database queries.

Where inference leads

Unification underlies everything here. It turns universal instantiation from an infinite enumeration into a targeted match; it lifts modus ponens into generalized modus ponens, which drives forward and backward chaining and underwrites Prolog; and lifted into the resolution rule, it makes a single complete proof procedure possible. The rest is strategy — data-driven versus goal-driven, Horn-restricted chaining versus general refutation. What all of it computes is entailment: what follows, with certainty, from what is known. The next module turns that capability outward, using logical representation and inference to choose actions rather than merely deduce facts, in classical planning.

Footnotes

  1. Russell & Norvig, AIMA, §9.5.1–9.5.2 — Resolution: CNF for first-order logic, the conversion procedure with skolemization and Skolem functions, the lifted binary resolution rule, and factoring for completeness.
  2. Russell & Norvig, AIMA, §9.5.3, Figure 9.12 — the Curiosity killed the cat refutation using skolemization and factoring, and the nonconstructive-proof issue for existential goals resolved by answer literals.
  3. Russell & Norvig, AIMA, §9.5.4 — Completeness of resolution: refutation-completeness via Herbrand's theorem, the ground resolution theorem, and the lifting lemma; and Gödel's 1930 completeness theorem for first-order logic.
  4. Russell & Norvig, AIMA, §9.5.6 — Resolution strategies: unit preference, set of support with the negated query as initial support, input and linear resolution and their completeness limits, and subsumption for eliminating redundant clauses.
  5. Russell & Norvig, AIMA, §9.5.5 — Equality: the equality axioms, demodulation rewriting a term using a unit equation , and paramodulation as the complete equality-resolution rule for first-order logic with equality.

╌╌ END ╌╌