{"id":2294,"date":"2022-04-16T19:11:30","date_gmt":"2022-04-16T19:11:30","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=2294"},"modified":"2022-04-16T19:11:30","modified_gmt":"2022-04-16T19:11:30","slug":"resolution-in-fol","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/04\/16\/resolution-in-fol\/","title":{"rendered":"Resolution in FOL"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Resolution<\/h2>\n\n\n\n<p>Resolution is a theorem proving technique that proceeds by building refutation proofs, i.e., proofs by contradictions. It was invented by a Mathematician John Alan Robinson in the year 1965.<\/p>\n\n\n\n<p>Resolution is used, if there are various statements are given, and we need to prove a conclusion of those statements. Unification is a key concept in proofs by resolutions. Resolution is a single inference rule which can efficiently operate on the&nbsp;<strong>conjunctive normal form or clausal form<\/strong>.<\/p>\n\n\n\n<p><strong>Clause<\/strong>: Disjunction of literals (an atomic sentence) is called a&nbsp;<strong>clause<\/strong>. It is also known as a unit clause.<\/p>\n\n\n\n<p><strong>Conjunctive Normal Form<\/strong>: A sentence represented as a conjunction of clauses is said to be&nbsp;<strong>conjunctive normal form<\/strong>&nbsp;or&nbsp;<strong>CNF<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Note: To better understand this topic, firstly learns the FOL in AI.<\/h4>\n\n\n\n<h2 class=\"wp-block-heading\">The resolution inference rule:<\/h2>\n\n\n\n<p>The resolution rule for first-order logic is simply a lifted version of the propositional rule. Resolution can resolve two clauses if they contain complementary literals, which are assumed to be standardized apart so that they share no variables.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/static.javatpoint.com\/tutorial\/ai\/images\/ai-resolution-in-first-order-logic.png\" alt=\"Resolution in FOL\"\/><\/figure>\n\n\n\n<p>Where&nbsp;<strong>l<sub>i<\/sub><\/strong>&nbsp;and&nbsp;<strong>m<sub>j<\/sub><\/strong>&nbsp;are complementary literals.<\/p>\n\n\n\n<p>This rule is also called the&nbsp;<strong>binary resolution rule<\/strong>&nbsp;because it only resolves exactly two literals.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example:<\/h3>\n\n\n\n<p>We can resolve two clauses which are given below:<\/p>\n\n\n\n<p><strong>[Animal (g(x) V Loves (f(x), x)] &nbsp; &nbsp; &nbsp; and &nbsp; &nbsp; &nbsp; [\uffe2 Loves(a, b) V \uffe2Kills(a, b)]<\/strong><\/p>\n\n\n\n<p>Where two complimentary literals are:&nbsp;<strong>Loves (f(x), x) and \uffe2 Loves (a, b)<\/strong><\/p>\n\n\n\n<p>These literals can be unified with unifier&nbsp;<strong>\u03b8= [a\/f(x), and b\/x]&nbsp;<\/strong>, and it will generate a resolvent clause:<\/p>\n\n\n\n<p><strong>[Animal (g(x) V \uffe2 Kills(f(x), x)].<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps for Resolution:<\/h2>\n\n\n\n<ol><li>Conversion of facts into first-order logic.<\/li><li>Convert FOL statements into CNF<\/li><li>Negate the statement which needs to prove (proof by contradiction)<\/li><li>Draw resolution graph (unification).<\/li><\/ol>\n\n\n\n<p>To better understand all the above steps, we will take an example in which we will apply resolution.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example:<\/h3>\n\n\n\n<ol><li><strong>John likes all kind of food.<\/strong><\/li><li><strong>Apple and vegetable are food<\/strong><\/li><li><strong>Anything anyone eats and not killed is food.<\/strong><\/li><li><strong>Anil eats peanuts and still alive<\/strong><\/li><li><strong>Harry eats everything that Anil eats.<\/strong><br><strong>Prove by resolution that:<\/strong><\/li><li><strong>John likes peanuts.<\/strong><\/li><\/ol>\n\n\n\n<p><strong>Step-1: Conversion of Facts into FOL<\/strong><\/p>\n\n\n\n<p>In the first step we will convert all the given statements into its first order logic.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/static.javatpoint.com\/tutorial\/ai\/images\/ai-resolution-in-first-order-logic2.png\" alt=\"Resolution in FOL\"\/><\/figure>\n\n\n\n<p><strong>Step-2: Conversion of FOL into CNF<\/strong><\/p>\n\n\n\n<p>In First order logic resolution, it is required to convert the FOL into CNF as CNF form makes easier for resolution proofs.<\/p>\n\n\n\n<ul><li><strong>Eliminate all implication (\u2192) and rewrite<\/strong><ol><li>\u2200x \u00ac food(x) V likes(John, x)<\/li><li>food(Apple) \u039b food(vegetables)<\/li><li>\u2200x \u2200y \u00ac [eats(x, y) \u039b \u00ac killed(x)] V food(y)<\/li><li>eats (Anil, Peanuts) \u039b alive(Anil)<\/li><li>\u2200x \u00ac eats(Anil, x) V eats(Harry, x)<\/li><li>\u2200x\u00ac [\u00ac killed(x) ] V alive(x)<\/li><li>\u2200x \u00ac alive(x) V \u00ac killed(x)<\/li><li>likes(John, Peanuts).<\/li><\/ol><\/li><li><strong>Move negation (\u00ac)inwards and rewrite<\/strong><ol><li>\u2200x \u00ac food(x) V likes(John, x)<\/li><li>food(Apple) \u039b food(vegetables)<\/li><li>\u2200x \u2200y \u00ac eats(x, y) V killed(x) V food(y)<\/li><li>eats (Anil, Peanuts) \u039b alive(Anil)<\/li><li>\u2200x \u00ac eats(Anil, x) V eats(Harry, x)<\/li><li>\u2200x \u00ackilled(x) ] V alive(x)<\/li><li>\u2200x \u00ac alive(x) V \u00ac killed(x)<\/li><li>likes(John, Peanuts).<\/li><\/ol><\/li><li><strong>Rename variables or standardize variables<\/strong><ol><li>\u2200x \u00ac food(x) V likes(John, x)<\/li><li>food(Apple) \u039b food(vegetables)<\/li><li>\u2200y \u2200z \u00ac eats(y, z) V killed(y) V food(z)<\/li><li>eats (Anil, Peanuts) \u039b alive(Anil)<\/li><li>\u2200w\u00ac eats(Anil, w) V eats(Harry, w)<\/li><li>\u2200g \u00ackilled(g) ] V alive(g)<\/li><li>\u2200k \u00ac alive(k) V \u00ac killed(k)<\/li><li>likes(John, Peanuts).<\/li><\/ol><\/li><li><strong>Eliminate existential instantiation quantifier by elimination.<\/strong><br>In this step, we will eliminate existential quantifier \u2203, and this process is known as&nbsp;<strong>Skolemization<\/strong>. But in this example problem since there is no existential quantifier so all the statements will remain same in this step.<\/li><li><strong>Drop Universal quantifiers.<\/strong><br>In this step we will drop all universal quantifier since all the statements are not implicitly quantified so we don&#8217;t need it.<ol><li>\u00ac food(x) V likes(John, x)<\/li><li>food(Apple)<\/li><li>food(vegetables)<\/li><li>\u00ac eats(y, z) V killed(y) V food(z)<\/li><li>eats (Anil, Peanuts)<\/li><li>alive(Anil)<\/li><li>\u00ac eats(Anil, w) V eats(Harry, w)<\/li><li>killed(g) V alive(g)<\/li><li>\u00ac alive(k) V \u00ac killed(k)<\/li><li>likes(John, Peanuts).<\/li><\/ol><\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Note: Statements &#8220;food(Apple) \u039b food(vegetables)&#8221; and &#8220;eats (Anil, Peanuts) \u039b alive(Anil)&#8221; can be written in two separate statements.<\/h4>\n\n\n\n<ul><li><strong>Distribute conjunction \u2227 over disjunction \u00ac.<\/strong><br>This step will not make any change in this problem.<\/li><\/ul>\n\n\n\n<p><strong>Step-3: Negate the statement to be proved<\/strong><\/p>\n\n\n\n<p>In this statement, we will apply negation to the conclusion statements, which will be written as \u00aclikes(John, Peanuts)<\/p>\n\n\n\n<p><strong>Step-4: Draw Resolution graph:<\/strong><\/p>\n\n\n\n<p>Now in this step, we will solve the problem by resolution tree using substitution. For the above problem, it will be given as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/static.javatpoint.com\/tutorial\/ai\/images\/ai-resolution-in-first-order-logic3.png\" alt=\"Resolution in FOL\"\/><\/figure>\n\n\n\n<p>Hence the negation of the conclusion has been proved as a complete contradiction with the given set of statements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Explanation of Resolution graph:<\/h2>\n\n\n\n<ul><li>In the first step of resolution graph,&nbsp;<strong>\u00aclikes(John, Peanuts)&nbsp;<\/strong>, and&nbsp;<strong>likes(John, x)&nbsp;<\/strong>get resolved(canceled) by substitution of&nbsp;<strong>{Peanuts\/x}<\/strong>, and we are left with&nbsp;<strong>\u00ac food(Peanuts)<\/strong><\/li><li>In the second step of the resolution graph,&nbsp;<strong>\u00ac food(Peanuts)&nbsp;<\/strong>, and&nbsp;<strong>food(z)&nbsp;<\/strong>get resolved (canceled) by substitution of&nbsp;<strong>{ Peanuts\/z}<\/strong>, and we are left with&nbsp;<strong>\u00ac eats(y, Peanuts) V killed(y)&nbsp;<\/strong>.<\/li><li>In the third step of the resolution graph,&nbsp;<strong>\u00ac eats(y, Peanuts)&nbsp;<\/strong>and&nbsp;<strong>eats (Anil, Peanuts)&nbsp;<\/strong>get resolved by substitution&nbsp;<strong>{Anil\/y}<\/strong>, and we are left with&nbsp;<strong>Killed(Anil)&nbsp;<\/strong>.<\/li><li>In the fourth step of the resolution graph,&nbsp;<strong>Killed(Anil)&nbsp;<\/strong>and&nbsp;<strong>\u00ac killed(k)&nbsp;<\/strong>get resolve by substitution&nbsp;<strong>{Anil\/k}<\/strong>, and we are left with&nbsp;<strong>\u00ac alive(Anil)&nbsp;<\/strong>.<\/li><li>In the last step of the resolution graph&nbsp;<strong>\u00ac alive(Anil)&nbsp;<\/strong>and&nbsp;<strong>alive(Anil)&nbsp;<\/strong>get resolved.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Resolution Resolution is a theorem proving technique that proceeds by building refutation proofs, i.e., proofs by contradictions. It was invented by a Mathematician John Alan Robinson in the year 1965. Resolution is used, if there are various statements are given, and we need to prove a conclusion of those statements. Unification is a key concept [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[885],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2294"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=2294"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2294\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=2294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=2294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=2294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}