Skip to content
StackDecode
AI & ML Atlas
Artificial IntelligencealgorithmInteractive simulation

Resolution Algorithm

Proves a statement by showing its negation leads to a contradiction.

The idea

Write everything as clauses (ORs of literals). Two clauses containing opposite literals, P and ¬P, can be combined by removing that pair. To prove a conclusion Q, add ¬Q and keep resolving; if you derive the empty clause (a contradiction), Q must be true. For propositional logic it is sound and complete.

(A ∨ P), (B ∨ ¬P) ⊢ (A ∨ B)

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

1.¬P ∨ Qgiven2.¬Q ∨ Rgiven3.Pgiven4.¬Rgiven
  • given
  • derived
  • being resolved

Goal: prove R. Resolution proves it by contradiction: assume ¬R is true, add it to the knowledge, and look for a contradiction.

clauses:
4
1/4

Empty clause reached: the query follows from the knowledge base.

Step by step

  1. 1Convert the knowledge base and the negated goal into clauses.
  2. 2Pick two clauses with complementary literals.
  3. 3Resolve them into a new clause with those literals removed.
  4. 4Add it to the set and repeat.
  5. 5If the empty clause appears, the goal is proved.

Where it is used

Theorem provers, SAT-related reasoning, logic programming.

Watch out for

The number of clauses can explode, so practical provers use strategies to choose which to resolve.

Related