Skip to content
Related Articles

Related Articles

Resolution Algorithm in Artificial Intelligence

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 27 May, 2022


Inference algorithms based on resolution work utilize the proof-by-contradiction. To establish that is K B \models \alpha       unsatisfiable, we show that (K B \wedge \neg \alpha)       is unsatisfiable. We do this by demonstrating a contradiction.

\begin{aligned} &\text { function PL-RESOLUTION }(K B, \alpha) \text { returns } t \text { rue or false } \\ &\text { inputs: } K B, \text { the knowledge base, a sentence in propositional logic } \\ &\qquad \alpha, \text { the query, a sentence in propositional logic } \\ &\text { clauses } \leftarrow \text { the set of clauses in the CNF representation of } K B \wedge \neg \alpha \\ &\text { new } \leftarrow\{\} \\ &\text { loop do } \\ &\text { for each pair of clauses } C_{i}, C_{j} \text { in clauses do } \\ &\text { resolvents } \leftarrow \text { PL-RESOLVE }\left(C_{i}, C_{j}\right) \\ &\text { if resolvents contains the empty clause then return } t \text { rue } \\ &\text { new } \leftarrow \text { new } \cup \text { resolvents } \\ &\text { if new } \subseteq \text { clauses then return false } \\ &\text { clauses } \leftarrow \text { clauses } \cup \text { new } \end{aligned}

The equations above show a resolution algorithm. To begin, (K B \wedge \neg \alpha)      is transformed to CNF. The resolution rule is then applied to the clauses that result. Each pair of complementary literals is resolved into a new clause, which is added to the set if it does not exist before. The procedure continues until either

  • no more clauses can be added, in which case, KB does not entail
  • two clauses resolve to produce the empty clause, in which case KB entails.

Because a disjunction is true only if at least one of its disjunctions is true, the empty clause—a disjunction with no disjunctions—is identical to False. Another approach to recognize that an empty sentence is a contradiction is to notice that it only appears when two complementary unit clauses, such as P      and \neg P     , are resolved.

In the wumpus universe, we may use the resolution technique to solve a very easy inference. There is no breeze when the agent is in [1,1], hence no pits may form in nearby squares. K B=R_{2} \wedge R_{4}=\left(B_{1,1} \Leftrightarrow\left(P_{1,2} \vee P_{2,1}\right)\right) \wedge \neg B_{1,1}      is the appropriate knowledge base, and we want to verify \alpha      which is, say, P_{1,2}     . The clauses presented in the above figure are obtained by converting (K B \wedge \neg \alpha)      into CNF. Clauses derived by resolving couples in the first row are shown in the second row of the picture. The empty clause, depicted as a little square, is obtained when P_{1,2}      is resolved with \neg P_{1,2}     . The figure above illustrates that many of the resolution stages are unnecessary. For example, the phrase B_{1,1} \vee \neg B_{1,1} \vee P_{1,2}      is identical to \text { True } \vee P_{1,2}      which is equivalent to True     . It’s not particularly useful to deduce that True      is true. As a result, any phrase containing two complementing literals can be removed.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!