Logical Agents. Administrative. Thursday: Midterm 1, 7p-9p. Next Tuesday: DOW1013: Last name A-M DOW1017: Last name N-Z

Similar documents
Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

Logical Agents. Outline

Logical Agent & Propositional Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

Propositional Logic: Logical Agents (Part I)

Lecture Overview [ ] Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 6. Motivation. Logical Agents

Artificial Intelligence. Propositional logic

Logical Agent & Propositional Logic

CS 4700: Artificial Intelligence

Intelligent Agents. Pınar Yolum Utrecht University

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Logical Agents. Chapter 7

Introduction to Artificial Intelligence. Logical Agents

Kecerdasan Buatan M. Ali Fauzi

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

AI Programming CS S-09 Knowledge Representation

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Agents that reason logically

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Logic. proof and truth syntacs and semantics. Peter Antal

Propositional Logic: Logical Agents (Part I)

Artificial Intelligence Knowledge Representation I

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Class Assignment Strategies

Propositional Logic Part 1

Logical Agents. Chapter 7

Logic & Logic Agents Chapter 7 (& background)

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

CS 188: Artificial Intelligence Spring 2007

Lecture 7: Logical Agents and Propositional Logic

KB Agents and Propositional Logic

CS 771 Artificial Intelligence. Propositional Logic

Artificial Intelligence Chapter 7: Logical Agents

Proof Methods for Propositional Logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

TDT4136 Logic and Reasoning Systems

Logic & Logic Agents Chapter 7 (& Some background)

CS:4420 Artificial Intelligence

Logical agents. Chapter 7. Chapter 7 1

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

Foundations of Artificial Intelligence

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

Lecture 7: Logic and Planning

Introduction to Intelligent Systems

Foundations of Artificial Intelligence

Logical Agents. Santa Clara University

Introduction to Intelligent Systems

Artificial Intelligence

Foundations of Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

Knowledge Based Systems: Logic and Deduction

Propositional Logic: Review

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Logical Agents: Propositional Logic. Chapter 7

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Logical Agents. Outline

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Artificial Intelligence

CS 380: ARTIFICIAL INTELLIGENCE LOGICAL AGENTS. Santiago Ontañón

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Propositional and First-Order Logic

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

CS 380: ARTIFICIAL INTELLIGENCE

First Order Logic (FOL)

What is the relationship between number of constraints and number of possible solutions?

Last update: March 4, Logical agents. CMSC 421: Chapter 7. CMSC 421: Chapter 7 1

Introduction to Arti Intelligence

20/c/applet/more.html Local Beam Search The best K states are selected.

CS 7180: Behavioral Modeling and Decision- making in AI

Logic. (Propositional Logic)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic. Stephen G. Ware CSCI 4525 / 5525

Logical Agents. Course material: Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

Knowledge-Based Agents

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Knowledge-Based Agents Chapter

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Chương 3 Tri th ức và lập luận

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

Lecture 6: Knowledge 1

Artificial Intelligence

Knowledge Representation. Propositional logic

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

Propositional Logic: Methods of Proof (Part II)

Logic and machine learning review. CS 540 Yingyu Liang

Logic: Propositional Logic (Part I)

1 Propositional Logic

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Transcription:

Logical Agents Mary Herchenhahn, mary-h.com EECS 492 February 2 nd, 2010 Administrative Thursday: Midterm 1, 7p-9p DOW1013: Last name A-M DOW1017: Last name N-Z Next Tuesday: PS2 due PS3 distributed--- new team assignments M. Wellman & E. Olson 1

Today An approach for dealing with incomplete knowledge Introduce an important problem domain: Wumpus Incomplete Knowledge We don t always know the actual world state Leads to two questions: How do we represent incomplete knowledge? How do we reason about incomplete knowledge? Previously mentioned: Belief state Representation: set of possible states Reasoning: our search methods from before. M. Wellman & E. Olson 2

Vacuum world: Belief States Incomplete Knowledge Consider n room version of vacuum-world Assume no dirt sensors How many states? 2 n possible world states Search space: all subsets of world states 2 2n Much simpler (in this case): reasoning Just go to every room and Suck! M. Wellman & E. Olson 3

Describing Knowledge Often can be much more concise than enumerating possible states Idea: construct and manipulate descriptions of knowledge Some descriptions implicit in others: At least one room is dirty. Rm B is clean. Is room A dirty? How many rooms are dirty? Hunt the Wumpus Let s see how knowledge and reasoning can help us Today: Focus on concepts and terminology Use human intuition to solve problems Mary Herchenhahn, mary-h.com M. Wellman & E. Olson 4

