Knowledge Representation III First-Order Logic

Slides:



Advertisements
Similar presentations
First-Order Logic Chapter 8.
Advertisements

First-Order Logic.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Knowledge Based Systems: Logic and Deduction Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Knowledge Representation Methods
Artificial Intelligence Lecture No. 10 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Computing & Information Sciences Kansas State University Lecture 11 of 42 CIS 530 / 730 Artificial Intelligence Lecture 11 of 42 William H. Hsu Department.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge Representation I (Propositional Logic) CSE 473.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
Knowledge Representation III First-Order Logic
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Predicate Calculus.
Propositional Logic Agenda: Other forms of inference in propositional logic Basics of First Order Logic (FOL) Vision Final Homework now posted on web site.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
CSE PredLogic 1 Knowledge Representation with Logic: First Order Predicate Calculus Outline –Introduction to First Order Predicate Calculus (FOPC)
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
Knowledge Representation IV Inference for First-Order Logic CSE 473.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
First-Order Logic Chapter 8. Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL Knowledge engineering in FOL.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
CS6133 Software Specification and Verification
1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their.
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.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
1 Propositional logic (cont…) 命題論理 Syntax&Semantics of first-order logic 構文論と意味論 Deducing hidden properties Describing actions Propositional logic (cont…)
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 11 Jim Martin.
First-Order Logic Chapter 8 (not 8.1). Outline Why FOL? Why FOL? Syntax and semantics of FOL Syntax and semantics of FOL Using FOL Using FOL Wumpus world.
First-Order Logic Daniel Weld CSE 473 Spring 2012.
© Daniel S. Weld Topics Agency Problem Spaces SearchKnowledge Representation Planning PerceptionNLPMulti-agentRobotics Uncertainty MDPs Supervised.
First-Order Logic Reading: C. 8 and C. 9 Pente specifications handed back at end of class.
Computing & Information Sciences Kansas State University Lecture 12 of 42 CIS 530 / 730 Artificial Intelligence Lecture 12 of 42 William H. Hsu Department.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
1 First Order Logic CS 171/271 (Chapter 8) Some text and images in these slides were drawn from Russel & Norvig’s published material.
First-Order Logic Chapter 8. Problem of Propositional Logic  Propositional logic has very limited expressive power –E.g., cannot say "pits cause breezes.
1 CS 2710, ISSP 2610 Chapter 8, Part 1 First Order Predicate Calculus FOPC.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
Propositional Logic: Logical Agents (Part I)
Propositional Logic.
Knowledge Representation using First-Order Logic
Announcements No office hours today!
Effective Propositional Logic Search
Knowledge and reasoning – second part
First-Order Logic Chapter 8.
Introduction to Knowledge-bases
Knowledge Representation II
Notes 8: Predicate logic and inference
EA C461 – Artificial Intelligence Logical Agent
First-Order Logic CSE 573 A handful of GENERAL SEARCH TECHNIQUES lie at the heart of practically all work in AI We will encounter the SAME PRINCIPLES again.
Knowledge Representation III First-Order Logic
First-Order Logic Chapter 8.
Artificial Intelligence
Chapter 8, Part 1 First Order Predicate Calculus FOPC
Knowledge and reasoning – second part
First-order Logic Propositional logic (cont…)
EA C461 – Artificial Intelligence Logical Agent
CS 416 Artificial Intelligence
Knowledge Representation I (Propositional Logic)
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
First-Order Logic Chapter 8.
Chapter 8, Part 1 First Order Predicate Calculus FOPC
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Knowledge Representation III First-Order Logic CSE 473

Why Not Propositional Logic? “All monkeys are fuzzy” Propositional logic requires: fuzzy1, fuzzy2, …, fuzzyN Why? Lack of structure in/between atoms. What we’d like is a way to talk about objects and groups of objects, and to define relationships between them. First-order logic (aka “predicate logic”) © Daniel S. Weld

Propositional vs. First-Order Propositional logic Facts: p, q, ¬r, etc. (p ^ q) v (¬r v q ^ p) First-order logic Objects: Dieter, Monkey, etc. Relations: German(Dieter) Smarter(Dieter, Monkey) Stooges(Larry, Moe, Curly) HasTail(Monkey) v ¬HasBanana(Dieter) © Daniel S. Weld

FOL Definitions Constants: a, dieter, monkey23, monkey4. Name a specific object. Variables: X, Y. Refer to an object without naming it. Functions: dad-of, banana-of. Mapping from objects to objects. Terms: banana-of(monkey4). Refer to objects Relations: in, hungry. State relationships between objects. Atomic Sentences: in(banana-of(dieter), monkey4) Can be true or false Correspond to propositional symbols P, Q © Daniel S. Weld

