Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.

Slides:



Advertisements
Similar presentations
Inference in first-order logic
Advertisements

INFERENCE IN FIRST ORDER LOGIC. S UBST () S UBST () is a method of substituting particular instances for variables (or vice versa). The syntax is as follows:
Inference in First-Order Logic
Artificial Intelligence 8. The Resolution Method
Some Prolog Prolog is a logic programming language
Resolution Proof System for First Order Logic
First-Order Logic.
Biointelligence Lab School of Computer Sci. & Eng.
Inference Rules Universal Instantiation Existential Generalization
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
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"
Resolution.
ITCS 3153 Artificial Intelligence Lecture 15 First-Order Logic Chapter 9 Lecture 15 First-Order Logic Chapter 9.
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Artificial Intelligence
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.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
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.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
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.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Resolution in Propositional and First-Order Logic.
Knowledge Based Systems: Logic and Deduction Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: –Constant symbols (i.e., the "individuals"
Predicate Calculus Russell and Norvig: Chapter 8,9.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Using Predicate Logic Chapter 5.
RESOLUTION: A COMPLETE INFERENCE PROCEDURE. I Then we certainly want to be able to conclude S(A); S(A) is true if S(A) or R(A) is true, and one of those.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9.
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
Inference in First-Order Logic
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Fall 2004.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2005.
Start with atomic sentences in the KB and apply Modus Ponens, adding new atomic sentences, until “done”.
The Semantic Web – WEEK 8: An automatic Proof technique.. The “Layer Cake” Model – [From Rector & Horrocks Semantic Web cuurse] You are here!
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.
For Wednesday Read chapter 10 Prolog Handout 4. Exam 1 Monday Take home due at the exam.
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.
Logical Inference 2 rule based reasoning
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
For Monday Read “lectures” 6,9-12 of Learn Prolog Now: saarland.de/~kris/learn-prolog-now/ saarland.de/~kris/learn-prolog-now/
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.
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 Systems For first order Predicate Logic.
1 Inference in First Order Logic CS 171/271 (Chapter 9) Some text and images in these slides were drawn from Russel & Norvig’s published material.
C. Varela1 Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure Carlos Varela Rennselaer Polytechnic Institute November.
Reasoning using First-Order Logic
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
1 Section 9.1 Automatic Reasoning Recall that a wff W is valid iff ¬ W is unsatisfiable. Resolution is an inference rule used to prove unsatisfiability.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
CSE (c) S. Tanimoto, 2008 Predicate Calculus II 1 Predicate Calculus 2 Outline: Unification: definitions, algorithm Formal interpretations and satisfiability.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Backward chaining Assume the same representation of rules as in forward chaining, i.e. If is true, is true, … is true Then is true. Rule interpretation.
For Friday Finish chapter 9 Program 1 due. Program 1 Any questions?
1 Introduction to Artificial Intelligence LECTURE 9: Resolution in FOL Theorem Proving in First Order Logic Unification Resolution.
For Wednesday No reading Homework: –Chapter 8, exercise 24.
For Monday Read Prolog handout 4 Homework:
Artificial Intelligence
For Monday Read chapter 10, sections 1-3 Prolog handout 4
Artificial Intelligence
Presentation transcript:

Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur

CSE, IIT Kharagpur2 Inference rules Universal elimination: –  x Likes( x, IceCream ) with the substitution {x / Einstein} gives us Likes( Einstein, IceCream ) –The substitution has to be done by a ground term Existential elimination: –From  x Likes( x, IceCream ) we infer Likes( Man, IceCream ) as long as Man does not appear elsewhere in the Knowledge base Existential introduction: –From Likes( Monalisa, IceCream ) we can infer  x Likes( x, IceCream )

CSE, IIT Kharagpur3 Reasoning in first-order logic The law says that it is a crime for a Gaul to sell potion formulas to hostile nations. The country Rome, an enemy of Gaul, has acquired some potion formulas, and all of its formulas were sold to it by Druid Traitorix, who is a Gaul. Is Traitorix a criminal? Generalized Modus Ponens –For atomic sentences p i, p i ’, and q, where there is a substitution  such that SUBST( , p i ’) = SUBST( , p i ), for all i:

CSE, IIT Kharagpur4 Unification UNIFY(p,q) =  where SUBST( ,p) = SUBST( ,q) Examples: UNIFY( Knows(Erdos, x), Knows(Erdos, Godel)) = {x / Godel} UNIFY( Knows(Erdos, x), Knows(y,Godel)) = {x/Godel, y/Erdos} UNIFY( Knows(Erdos, x), Knows(y, Father(y))) = { y/Erdos, x/Father(Erdos) } UNIFY( Knows(Erdos, x), Knows(x, Godel)) = fail We require an algorithm for finding the most general unifier

CSE, IIT Kharagpur5 Reasoning with Horn Logic If all sentences are Horn sentences, then we can convert them to a canonical form and then use generalized Modus Ponens with unification. –We skolemize existential formulas and remove the universal ones –This gives us a conjunction of clauses, that are inserted in the KB –Modus Ponens help us in infering new clauses Forward chaining Backward chaining

CSE, IIT Kharagpur6 Completeness issues Reasoning with Modus Ponens is incomplete Consider the example –  x P(x)  Q(x)  x  P(x)  R(x)  x Q(x)  S(x)  x R(x)  S(x) We should be able to conclude S(A) The problem is that  x  P(x)  R(x) cannot be converted to Horn form, and thus cannot be used by Modus Ponens

CSE, IIT Kharagpur7 Godel’s Completeness Theorem For first-order logic, any sentence that is entailed by another set of sentences can be proved from that set –Godel did not suggest a proof procedure –In 1965 Robinson published his resolution algorithm Entailment in first-order logic is semi-decidable, that is, we can show that sentences follow from premises if they do, but we cannot always show if they do not

CSE, IIT Kharagpur8 The validity problem of first-order logic [Church] The validity problem of the first-order predicate calculus is partially solvable. Consider the following formula:

CSE, IIT Kharagpur9 Resolution Generalized Resolution Rule: For atoms p i, q i, r i, s i, where Unify(p j, q k ) = , we have:

CSE, IIT Kharagpur10 Our earlier example P(w)  Q(w) True  P(x)  R(x) Q(y)  S(y) P(w)  S(w) True  S(x)  R(x)R(z)  S(z) True  S(A) {y / w} {w / x} {x/A, z/A}

CSE, IIT Kharagpur11 Conversion to Normal Form A formula is said to be in clause form if it is of the form:  x 1  x 2 …  x n [C 1  C 2  …  C k ] All first-order logic formulas can be converted to clause form We shall demonstrate the conversion on the formula:  x {p(x)   z {  y [q(x,y)  p(f(x 1 ))]   y [q(x,y)  p(x)] }}

CSE, IIT Kharagpur12 Conversion to Normal Form Step1: Take the existential closure and eliminate redundant quantifiers. This introduces  x 1 and eliminates  z, so:  x 1  x {p(x)  {  y [q(x,y)  p(f(x 1 ))]   y [q(x,y)  p(x)] }} Step 2: Rename any variable that is quantified more than once. y has been quantified twice, so:  x 1  x {p(x)  {  y [q(x,y)  p(f(x 1 ))]   z [q(x,z)  p(x)] }}

CSE, IIT Kharagpur13 Conversion to Normal Form Step 3: Eliminate implication.  x 1  x {  p(x)  {  y [  q(x,y)  p(f(x 1 ))]   z [  q(x,z)  p(x)] }} Step 4: Move  all the way inwards.  x 1  x {  p(x)  {  y [q(x,y)   p(f(x 1 ))]   z [  q(x,z)  p(x)] }} Step 5: Push the quantifiers to the right.  x 1  x {  p(x)  {[  y q(x,y)   p(f(x 1 ))]  [  z  q(x,z)  p(x)] }}

CSE, IIT Kharagpur14 Conversion to Normal Form Step 6: Eliminate existential quantifiers (Skolemization). Pick out the leftmost  y B(y) and replace it by B(f(x i1, x i2,…, x in )), where: a)x i1, x i2,…, x in are all the distinct free variables of  y B(y) which are universally quantified to the left of  y B(y), and b)F is any n-ary function constant which does not occur already  x {  p(x)  {[q(x,g(x))   p(f(a))]  [  z  q(x,z)  p(x)] }} Step 7: Move all universal quantifiers to the left  x  z {  p(x)  {[q(x,g(x))   p(f(a))]  [  q(x,z)  p(x)] }}

CSE, IIT Kharagpur15 Conversion to Normal Form Step 8: Distribute  over .  x  z {[  p(x)  q(x,g(x))]  [  p(x)   p(f(a))]  [  p(x)   q(x,z)  p(x)] } Step 9: (Optional) Simplify  x {[  p(x)  q(x,g(x))]   p(f(a)) }

CSE, IIT Kharagpur16 Resolution Refutation Proofs In refutation proofs, we add the negation of the goal to the set of clauses and then attempt to deduce False Example: –Jack owns a dog –Every dog owner is an animal lover –No animal lover kills an animal –Either Jack or Curiosity killed the cat, who is named Tuna –Goal:Did curiosity kill the cat? –We will add  Kills(Curiosity, Tuna) and try to deduce False