Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.

Slides:



Advertisements
Similar presentations
First-Order Logic Chapter 8.
Advertisements

Russell and Norvig Chapter 7
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.
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
3/30/00 Agents that Reason Logically by Chris Horn Jiansui Yang Xiaojing Wu.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Fall 2005.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
CS 561, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
CS 460, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
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.
Computing & Information Sciences Kansas State University Lecture 11 of 42 CIS 530 / 730 Artificial Intelligence Lecture 11 of 42 William H. Hsu Department.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
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 in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 8 Jim Martin.
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
Knoweldge Representation & Reasoning
LOGICAL AGENTS Yılmaz KILIÇASLAN. Definitions Logical agents are those that can:  form representations of the world,  use a process of inference to.
Let remember from the previous lesson what is Knowledge representation
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2005.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2008.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Artificial Intelligence Lecture No. 9 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
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
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
지식표현 Agent that reason logically
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
1 Knowledge Representation Propositional Logic Vumpus World Knowledge Representation Propositional Logic Vumpus World.
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.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
Knowledge Representation Lecture # 17, 18 & 19. Motivation (1) Up to now, we concentrated on search methods in worlds that can be relatively easily represented.
For Friday Read chapter 8 Homework: –Chapter 7, exercise 1.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
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.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
Review: What is a logic? A formal language –Syntax – what expressions are legal –Semantics – what legal expressions mean –Proof system – a way of manipulating.
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
1 Knowledge Representation Logic and Inference Propositional Logic Vumpus World Knowledge Representation Logic and Inference Propositional Logic Vumpus.
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
LOGICAL AGENTS CHAPTER 7 AIMA 3. OUTLINE  Knowledge-based agents  Wumpus world  Logic in general - models and entailment  Propositional (Boolean)
Knowledge and reasoning – second part
EA C461 – Artificial Intelligence Logical Agent
Logical Agents Chapter 7.
Artificial Intelligence
Artificial Intelligence: Logic agents
Class #9– Thursday, September 29
Knowledge and reasoning – second part
Logical Agents Chapter 7.
CS 416 Artificial Intelligence
Knowledge Representation I (Propositional Logic)
CMSC 471 Fall 2011 Class #10 Tuesday, October 4 Knowledge-Based Agents
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate action

Sample: Wumpus World Show original wumpus game goal is to shoot wumpus example of logical reasoning index.shtml index.shtml Our version: Kill the wumpus.

A Wumpus Agent Agent does not perceive its own location (unlike sample game), but it can keep track of where it has been Percepts: Stench – wumpus is nearby Breeze – pit is nearby

Wumpus Agent Actuators: Forward, Turn Left, Turn Right Shoot (shoots arrow forward until hits wumpus or wall) Environment: 4x4 grid, start at (1,1) facing right

Wumpus Agent Death Agent dies if it enters a pit or square with wumpus Goal: kill wumpus

Some complex reasoning examples Start in (1,1) Breeze in (1,2) and (2,1) Probably a pit in (2,2) Smell in (1,1) – where can you go? Pick a direction – shoot Walk in that direction Know where wumpus is

The use of logic A logic: formal language for representing information, rules for drawing conclusions Two kinds of logics: Propositional Logic (Chap 7) Represents facts First Order Logic (Chap 8) Represents facts, objects, and relations

Soundness Rules of inference allow us to derive new sentences entailed by a knowledge base Rules of inference must be sound: sentences inferred by a KB should be entailed by that KB What is a non-sound inference? Video

Entailment At any given time, we have a knowledge base of information If Jan likes ice cream, we would share tastes If we share tastes, I would like to know Jan better Jan likes ice cream The knowledge base KB entails  means  is true in all worlds where KB is true e.g. if  = “I would like to know Jan better” KB 

Propositional Logic: Semantics

Inference by Enumeration

Enumeration Solution: is  entailed by KB?

Enumeration is too computationally intense For n proposition symbols, enumeration takes 2 n rows (exponential) Inference rules allow you to deduce new sentences from the KB Can use inference rules as operators in a standard search algorithm Think of testing if something as true as searching for it

Modus Ponens (Implication-Elimination) And-Elimination And-Introduction “Or Introduction” Common inference rules for propositional logic

Double-Negation Elimination Unit Resolution Resolution Common inference rules for propositional logic

Example of using logic in Wumpus World Stench Agent StartBreeze KB contains:

KB also contains knowledge of environment No stench  no wumpus nearby Stench  wumpus nearby

We can determine where wumpus is! Method 1: Truth table At least 14 symbols currently: S 1,1, S 2,1, S 1,2, S 2,2, W 1,1, W 2,1, W 1,2, W 2,2, W 3,1, W 1,3, B 1,1, B 2,1, B 1,2, B 2,2  2 14 rows, ouch!

We can determine where wumpus is! Method 2: Inference Modus Ponens And-Elimination

Inference continued... Modus Ponens and And-Elimination again: One more Modus Ponens:

Inference continued... Unit Resolution: Wumpus is in (1,3)!!! Shoot it. Shoot where?

Determining action based on knowledge Propositional logic cannot answer well the question “What action should I take?” It only answers “Should I take action X?”

Propositional logic seems inefficient Rule: “Shoot if the wumpus is in front of you” 16 x 4 = 64 rules for the 4x4 grid Ditto for pits First order logic is much more efficient

First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate to each other Functions: return value for given input

Syntax and Semantics First-order logic has the following: Constants: represent objects book, A, cs327 Predicates: represent relations OlderSibling(Lisa,Bart) OlderSibling(Maggie,Lisa) OlderSibling(Maggie,Bart) Functions FatherOf(Luke) = Anakin

Syntax and Semantics Atomic Sentences Father(Luke,Anakin) Siblings(SonOf(Anakin), DaughterOf(Anakin)) Complex Sentences and, or, not, implies, equivalence Equality

Universal Quantification “For all, for every”: Examples: Usually use with Common mistake to use

Existential Quantification “There exists”: Typically use with Common mistake to use

First-Order Logic in Wumpus World Suppose an agent perceives a stench, breeze, at time t = 5: Percept([Stench,Breeze],5) [Stench,Breeze] is a list Then want to query for an appropriate action. Find an a (ask the KB):