Wumpus world: rules 4x4 grid Pits (P) Breeze (B) B B P B B B B P Entering a pit is fatal. Can always sense a breeze from an adjoining room. Wumpus world: rules 4x4 grid Pits (P) Breeze (B) Wumpus (W) Stench (S) S S W S S Encountering a wumpus is fatal. Can always sense a stench from an adjoining room. M. Wellman & E. Olson 5

Wumpus world: rules 4x4 grid Pits (P) Breeze (B) Wumpus (W) Stench (S) Gold (G) G We want to find the gold. We can only detect it when we re on top of it. Wumpus world: rules 4x4 grid Pits (P) Breeze (B) Wumpus (W) Stench (S) Gold (G) Agent (A) starts at (1,1) A M. Wellman & E. Olson 6

Wumpus world: encoding Knowledge Representation: Z x,y means Z at (x,y) Z x,y means Z not at (x,y) Wish to discover location of G and safe squares that let us get there! S W SB P SB G B B P B A B Wumpus world: Example Percepts (Knowledge) A 1,1 B 1,1 S 1,1 Rules of the game P,W Inference A P,W P 1,2, P 2,1 W 1,2, W 2,1 M. Wellman & E. Olson 7

Wumpus world: Example Knowledge from before A 1,1, B 1,1, S 1,1 P 1,2, P 2,1 new W 1,2, W 2,1 S 2,1, B 2,1 Inference Rules of the game P,W P AS P P 2,2, P 3,2 Wumpus world: Example Knowledge from before new A 1,1, B 1,1, S 1,1 P 1,2, P 2,1 W 1,2, W 2,1 S 2,1, B 2,1 P 2,2, P 3,2 S 1,2, B 1,2 Inference Rules of the game P AS P PW S P P 1,3, W 2,2 M. Wellman & E. Olson 8

What have we learned? We can do well in Hunt the Wumpus without enumerating belief states. We can reason about knowledge directly. But we (humans) were doing the reasoning! How do we get autonomous agents to do the reasoning? Knowledge-Based Agent percepts Knowledge Base Query: What should I do next? Environment Reasoning (Inference) actions Query answer: Best action Agent M. Wellman & E. Olson 9

Encoding knowledge Wumpus: we encoded some of our knowledge (the presence/absence of certain features) How do we encode the rules of the game? e.g.: The Wumpus emits a stench that can be detected from adjacent cells We need a more powerful way of encoding knowledge! Knowledge Representation Knowledge representation language: notation for expressing a KB Consists of Syntax: defines the legal sentences Semantics: facts in the world to which sentences correspond Logic: KR language with well-defined syntax and semantics M. Wellman & E. Olson 10

Sentence Syntax Sentence AtomicSentence Symbol ComplexSentence AtomicSentence ComplexSentence True False Symbol P Q R Sentence (Sentence Sentence) (Sentence Sentence) (Sentence Sentence) (Sentence Sentence) BNF (Backus-Naur Form) grammar Semantics Defines an interpretation for symbols in the logic Example: Sentence D X interpreted as fact that there is dirt in room X. Sentence is true if, in the real world, there actually is dirt in room X. Model (aka possible world) Specifies truth or falsity of every sentence M. Wellman & E. Olson 11

Logical Connectives Given boolean value(s), compute a new boolean value. Think: digital logic gates! Logical Connectives: Standard boolean NOT A A 0 1 1 0 M. Wellman & E. Olson 12

Logical Connectives: Standard boolean AND A B A B 0 0 0 0 1 0 1 0 0 1 1 1 Logical Connectives: Standard boolean OR Not Exclusive A B A B 0 0 0 0 1 1 1 0 1 1 1 1 M. Wellman & E. Olson 13

Remembering vs. Helpful mnemonics: looks like A for And looks like V for Vel Imagine rain falling from above: collects more OR collects less AND Logical Connectives: Implication: A B NOT the same as entailment, Note behavior when A A B A B A B 0 0 1 0 1 1 1 0 0 1 1 1 M. Wellman & E. Olson 14

Logical Connectives: Implication: A B Equivalent expression? A B A B 0 0 1 0 1 1 1 0 0 1 1 1 Logical Connectives: Biconditional A B True if A B and B A A B A B 0 0 1 0 1 0 1 0 0 1 1 1 M. Wellman & E. Olson 15

Five Logical Connectives P Q P (not) PQ (and) PQ (or) P Q (implies) P Q (if and only if) false false 1 0 0 1 1 false true 1 0 1 1 0 true false 0 0 1 0 0 true true 0 1 1 1 1 Return of the Wumpus We can now encode the rules of the game! The Wumpus emits a stench that can be detected from adjacent cells S x,y W x-1,y W x+1,y W x,y-1 W x,y+1 S x,y W x-1,y W x+1,y W x,y-1 W x,y+1 (right?) M. Wellman & E. Olson 16