More Definitions Logical connectives: and, or, not, => Quantifiers:  Forall (Universal quantifier)  There exists (Existential quantifier) Examples George is brown Monkeys are curious There is a curious monkey Brown(George) m: Monkey(m)  Curious(m) m: Monkey(m) ^ Curious(m) © Daniel S. Weld

Quantifier / Connective Interaction M(x) == “x is a monkey” C(x) == “x is curious” x: M(x)  C(x) x: M(x) C(x) x: M(x)  C(x) x: M(x) C(x) “Everything is a curious monkey” “All monkeys are curious” “There exists a curious monkey” “There exists an object that is either a curious monkey, or not a monkey at all” © Daniel S. Weld

Nested Quantifiers: Order matters! x y P(x,y)  y x P(x,y) Examples Every monkey has a tail Every monkey shares a tail! ? m t has(m,t) t m has(m,t) Someone is loved by everyone x y loves(y, x) © Daniel S. Weld

Semantics Semantics: what the arrangement of symbols means in the world Propositional logic Basic elements are variables (references to facts) Possible worlds: mappings from variables to T/F First-order logic Basic elements are terms (references to objects) Possible worlds: mappings from terms to real- world elements. © Daniel S. Weld

Our First-Order Logic World Syntactic elements: Constants: Functions: Relations: Richard John Leg(p,l) On(x,y) King(p) © Daniel S. Weld

Possible World (Interpretation) I Possible worlds map syntactic tokens to model elements Constants: Functions: Relations: Richard John Leg(p,l) On(x,y) King(p) © Daniel S. Weld

Possible World (Interpretation) II Constants: Functions: Relations: Richard John Leg(p,l) On(x,y) King(p) © Daniel S. Weld

How Many Interpretations? Two named objects Richard, John One unary relation King(x) Two binary relations Leg(x, y); On(x, y) 52 = 25 object mappings Infinite number of values for x  infinite mappings Even if we restricted x to: R, J, crown, llR, llJ: 25 = 32 unary truth mappings Infinite. But even restricting x, y to five objects still yields 225 mappings for each binary relation © Daniel S. Weld

Satisfiability, Validity, & Entailment S is valid if it is true in all interpretations S is satisfiable if it is true in some interp S is unsatisfiable if it is false all interps S1 entails S2 if forall interps where S1 is true, S2 is also true |= © Daniel S. Weld

Propositional. Logic vs. First Order Objects, Properties, Relations Facts (P, Q) Ontology Syntax Semantics Inference Algorithm Complexity Atomic sentences Connectives Variables & quantification Sentences have structure: terms father-of(mother-of(X))) Interpretations (Much more complicated) Truth Tables Unification Forward, Backward chaining Prolog, theorem proving DPLL, GSAT Fast in practice Semi-decidable NP-Complete © Daniel S. Weld

First-Order Wumpus World Objects Squares, wumpuses, agents, gold, pits, stinkiness, breezes Relations Square topology (adjacency), Pits/breezes, Wumpus/stinkiness © Daniel S. Weld

Wumpus World: Squares Square topology relations? Each square as an object: Square1,1, Square1,2, …, Square3,4, Square4,4 Square topology relations? Adjacent(Square1,1, Square2,1) … Adjacent(Square3,4, Square4,4) Better: Squares as lists: [1, 1], [1,2], …, [4, 4] Square topology relations: x, y, a, b: Adjacent([x, y], [a, b])  [a, b] Є {[x+1, y], [x-1, y], [x, y+1], [x, y-1]} © Daniel S. Weld

Wumpus World: Pits Each pit as an object: Problem? Pit1,1, Pit1,2, …, Pit3,4, Pit4,4 Problem? Not all squares have pits List only the pits we have: Pit3,1, Pit3,3, Pit4,4 Problem? No reason to distinguish pits. Complicates inference. Better: pit as unary predicate Pit(x) Pit([3,1]); Pit([3,3]); Pit([4,4]) will be true © Daniel S. Weld

Wumpus World: Breezes Represent breezes like pits, as unary predicates: Breezy(x) “Squares next to pits are breezy”: x, y, a, b: Pit([x, y]) ^ Adjacent([x, y], [a, b])  Breezy([a, b]) © Daniel S. Weld

Wumpus World: Wumpuses Wumpus as object: Wumpus Wumpus home as unary predicate: WumpusIn(x) Better: Wumpus’s home as a function: Home(Wumpus) references the wumpus’s home square. Why is this better? © Daniel S. Weld

Wumpus World: Still Todo Time Inference/reasoning © Daniel S. Weld