IT8601 Resolution 1 - SNS Courseware

26
IT8601 Resolution 1

Transcript of IT8601 Resolution 1 - SNS Courseware

IT8601 Resolution 1

Resolution

•  Resolution is a single inference rule, that yields a complete inference algorithm when coupled with any complete search algorithm.

•  Resolution makes use of the inference rules.

•  It proceeds by building refutation proofs, i.e., proofs by contradictions.

•  One can perform Resolution from a Knowledge Base.

•  A Knowledge Base is a collection of facts or one can even call it a database with all facts.

•  Resolution was invented in the year 1965 by a Mathematician called Alan Robinson.

IT8601 Resolution 2

Resolution

•  Resolution efficiently operates on the conjunctive normal form(CNF) or clausal form.

•  Every sentence of first-order logic can be converted into an inferentially equivalent CNF sentence.

•  CNF is a sentence represented as a conjunction of one or more clauses, where a clause(unit clause) is a disjunction of literals(an atomic sentence) otherwise put, it is an AND of ORs.

IT8601 Resolution 3

CNF Example

IT8601 Resolution 4

Variables A, B, C, D, E, and F are in conjunctive normal form:

The resolution inference rule

•  Resolution can resolve two clauses if they contain complementary literals, which are assumed to be standardized apart so that they share no variables.

•  where li and mj are complementary literals. •  This rule is also called the binary resolution rule because

it only resolves exactly two literals.

IT8601 Resolution 5

The resolution inference rule: Example

We can resolve two clauses which are given below: [Animal (g(x) V Loves (f(x), x)] and [¬ Loves(a, b) V ¬Kills(a, b)]

where two complimentary literals are:

Loves (f(x), x) and ¬ Loves (a, b) These literals can be unified with unifier θ= [a/f(x), and b/x] , and it will generate a resolvent clause:

[Animal (g(x) V ¬ Kills(f(x), x)]

IT8601 Resolution 6

Steps for Resolution

•  Conversion of facts into Propositional/first-order logic. •  Convert FOL/Propositional statements into CNF •  Negate the statement which needs to prove (proof by

contradiction) •  Draw resolution graph (unification).

To better understand all the above steps, consider an example in which we will apply resolution.

IT8601 Resolution 7

Steps to Convert to CNF (Conjunctive Normal Form)

1.  Eliminate implication ‘→’ a → b = ~a v b

2.  Eliminate Existential Quantifier ‘∃’ 3.  Eliminate Universal Quantifier ‘∀’ 4.  Eliminate AND ‘^’

–  a ^ b splits the entire clause into two separate clauses i.e. a and b –  (a v b) ^ c splits the entire clause into two separate clauses a v b

and c –  (a ^ b) v c splits the clause into two clauses i.e. a v c and b v c

IT8601 Resolution 8

Example

a)  John likes all kind of food b)  Apple and vegetable are food c)  Anything anyone eats and not killed is food d)  Anil eats peanuts and still alive e)  Harry eats everything that Anil eats Prove by resolution that

John likes peanuts

IT8601 Resolution 9

Step-1: Conversion of Facts into FOL

•  Convert all the given statements into its first order logic.

IT8601 Resolution 10

Conclusion:

Step-2: Conversion of FOL into CNF

In First order logic resolution, it is required to convert the FOL into CNF as CNF form makes easier for resolution proofs. •  Eliminate all implication (→) and rewrite

a)  ∀x ¬ food(x) V likes(John, x) b)  food(Apple) Λ food(vegetables) c)  ∀x ∀y ¬ [eats(x, y) Λ ¬ killed(x)] V food(y) d)  eats (Anil, Peanuts) Λ alive(Anil) e)  ∀x ¬ eats(Anil, x) V eats(Harry, x) f)  ∀x¬ [¬ killed(x) ] V alive(x) g)  ∀x ¬ alive(x) V ¬ killed(x) Conclusion: likes(John, Peanuts).

IT8601 Resolution 11

Step-2: Conversion of FOL into CNF

