1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
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.
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.
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?
Logical Agents Chapter 7.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Cooperating Intelligent Systems Logical agents Chapter 7, AIMA This presentation owes some to V. Rutgers and D. OSU.
LOGICAL AGENTS Yılmaz KILIÇASLAN. Definitions Logical agents are those that can:  form representations of the world,  use a process of inference to.
Artificial Intelligence
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 )
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Logical Agents. Knowledge bases Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): 
February 20, 2006AI: Chapter 7: Logical Agents1 Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent.
Logical Agents (NUS) Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
‘In which we introduce a logic that is sufficent for building knowledge- based agents!’
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
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,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
1 Problems in AI Problem Formulation Uninformed Search Heuristic Search Adversarial Search (Multi-agents) Knowledge RepresentationKnowledge Representation.
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
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
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 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.
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.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Russell & Norvig Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean)
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
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.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
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)
CS666 AI P. T. Chung Logic Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Propositional Logic: Logical Agents (Part I)
EA C461 – Artificial Intelligence Logical Agent
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Reading: Russell’s Chapter 7
Logical Agents Chapter 7.
Artificial Intelligence
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:

1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material

2 Logic and Knowledge Bases Logic: means of representation and reasoning Knowledge Base (KB): set of sentences (expressed in some language) Inference: deriving new sentences from sentences in the KB

3 Knowledge-Based Agent Function TELL: adds a sentence to the KB ASK: queries the KB

4 Example: Wumpus World 4 by 4 grid of rooms A room may contain: Agent, Wumpus, Pit, Gold Agent can perceive pit or wumpus from neighboring squares Agent starts in lower left corner, can move to neighboring squares, or shoot an arrow N,E,W, or S

5 Wumpus World PEAS Description Performance measure: gold death – per step -10 for using up arrow Environment: 4 by 4 grid of rooms one room contains the agent (initially at [1,1] facing right) one room (not [1,1]) contains the wumpus (and it stays there) one room contains the gold the other rooms may contain a pit

6 PEAS Description, continued Actuators: Left turn, Right turn, Forward, Grab, Shoot Shooting kills wumpus if you are facing it Shooting uses up the only arrow Grabbing picks up gold if in same square Agent dies when it enters a room containing pit/live wumpus Sensors: Stench, Breeze, Glitter, Bump, Scream Squares adjacent to wumpus are smelly Squares adjacent to a pit are breezy Glitter perceived in square containing gold Bump perceived when agent hits a wall Scream perceived everywhere when wumpus is hit

7 Wumpus World and Knowledge State of knowledge What is known about the rooms at time t Associate one or more values to each room, when known: A, B, G, OK, P, S, V, W (use ? to indicate possibility) Contrast against what are actually in the rooms A move and resulting percept allow agent to update the state of knowledge Next move would depend on what is known

8 Example: Initial State and First Move [None,None,None,None,None][None,Breeze,None,None,None]

9 Sample Action Sequence: forward, turn around, forward, turn right, forward, turn right, forward, turn left, forward

10 Later Moves Actions: forward, turn around, forward, turn right, forward, turn right, forward, turn left, forward

11 Inference Agent can infer that there is a wumpus in [1,3] Stench in [1,2] means wumpus is in [1,1], [1,3], or [2,2] Wumpus not in [1,1] by the rules of the game Wumpus not in [2,2] because [2,1] had no stench Agent can also infer that there is a pit in [3,1] (how?)

12 Logic Representation Syntax: how well-formed sentences are specified Semantics: “meaning” of the sentences; truth with respect to each possible world (model) Reasoning Entailment: sentence following from another sentence ( a ╞ b )

13 Models and Entailment Logicians typically think in terms of models, with respect to which truth can be evaluated model: a possible world We say m is a model of a sentence α if α is true in m M( α ) is the set of all models of α Then KB ╞ α iff M(KB)  M( α ) E.g. KB = I am smart and you are pretty α = I am smart

14 Models and Entailment in the Wumpus World Situation after detecting nothing in [1,1], moving right, breeze in [2,1] Consider possible models for KB assuming only pits 3 Boolean choices  8 possible models

15 Wumpus Models

16 Wumpus Models KB = wumpus-world rules + observations

17 Wumpus Models α 1 = "[1,2] is safe", KB ╞ α 1 proved by model checking

18 Wumpus Models α 2 = "[2,2] is safe", KB ╞ α 2

19 Inference Algorithm An inference algorithm i is a procedure that derives sentences from a knowledge base: KB ├ i s i is sound if it derives only entailed sentences i is complete if it can derive any sentence that is entailed

20 Propositional Logic (PL) PL: logic that consists of proposition symbols and connectives Each symbol is either true or false Syntax: describes how the symbols and connectives form sentences Semantics: describes rules for determining the truth of a sentence wrt to a model

21 Syntax A sentence in Propositional Logic is either Atomic or Complex Atomic Sentence Symbol: e.g., P, Q, R, … True False Complex Sentence Let S and T be sentences (atomic or complex) The following are also sentences:  S, S  T, S  T, S  T, S  T

22 Connectives  S: negation if P is a symbol, P and  P are called literals S  T: conjunction S and T are called conjuncts S  T: disjunction S and T are called disjuncts S  T: implication S is called the premise, T is called the conclusion S  T: biconditional

23 Back to the Wumpus World Start with a vocabulary of proposition symbols, for example: P i,j : there is a pit in room [i,j] B i,j : there is a breeze in room [i,j] Sample sentences (could be true or false) P 1,2 B 2,2   P 2,3 P 4,3  B 3,3  B 4,2  B 4,4  P 3,4   B 1,3 Note issue of precedence with connectives

24 Semantics Truth of symbols are specified in the model Truth of complex sentences can be determined using truth tables

25 Knowledge Base for the Wumpus World Rules constitute the initial KB and can be expressed in PL; for example:  P 1,1 P 4,4  B 3,4  B 4,3 As the agent progresses, it can perceive other facts and incorporate it in its KB; for example:  B 1,1 if it doesn’t perceive a breeze in room [1,1] B 2,1 if it perceives a breeze in room [2,1] Can view the KB as a conjunction of all sentences asserted as true so far

26 Inference in the Wumpus World We want to decide on the existence of pits in the rooms; i.e. does KB ╞ P i,j ? Suppose we have already perceived  B 1,1 and B 2,1 KB contains the rules and these facts What can we say about: P 1,1, P 1,2, P 2,1, P 2,2, P 3,1 ?

27 Truth Table Depicting 128 Possible Models

28 Inference Examples KB is true when the rules hold—only for three rows in the table The three rows are models of KB Consider the value of P 1,2 for these 3 rows P 1,2 is false in all rows (the rows are models of α 1 =  P 1,2 ) Thus, there is no pit in room [1,2] Consider the value of P 2,2 for these 3 rows P 1,2 false in one row, true for 2 rows Thus, there may be a pit in room [2,2]

29 Inference by Enumeration We want an algorithm that determines whether KB entails some sentence α Strategy: Enumerate all possible models (true-false combinations of symbols in KB) Consider only those models of KB (models where KB is true) Return true if α is true for all such models

30 Inference by Enumeration

31 Analysis Inference by Enumeration is sound and complete By definition of sound and complete Runs in exponential time - O(2 n ) Requires linear space - O(n)

32 To be continued… What’s next? Other Logical Inference Algorithms: can’t really do better than exponential, but there are algorithms that do reasonably better in practice First-order Logic (FOL): deals with a world of objects, functions, and relations, rather than just facts (PL)