How does a Resolution algorithm work for propositional logic?
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.
Resolution is a powerful and commonly used method for automated theorem proving in propositional logic. It serves as the basis for many advanced techniques in artificial intelligence and computer-aided verification. This article delves into the resolution algorithm, explaining its inner workings, essential concepts, and providing illustrative examples.
Introduction to Propositional Logic
Propositional logic is a branch of logic dealing with formulae composed of propositions and logical connectives. A proposition is a statement that can be either true or false, but not both. The logical connectives typically used are:
- AND ()
- OR ()
- NOT ()
- IMPLIES ()
- IF AND ONLY IF ()
The primary goal in propositional logic is to determine the logical validity of certain propositions. Given a set of propositions (premises), one must ascertain whether a particular conclusion follows.
The Resolution Rule
The resolution rule in propositional logic is a single inference rule used to derive conclusions from known implications. The rule applies to disjunctions of literals, and it can be stated as follows: from two clauses and , one can infer the clause .
This rule exploits the law of excluded middle, assuming is either true or false. If is true, then the second clause is satisfied by . Conversely, if is false, then the first clause is satisfied by .
Preconditions for Resolution
- Conjunctive Normal Form (CNF): The resolution rule requires the formulae to be in Conjunctive Normal Form, where each formula is a conjunction of disjunctions of literals. For instance, is an example of a CNF expression.
- Pair of Clauses: The resolution operates on two clauses that contain complementary literals. These literals are negations of each other, such as and .
The Resolution Process
- Convert to CNF: Begin by converting all the given propositions to CNF. This involves the application of logical equivalences such as De Morgan's laws and distribution of disjunctions over conjunctions.
- Apply Resolution Rule: For each pair of clauses containing complementary literals, apply the resolution rule to derive a new clause. This step involves removing the complementary literals and combining the remaining literals.
- Iterate: Repeat the resolution step with the newly formed clauses along with existing clauses.
- Check for Contradiction: If you derive an empty clause, represented by , a contradiction is found, and the original set of formulae is unsatisfiable—indicating that the negation of the conclusion is false, proving the conclusion.
- Termination: If no new clauses can be generated without deriving an empty clause, and if the conclusion cannot be proven directly, the process terminates, suggesting that the conclusion does not logically follow.
Example: Resolution in Action
Consider the following set of premises and conclusion:
- Premises: , , .
- Conclusion: .
Step-by-Step Resolution
- Convert to CNF: The premises are already in CNF.
- Identify Pairs and Resolve:
- From and , resolve on :
- From and , resolve on :
- From logically simplify to (a tautology), but continue for resolution purposes.
- Check for Empty Clause: There is no direct derivation of the empty clause in this example without additional information or different clauses that lead to . Conversely, reaching implies consistency without contradiction in this context.
Understanding Completeness and Soundness
The resolution method is both complete and sound:
- Soundness: If the resolution method derives a conclusion, it is guaranteed to be logically valid.
- Completeness: If a conclusion is valid, the resolution method will be able to derive it given enough resources.
Summary Table
| Concept | Description |
| Resolution Rule | Inference rule for deriving conclusions from clauses. |
| CNF Transformation | Required form, a conjunction of disjunctions. |
| Complementary Literals | Pairs of literals that are negations of each other. |
| Resolution Process | Iterative application of rule on pairs of clauses. |
| Soundness | Derived conclusions are valid. |
| Completeness | All valid conclusions can be derived. |
| Example Conclusion | Illustration of deriving logical outcomes using resolution. |
Conclusion
Resolution is an essential algorithm in automated reasoning for propositional logic. By converting formulae to CNF and applying the resolution rule, one can methodically derive conclusions or establish the inconsistency of a set of propositions. Understanding resolution's intricacies equips one with a fundamental tool for tackling logical propositions in fields such as computer science, mathematics, and philosophy.
Related reading
- How does a sorting network beat generic sorting algorithms?
- How does Amazon's Statistically Improbable Phrases work?
- How does Array.sort behave if comparison function is not transitive?
- How does bubble sort compare to selection sort?
- How does Dijkstra's Algorithm and A-Star compare?
- How does Dijkstra's self-stabilizing algorithm work?
- How does Elasticsearch recover from a quorum that is not unanimous
- How does finding a cycle start node in a cycle linked list work?

DSA Fundamentals
Master algorithmic patterns and data structures through hands-on LeetCode-style problems - from arrays and hashing to dynamic programming and advanced graphs.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.