Order of Operations What does ABC mean? 1. ((AB)C) 2. (A(BC)) 3. (( A)B)C 4. ((AB))C Always safe to use extra parentheses! Otherwise, order of operations: Highest to lowest,,,, Properties of Sentences True or False: Value of expression (with respect to a particular model) Valid: True in all models Satisfiable: True in some model Examples: D X D X D X D Y D X D X M. Wellman & E. Olson 17

Knowledge Base KB is the set of all known true sentences for the actual world model. Contains generalizations ( game rules ) applicable to all instances of Hunt the Wumpus Contains percepts applicable to the particular instance we re playing. Entailment Suppose we want to know if W 2,2 is true, given KB. (does KB W 2,2?) We better make sure that there isn t a model satisfying KB but where W 2,2 is false. I.e., is (KB(W 2,2 )) unsatisfiable? I.e., is (KB W 2,2 ) valid? I.e., is (KB W 2,2 ) valid? A B A B 0 0 1 0 1 1 1 0 0 1 1 1 How is that different from the value of (KB W 2,2 )? M. Wellman & E. Olson 18

Entailment Relation between sentences, says whether one is implicit in other(s). KB: a set of sentences : a sentence KB KB entails In every model of KB (i.e., a model in which KB is true), is true. Truth of is contained in KB. Deduction Theorem Entailment and Implication are different, but are related to each other via the Deduction Theorem. Deduction Theorem: For any sentences A and B: ((A B) is valid) iff A B M. Wellman & E. Olson 19

Implication vs. Entailment A B Entailment: For all world models in which A is true, B is true. (A => B is valid). A B Implication: Compute a boolean value as a function of A and B equal to (A B). If A, we re not saying anything about B. Inference Process by which some sentences are derived from others. Aka reasoning Record of an inference process called a proof Can derive from KB using method i: KB i M. Wellman & E. Olson 20

Properties of inference methods Soundness KB i only when KB Completeness whenever KB it is true that KB i Gottfried Wilhelm Leibnitz (1646-1716) if we could find characters or signs appropriate for expressing all our thoughts as definitely and as exactly as arithmetic expresses numbers, we could in all subjects in so far as they are amenable to reasoning accomplish what is done in Arithmetic For all inquiries would be performed by the transposition of characters and by a kind of calculus, which would immediately facilitate the discovery of beautiful results Dissertio de Arte Combinatoria, 1666 M. Wellman & E. Olson 21

Inference Methods Now, all we need is an inference method we can implement! Model Checking KB? i A generic inference mechanism Enumerate all models (i.e., truth assignments) and check that is true in all models in which KB is true Time complexity: O(2 n ) Space complexity: O(n) Sound: Yes: directly implements the definition of entailment Complete Yes: given finite KB and (because there are only finitely many models to examine) M. Wellman & E. Olson 22

Model Checking Example KB: (IsDog(Fido) IsCat(Fido)) (IsCat(Fido) Meows(Fido)) ( Meows(Fido)) IsDog(Fido) IsCat(Fido) Meows(Fido) 0 0 0 0 0 1 0 1 0 Does KB IsDog(Fido)? 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Model Checking Example KB: (IsDog(Fido) IsCat(Fido)) (IsCat(Fido) Meows(Fido)) ( Meows(Fido)) IsDog(Fido) IsCat(Fido) Meows(Fido) 0 0 0 0 0 1 0 1 0 Does KB IsDog(Fido)? 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 M. Wellman & E. Olson 23

Model Checking Example KB: (IsDog(Fido) IsCat(Fido)) (IsCat(Fido) Meows(Fido)) ( Meows(Fido)) IsDog(Fido) IsCat(Fido) Meows(Fido) 0 0 0 0 0 1 0 1 0 Does KB IsDog(Fido)? 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Model Checking Example KB: (IsDog(Fido) IsCat(Fido)) (IsCat(Fido) Meows(Fido)) ( Meows(Fido)) IsDog(Fido) IsCat(Fido) Meows(Fido) 0 0 0 0 0 1 0 1 0 Does KB IsDog(Fido)? 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 M. Wellman & E. Olson 24

Model Checking Example KB: (IsDog(Fido) IsCat(Fido)) (IsCat(Fido) Meows(Fido)) ( Meows(Fido)) IsDog(Fido) IsCat(Fido) Meows(Fido) 0 0 0 0 0 1 0 1 0 Does KB IsDog(Fido)? For all world models in which KB is true, IsDog(Fido) is true, so YES! 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Next Time Propositional Logic More ways to manipulate our knowledge Inference without enumerating all states M. Wellman & E. Olson 25