9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998.

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

First-Order Logic.
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Inference Rules Universal Instantiation Existential Generalization
Introduction to Theorem Proving
Standard Logical Equivalences
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Artificial Intelligence
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.
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.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Logic.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
9/28/98 Prof. Richard Fikes First-Order Logic Knowledge Interchange Format (KIF) Computer Science Department Stanford University CS222 Fall 1998.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
Knowledge Representation I (Propositional Logic) CSE 473.
Knoweldge Representation & Reasoning
Inference in First-Order Logic
Let remember from the previous lesson what is Knowledge representation
Chapter 3 Propositional Logic
03 -1 Lecture 03 First-Order Predicate Logic Topics –Syntax –Formal Semantics –Denotational Semantics –Formal Inference –Resolution.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Formal Theories SIE 550 Lecture Matt Dube Doctoral Student - Spatial.
Knowledge Interchange Format Michael Gruninger National Institute of Standards and Technology
Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.
Pattern-directed inference systems
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Computing & Information Sciences Kansas State University Wednesday, 20 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 12 of 42 Wednesday, 20 September.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 13 of 41 Monday, 20 September.
Computing & Information Sciences Kansas State University Lecture 13 of 42 CIS 530 / 730 Artificial Intelligence Lecture 13 of 42 William H. Hsu Department.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM]
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Friday, 17 September.
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 14 of 41 Wednesday, 22.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
CS6133 Software Specification and Verification
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 15 of 41 Friday 24 September.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Propositional Logic Predicate Logic
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 05 : Knowledge Base & First Order Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 14 of 42 Wednesday, 22.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
CT214 – Logical Foundations of Computing Darren Doherty Rm. 311 Dept. of Information Technology NUI Galway
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Knowledge Representation and Reasoning
Introduction to Knowledge-bases
Logical Agents Chapter 7.
CSNB234 ARTIFICIAL INTELLIGENCE
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Presentation transcript:

9/30/98 Prof. Richard Fikes Inference In First Order Logic Computer Science Department Stanford University CS222 Fall 1998

2 Knowledge Systems Laboratory, Stanford University KR Language Components logical formalism u A logical formalism ä Syntax for wffs ä Vocabulary of logical symbols ä Interpretation semantics for the logical symbols E.g., (=> (Person ?x) (= (Gender (Mother ?x)) Female))) ontology u An ontology ä Vocabulary of non-logical symbols › Relations, functions, constants ä Axioms restricting the interpretations of the symbols E.g., (=> (Person ?x) (= (Gender (Mother ?x)) Female))) proof theory u A proof theory ä Specification of the reasoning steps that are logically sound E.g., (=> S 1 S 2 ) and S 1 entails S 2

3 Knowledge Systems Laboratory, Stanford University Logical Entailment u Logical Satisfaction Interpretation I logically satisfies a sentence S if and only if T IV (S) is true for all V. E.g., (=> (Block ?b1) (or (On ?b1 table) (exists ?b2 (On ?b1 b2)))) u Models Interpretation I is a model of a sentence S if and only if I logically satisfies S. u Logical Entailment Sentence S1 logically entails sentence S2 if and only if every model of S1 is also a model of S2. E.g., (and S3 (=> S3 S4)) logically entails S4

4 Knowledge Systems Laboratory, Stanford University InferenceInference u Inference - Determining conclusions logically entailed by premises u Patterns of inference represented as inference rules u Example inference rules - Modus Ponens Modus Tollens (implies S 1 S 2 ), S 1 (implies S 1 S 2 ), (not S 2 )  S 2 (not S 1 ) u An inference rule can be verified using a truth table S 1 S 2 (not S 1 )(not S 2 )(implies S 1 S 2 ) _____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ TrueTrueFalseFalseTrue TrueFalseFalseTrueFalse FalseTrueTrueFalseTrue FalseFalseTrueTrueTrue

