(using first-order predicate logic)

Slides:



Advertisements
Similar presentations
Artificial Intelligence 8. The Resolution Method
Advertisements

Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
The Foundations: Logic and Proofs
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 10– Club and Circuit Examples.
Standard Logical Equivalences
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: – Constant symbols (i.e., the "individuals"
CPSC 121: Models of Computation Unit 6 Rewriting Predicate Logic Statements Based on slides by Patrice Belleville and Steve Wolfman.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
Resolution
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
AI - Week 16 Logic and Reasoning in AI: Resolution Refutation Lee McCluskey, room 2/07
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Inference and Resolution for Problem Solving
3 Logic Translate the following four English sentences to first order logic (FOL). [4p] 1. Anyone passing his history exams and winning the lottery is.
Inference in First-Order Logic
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Automated Reasoning ARTIFICIAL INTELLIGENCE 6th edition George F Luger
The Semantic Web – WEEK 8: An automatic Proof technique.. The “Layer Cake” Model – [From Rector & Horrocks Semantic Web cuurse] You are here!
Introduction to Logic for Artificial Intelligence Lecture 2 Erik Sandewall 2010.
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 03: PROOFS Section 1.5 Jarek Rossignac CS1050: Understanding.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17, 18: Predicate Calculus 15.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
1CS3754 Class Notes 14B, John Shieh, Figure 2.5: Further steps in the unification of (parents X (father X) (mother bill)) and (parents bill.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 15, 16: Predicate Calculus 8.
Scope, free variable, closed wff §In  X(A) or  X(A), where A is a wff : X is called the variable quantified over; A is said to be (within) the scope.
KU NLP Resolution Theorem Proving Resolution Theorem Proving q Introduction - Resolution Principle q Producing the Clause Form q
9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Artificial Intelligence 7. Making Deductive Inferences Course V231 Department of Computing Imperial College, London Jeremy Gow.
Artificial Intelligence First-Order Logic (FOL). Outline of this Chapter The need for FOL? What is a FOL? Syntax and semantics of FOL Using FOL.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9- Completeness proof; introducing knowledge representation.
The Law of Resolution Formal Aspects of Computer Science - Week 7 The Law of Resolution Lee McCluskey, room 2/07
Propositional Logic Predicate Logic
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 35–Himalayan Club example; introducing Prolog.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Uniqueness Quantifier ROI for Quantified Statement.
CS621: Artificial Intelligence
Introduction to Logic for Artificial Intelligence Lecture 2
Resolution in the Propositional Calculus
CS 621 Artificial Intelligence Lecture 4 – 05/08/05
Logic Use mathematical deduction to derive new knowledge.
Biointelligence Lab School of Computer Sci. & Eng.
Horn Clauses and Unification
Biointelligence Lab School of Computer Sci. & Eng.
CS621: Artificial Intelligence
Horn Clauses and Unification
CS621 : Artificial Intelligence
Encoding Knowledge with First Order Predicate Logic
RESOLUTION.
Artificial Intelligence
Presentation transcript:

(using first-order predicate logic) Reasoning (using first-order predicate logic)

Resolution Refutations Example: Given {BAT_OK, MOVES', BAT_OK  LIFTABLE  MOVES} Prove LIFTABLE Nilsson

Resolution Refutations Example: Given {BAT_OK, MOVES', BAT_OK  LIFTABLE  MOVES} Prove LIFTABLE Resolution refutation proofs involve the following steps: Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Resolution Refutations Example: Given {BAT_OK, MOVES', BAT_OK  LIFTABLE  MOVES} Prove LIFTABLE Nilsson

Anyone passing his history exams and winning the lottery is happy Anyone passing his history exams and winning the lottery is happy. But anyone who studies or is lucky can pass all his exams. John did not study but is lucky. Anyone who is lucky wins the lottery. Is John happy? Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Luger: Artificial Intelligence, 5th edition Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

One refutation for the “happy student” problem. Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Luger: Artificial Intelligence, 5th edition Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Luger: Artificial Intelligence, 5th edition Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Prove (W)exciting(W) [(W)exciting(W)] = (W)exciting(W) Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Unification substitutions Resolution proof for the “exciting life” problem Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Another resolution refutation for the previous example Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Complete state space for the “exciting life” problem generated by breadth-first search (to two levels). Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Using the unit preference strategy on the “exciting life” problem. Luger: Artificial Intelligence, 5th edition. © Pearson Education Limited, 2005

Converting Arbitrary WFFs to Clause Form Eliminate implication signs. Reduce scopes of negation signs. Standardize variables. Note: variables within the scope of quantifiers are “dummy” variables and can be renamed so that each quantifier has its own variable symbol. Example: (X)p(X)'  (X)q(X) can be rewritten as (X)p(X)'  (Y)q(Y). Eliminate existential quantifiers (e.g., use a Skolem function to convert (X)[(Y) height(X,Y)] (meaning, X is of height Y) to (X)height(X,h(X)). Nilsson

Converting Arbitrary WFFs to Clause Form Some examples involving Skolem functions: Given: [(W)q(W)]→(X){(Y){(Z)[p(X,Y,Z)→(U)r(X,Y,U,Z)]}} Convert to: [(W)q(W)]→(X)(Y)[p(X,Y,g(X,Y))→(U)r(X,Y,U,g(X,Y)] Given: (X){p(X)'  {(Y)[p(Y)' p(f(X,Y))]  (W)[q(X,W)  p(W)']}} (X){p(X)'  {(Y)[p(Y)' p(f(X,Y))]  [q(X,h(X))  p(h(X))']}} (X)p(X) p(sk) where sk is a constant not used in any other expression Nilsson

Clyde is gray and likes Oscar. Problem: Sam, Clyde, and Oscar are elephants. We know the following facts about them: Sam is pink. Clyde is gray and likes Oscar. Oscar is either pink or gray (but not both) and likes Sam. Prove that a gray elephant likes a pink elephant. Nilsson

Clyde is gray and likes Oscar. Problem: Sam, Clyde, and Oscar are elephants. We know the following facts about them: Sam is pink. Clyde is gray and likes Oscar. Oscar is either pink or gray (but not both) and likes Sam. Prove that a gray elephant likes a pink elephant. Predicates: p(X) X is Pink g(X) X is Gray l(X,Y) X Likes Y Constants: s Sam c Clyde o Oscar Nilsson

Clyde is gray and likes Oscar. Problem: Sam, Clyde, and Oscar are elephants. We know the following facts about them: Sam is pink. Clyde is gray and likes Oscar. Oscar is either pink or gray (but not both) and likes Sam. Prove that a gray elephant likes a pink elephant. Knowledge Base: p(s) p(s) 1 g(c) g(c) 2 l(c,o) l(c,o) 3 p(o)  g(o) p(o)  g(o) 4 p(o)  g(o)' p(o)'  g(o)' 5 l(o,s) l(o,s) 6 (X,Y)[g(X)p(Y)l(X,Y)] (prove) g(X)  p(Y)  l(X, Y) (assume) g(X)'  p(Y)'  l(X, Y)' 7 Nilsson

p(s) Given g(c) Given l(c, o) Given p(o)  g(o) Given p(o)'  g(o)' Given l(o, s) Given g(X)'  p(Y)'  l(X, Y)' Assumed

p(s) Given g(c) Given l(c, o) Given p(o)  g(o) Given p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7

p(s) Given used g(c) Given l(c, o) Given p(o)  g(o) Given p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8

p(s) Given used g(c) Given l(c, o) Given p(o)  g(o) Given used p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8 used p(o) 4,9

p(s) Given used g(c) Given used l(c, o) Given p(o)  g(o) Given used p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8 used p(o) 4,9 p(Y)'  l(c, Y)' 2,7

p(s) Given used g(c) Given used l(c, o) Given p(o)  g(o) Given used p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8 used p(o) 4,9 used p(Y)'  l(c, Y)' 2,7 used l(c, o)' 10,11

p(s) Given used g(c) Given used l(c, o) Given used p(o)  g(o) Given used p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8 used p(o) 4,9 used p(Y)'  l(c, Y)' 2,7 used l(c, o)' 10,11 used □ 3,12

p(s) Given used g(c) Given used l(c, o) Given used p(o)  g(o) Given used p(o)'  g(o)' Given l(o, s) Given used g(X)'  p(Y)'  l(X, Y)' Assumed used g(o)'  p(s)' 6,7 used g(o)' 1,8 used p(o) 4,9 used p(Y)'  l(c, Y)' 2,7 used l(c, o)' 10,11 used □ 3,12 Is there another solution?

Those crazy elephants… Different solution Previous solution Although at first sight there may not appear to be enough information to prove what is asked, consider that there are only two “likes” predicates in the knowledge base. Consequently, the only two possibilities are g(c)p(o)l(c, o) and g(o)p(s)l(o, s). Because we know g(c) and p(s), the first of these will be true for p(o) and the second for g(o). But we also know p(o)g(o) so, even though we don’t know what color Oscar is, we do know that one of those statements, (g(c)p(o)l(c, o) or g(o)p(s)l(o, s), must be true. Note that the two solutions shown above reflect the two possibilities.

Prove: (X)(Y)[g(X)p(Y)l(X,Y)] p(s) hypothesis g(c) hypothesis l(c, o) hypothesis p(o)  g(o) hypothesis p(o)  g(o)' hypothesis l(o, s) hypothesis {( X)(Y)[g(X)p(Y)l(X,Y)]} ' assumption for proof by contradiction (X)(Y)[g(X)'  p(Y)'  l(X, Y)'] 7, negate and use DeMorgan’s law (X)(Y)[l(X, Y)  (g(X)  p(Y))'] 8, rewrite implication and use DeMorgan’s law l(c, o)  [g(c)  p(o)]' 9, universal instantiation [g(c)  p(o)]' 3,10, modus ponens g(c)'  p(o)' 11, DeMorgan’s law g(c)  p(o)' 12, rewrite implication p(o)' 2, 13, modus ponens p(o)'  g(o) 4, rewrite implication g(o) 14,15, modus ponens l(o, s)  [g(o)  p(s)]' 9, universal instantiation [g(o)  p(s)]' 6, 17, modus ponens g(o)'  p(s)' 18, DeMorgan’s law g(o)  p(s)' 19, rewrite implication p(s)' 16, 20, modus ponens  contradiction with 1 Alternatively, we can consider a standard proof sequence for the elephant problem (still employing a proof by contradiction)…

Problem: Tony, Mike, and John belong to the Alpine Club Problem: Tony, Mike, and John belong to the Alpine Club. Every member of the Alpine Club is either a skier or a mountain climber or both. No mountain climber likes rain, and all skiers like snow. Mike dislikes whatever Tony likes and likes whatever Tony dislikes. Tony likes rain and snow. Who is a member of the Alpine Club who is a mountain climber but not a skier? Nilsson

a(X) X is a member of the Alpine club m(X) X is a Mountain climber Problem: Tony, Mike, and John belong to the Alpine Club. Every member of the Alpine Club is either a skier or a mountain climber or both. No mountain climber likes rain, and all skiers like snow. Mike dislikes whatever Tony likes and likes whatever Tony dislikes. Tony likes rain and snow. Who is a member of the Alpine Club who is a mountain climber but not a skier? Predicates: a(X) X is a member of the Alpine club m(X) X is a Mountain climber s(X) X is a Skier l(X,Y) X Likes Y Constants: t Tony m Mike j John r Rain s Snow Nilsson

(x)[a(X)  s(X)  m(X)] a(X)'  s(X)  m(X) 4 Problem: Tony, Mike, and John belong to the Alpine Club. Every member of the Alpine Club is either a skier or a mountain climber or both. No mountain climber likes rain, and all skiers like snow. Mike dislikes whatever Tony likes and likes whatever Tony dislikes. Tony likes rain and snow. Who is a member of the Alpine Club who is a mountain climber but not a skier? Knowledge Base: a(t) a(t) 1 a(m) a(m) 2 a(j) a(j) 3 (x)[a(X)  s(X)  m(X)] a(X)'  s(X)  m(X) 4 (x)[m(X)  l(X,r)'] m(X)'  l(X,r)' 5 (x)[s(X)  l(X,s)] s(X)'  l(X,s) 6 (x)[l(t,X)  l(m,X)'] l(t,X)'  l(m,X)' 7 (x)[l(t,X)'  l(m,X)] l(t,X)  l(m,X) 8 l(t,r) l(t,r) 9 l(t,s) l(t,s) 10 a(X)  m(X)  s(X)' (prove) a(X)'  m(X)'  s(X)  Ans(X) (assume) 11 Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 s(m)' 6,12 used used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 s(m)' 6,12 used used a(m)'  m(m) 4,14 used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 s(m)' 6,12 used used a(m)'  m(m) 4,14 used a(m)'  s(m)  ans(m) 11,15 used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 s(m)' 6,12 used used a(m)'  m(m) 4,14 used a(m)'  s(m)  ans(m) 11,15 used s(m)  ans(m) 2,16 used Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used l(m,s)' 7,10 used m(t)' 5,9 s(m)' 6,12 used used a(m)'  m(m) 4,14 used a(m)'  s(m)  ans(m) 11,15 used s(m)  ans(m) 2,16 used ans(m) 14,17 Nilsson

a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used a(t) Given a(m) Given used a(j) Given a(X)'  s(X)  m(X) Given used m(X)'  l(X,r)' Given used s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given used l(t,X)  l(m,X) Given l(t,r) Given used l(t,s) Given used a(X)'  m(X)'  s(X)  ans(X) Assumed used Same problem using another selection order… Nilsson

a(X)'  m(X)'  s(X)  ans(X) Assumed used m(t)'  s(t)  ans(t) 1,11 a(t) Given used a(m) Given a(j) Given a(X)'  s(X)  m(X) Given m(X)'  l(X,r)' Given s(X)'  l(X,s) Given l(t,X)'  l(m,X)' Given l(t,X)  l(m,X) Given l(t,r) Given l(t,s) Given a(X)'  m(X)'  s(X)  ans(X) Assumed used m(t)'  s(t)  ans(t) 1,11 Nilsson

a(X)'  m(X)'  s(X)  ans(X) Assumed used a(t) Given used a(m) Given a(j) Given a(X)'  s(X)  m(X) Given m(X)'  l(X,r)' Given s(X)'  l(X,s) Given used l(t,X)'  l(m,X)' Given l(t,X)  l(m,X) Given l(t,r) Given l(t,s) Given a(X)'  m(X)'  s(X)  ans(X) Assumed used m(t)'  s(t)  ans(t) 1,11 used l(t,s)  m(t)'  ans(t) 6,12 Where do we go from here? Nilsson