•  Move negation (¬)inwards a.  ∀x ¬ food(x) V likes(John, x) b.  food(Apple) Λ food(vegetables) c.  ∀x ∀y ¬ eats(x, y) V killed(x) V food(y) d.  eats (Anil, Peanuts) Λ alive(Anil) e.  ∀x ¬ eats(Anil, x) V eats(Harry, x) f.  ∀x killed(x) V alive(x) g.  ∀x ¬ alive(x) V ¬ killed(x) Conclusion: likes(John, Peanuts).

IT8601 Resolution 12

Step-2: Conversion of FOL into CNF

Rename variables or standardize variables For sentences like (∃ x P (x)) ∨ (∃ x Q(x)) which use the same variable name twice, change the name of one of the variables like (∃ x P (x)) ∨ (∃ yQ(y)). This avoids confusion later when we drop the quantifiers.

a.  ∀x ¬ food(x) V likes(John, x) b.  food(Apple) Λ food(vegetables) c.  ∀y ∀z ¬ eats(y, z) V killed(y) V food(z) d.  eats (Anil, Peanuts) Λ alive(Anil) e.  ∀w¬ eats(Anil, w) V eats(Harry, w) f.  ∀g killed(g) V alive(g) g.  ∀k ¬ alive(k) V ¬ killed(k) Conclusion: likes(John, Peanuts).

• 

IT8601 Resolution 13

Step-2: Conversion of FOL into CNF

•  Skolemize: Skolemization is the process of removing existential instantiation quantifier by elimination. In this step, eliminate existential quantifier ∃, but this example problem since there is no existential quantifier so all the statements will remain same in this step.

IT8601 Resolution 14

Step-2: Conversion of FOL into CNF

•  Drop Universal quantifiers. In this step, drop all universal quantifier since all the statements are not implicitly quantified so we don't need it. a.  ¬ food(x) V likes(John, x) b.  food(Apple) c.  food(vegetables) d.  ¬ eats(y, z) V killed(y) V food(z) e.  eats (Anil, Peanuts) f.  alive(Anil) g.  ¬ eats(Anil, w) V eats(Harry, w) h.  killed(g) V alive(g) i.  ¬ alive(k) V ¬ killed(k) Conclusion: likes(John, Peanuts).

IT8601 Resolution 15

Step-2: Conversion of FOL into CNF

•  Distribute conjunction ∧ over disjunction V This step will not make any change in this problem. Example: •  Replace PV(QΛR) with (PVQ) Λ (PVR)

IT8601 Resolution 16

Step-3: Negate the conclusion

Apply negation to the conclusion statements, which will be written as

¬likes(John, Peanuts)

IT8601 Resolution 17

Step-4: Draw Resolution graph •  Now in this step, we will solve the problem by resolution tree using

substitution. For the above problem, it will be given as follows:

IT8601 Resolution 18

Step-4: Draw Resolution graph

•  Hence we see that the negation of the conclusion has been proved as a complete contradiction with the given set of facts.

•  Hence the negation is completely invalid or false or the assertion is completely valid or true.

IT8601 Resolution 19

IT8601 Resolution 20

Resolution strategies

IT8601 Resolution 21

Resolution strategies

IT8601 Resolution 22

Uses of Resolution in Today’s World

•  Helps in the development of computer programs to automate reasoning and theorem proving

•  Used widely in AI. •  Helps in Forward and Backward Reasoning •  Resolution is a proof by contradiction which is even used

in Math problems.

IT8601 Resolution 23

MCQ 1.  Which is also called single inference rule? a.  Reference b. Resolution c. Reform d. None of the mentioned 2. Which form is called as conjunction of disjunction of literals? a. Conjunctive normal form b. Disjunctive normal form c. Normal form d. All of the mentioned

IT8601 Resolution 24

MCQ 3. What can be viewed as a single literal of disjunction? a. Multiple clause b. Combine clause c. Unit clause d. None of the mentioned 4. Inference algorithm is complete only if a. It can derive any sentence b. It can derive any sentence that is an entailed version c. It is truth preserving d. Both b & c

IT8601 Resolution 25

Source of Information

•  Textbook •  https://en.wikipedia.org/wiki/Conjunctive_normal_form •  https://cs.nyu.edu/courses/summer07/G22.2340-001/

Presentations/AnkitShah •  https://www.javatpoint.com/ai-resolution-in-first-order-

logic

IT8601 Resolution 26