5 Knowledge Systems Laboratory, Stanford University Inference Rules u Transitivity of Equal  Unit Resolution (= T1 T2), (= T1 T3)(or S1 S2), (not S1)  (= T2 T3) S2 u Modus Tollens  Universal Elimination (=> S1 S2), (not S2) (forall ?var S)  (not S1) Subst({?var/g}, S) u And Elimination  And Introduction (and S1 … Sn) S1, …, Sn Si (and S1 … Sn) u Existential Introduction Given sentence S in which variable ?var does not occur: S  (exists ?var Subst({?var/C}, S)

6 Knowledge Systems Laboratory, Stanford University ProofsProofs u Proof of sentence S n in knowledge base KB ä Sentence sequence S 1, S 2, …, S n such that each S i is › A sentence in KB, or › Inferable from sentences occurring previously in the proof u Standard proof techniques ä Deduction Theorem › If KB  S1 |– S2, then KB |– (implies S1 S2) › To prove (implies S1 S2): Assume S1. Derive S2. ä Refutation Theorem › If KB  (not S) |– false, then KB |– S › To prove S: Assume (not S). Prove false.

7 Knowledge Systems Laboratory, Stanford University Sample Query u Do inputs (On, On, Off) produce outputs (Off, On)? u Prove: (=> (= (Signal (In 1 C1)) On) (= (Signal (In 2 C1)) On) (= (Signal (In 3 C1)) Off) (and (= (Signal (Out 1 C1)) Off) (= (Signal (Out 2 C1)) On))) u Using the Deduction Theorem - ä Assume: (= (Signal (In 1 C1)) On) (= (Signal (In 2 C1)) On) (= (Signal (In 3 C1)) Off) ä Prove: (and (= (Signal (Out 1 C1)) Off) (= (Signal (Out 2 C1)) On)

8 Knowledge Systems Laboratory, Stanford University The Inputs of X 1 are Equal [1](=> (Connected ?t1 ?t2) (= (Signal ?t1) (Signal ?t2))){Given} [2](=> (Connected (In 1 C 1 ) (In 1 X 1 )) (= (Signal (In 1 C 1 )) (Signal (In 1 X 1 )))){[1]: Univ. Elim.} [3](Connected (In 1 C 1 ) (In 1 X 1 )){Given} [4](= (Signal (In 1 C 1 )) (Signal (In 1 X 1 ))){[2],[3]: Modus Ponens} [5](= (Signal (In 1 C 1 )) On){Given} [6](= (Signal (In 1 X 1 )) On){[4],[5]: Trans. Of =} … [12](= (Signal (In 2 X 1 )) On){[10],[11]: Trans. Of =} [13](= (Signal (In 1 X 1 )) (Signal (In 2 X 1 ))){[6],[12]: Trans. Of =}

9 Knowledge Systems Laboratory, Stanford University The Output of X 1 is Off [21](=> (= (Type ?g) XOR) ( (= (Signal (Out 1 ?g)) On) (not (= (Signal (In 1 ?g) (Signal (In 2 ?g)))))){Given} [22](=> (= (Type X 1 ) XOR) ( (= (Signal (Out 1 X 1 )) On) (not (= (Signal (In 1 X 1 ) (Signal (In 2 X 1 )))))){[21]: Univ. Elim.} [23](= (Type X 1 ) XOR){Given} [24]( (= (Signal (Out 1 X 1 )) On) (not (= (Signal (In 1 X 1 ) (Signal (In 2 X 1 ))))){[22],[23]; M. P.} [25](=> (= (Signal (Out 1 X 1 )) On) (not (= (Signal (In 1 X 1 ) (Signal (In 2 X 1 ))))){[24]: And Elim.} [26](not (= (Signal (Out 1 X 1 )) On)){[13],[25]: M. T.} [27](or (= (Signal ?t) On) (= (Signal ?t) Off)){Given} [28](or (= (Signal X 1 ) On) (= (Signal X 1 ) Off)){[27]: Univ. Elim.} [29](= (Signal (Out 1 X 1 )) Off){[26],[28]: U. Res.}

10 Knowledge Systems Laboratory, Stanford University Generalized Modus Ponens u Example inference ä Given – › (Missile M1) › (Owns Nono M1) › (=> (Missile ?x) (Owns Nono ?x) (Sold West Nono ?x)) ä Infer in one proof step: (Sold West Nono M1) u Needed: an inference rule combining – ä And Introduction ä Universal Elimination ä Modus Ponens

11 Knowledge Systems Laboratory, Stanford University Generalized Modus Ponens u := | (not ) | u Subst( , S) – result of applying substitution  to sentence S E.g., Subst({?x/Sam, ?y/Pam}, (Likes ?x ?y)) = (Likes Sam Pam) u Inference rule – For literals p 1, …, p n, p 1 ’, …, p n ’, and q, where there is a substitution  such that Subst( , p 1 ’) = Subst( , p 1 ), …, Subst( , p n ’) = Subst( , p n ): p 1 ’, …, p n ’, (=> p 1 … p n q)  Subst( , q)

12 Knowledge Systems Laboratory, Stanford University Generalized Modus Ponens u Inference rule – p 1 ’, …, p n ’, (=> p 1 … p n q)  Subst( , q) u Example inference ä p 1 ’: (Missile M1) ä p 2 ’: (Owns Nono M1) ä (=> (Missile ?x) (Owns Nono ?x) (Sold West Nono ?x)) › p 1 : (Missile ?x) › p 2 : (Owns Nono ?x) › q: (Sold West Nono ?x) ä Subst({?x/M1}, (Sold West Nono ?x) ): (Sold West Nono M1)

13 Knowledge Systems Laboratory, Stanford University The Inputs of X 1 are Equal [1](=> (Connected ?t1 ?t2) (= (Signal ?t1) (Signal ?t2))){Given} [2](=> (Connected (In 1 C 1 ) (In 1 X 1 )) (= (Signal (In 1 C 1 )) (Signal (In 1 X 1 )))){[1]: Univ. Elim.} [3](Connected (In 1 C 1 ) (In 1 X 1 )){Given} [4](= (Signal (In 1 C 1 )) (Signal (In 1 X 1 ))){[1],[3]: Gen. Modus Ponens} [5](= (Signal (In 1 C 1 )) On){Given} [6](= (Signal (In 1 X 1 )) On){[4],[5]: Trans. Of =} … [12](= (Signal (In 2 X 1 )) On){[10],[11]: Trans. Of =} [13](= (Signal (In 1 X 1 )) (Signal (In 2 X 1 ))){[6],[12]: Trans. Of =}

14 Knowledge Systems Laboratory, Stanford University Canonical Form u GMP requires all sentences to be: ä Literals or ä Implications of the form (=> p 1 … p n q), where p 1, …, p n, and q are literals (called Implicative Normal Form) u Any sentence can be converted into those forms E.g., (=> (Type ?g OR) ( (Signal (Out 1 ?g) On) (exists ?i (Signal (In ?i ?g) On)))) can be converted to: ä (=> (Type ?g OR) (Signal (Out 1 ?g) On) (Signal (In (Sk1 ?g) ?g) On)) ä (=> (Type ?g OR) (Signal (In (Sk1 ?g) ?g) On) (Signal (Out 1 ?g) On))

15 Knowledge Systems Laboratory, Stanford University Canonical Form u Implications can be redundantly expressed with each primitive sentence as the consequent E.g., (=> (Type ?g OR) (Signal (Out 1 ?g) On) (Signal (In (Sk1 ?g) ?g) On)) can be also be expressed as: ä (=> (Type ?g) OR) (not (Signal (In (Sk1 ?g) ?g) On)) (not (Signal (Out 1 ?g) On))) and ä (=> (not (Signal (In (Sk1 ?g) ?g) On)) (Signal (Out 1 ?g) On) (not (Type ?g OR)))

16 Knowledge Systems Laboratory, Stanford University ReadingsReadings u For 10/5 ä Proofs and inference rules for first order logic ä Primary readings › Russell and Norvig Inference in First-Order Logic u For 10/7 ä Model elimination proof procedure ä Primary readings › Russell and Norvig Theorem Provers