Docsity

Lecture Notes on Logical Agents - Artificial Intelligence | CSCI 538, Study notes of Computer Science

Partial preview of the text

Download Lecture Notes on Logical Agents - Artificial Intelligence | CSCI 538 and more Study notes Computer Science in PDF only on Docsity!

CSci 538: Artificial Intelligence

Spring 2007

Ch #7: Logical Agents

Derek Harter – Texas A&M University - Commerce Many slides over the course adapted from Srini Narayanan, Dan Klein, Stuart Russell or Andrew Moore

Logical Agents

 Reflex agents find their way from Arad to Bucharest by

dumb luck.

 Chess program calculates legal moves of its king, but

doesn’t know that no piece can be on 2 different squares

at the same time

 Logic (Knowledge-Based) agents combine

 general knowledge &

 current percepts

 to infer hidden aspects of current state prior to

selecting actions

 (^) Crucial in partially observable environments

Knowledge bases

 (^) Knowledge base = set of sentences in a formal language  (^) Declarative approach to building an agent (or other system):  (^) Tell it what it needs to know  (^) Then it can Ask itself what to do - answers should follow from the KB  (^) Agents can be viewed at the knowledge level i.e., what they know, regardless of how implemented  (^) Or at the implementation level  (^) i.e., data structures in KB and algorithms that manipulate them

A simple knowledge-based agent

 The agent must be able to:

 (^) Represent states, actions, etc.  (^) Incorporate new percepts  (^) Update internal representations of the world  (^) Deduce hidden properties of the world  (^) Deduce appropriate actions

Wumpus world characterization

 Fully Observable No – only local perception

 Deterministic Yes – outcomes exactly specified

 Episodic No – sequential at the level of actions

 Static Yes – Wumpus and Pits do not move

 Discrete Yes

 Single-agent? Yes – Wumpus is essentially a

natural feature

Exploring the Wumpus World

  • The KB initially contains the rules of the environment.
  • [1,1] The first percept is [ none, none,none,none,none ], Move to safe cell e.g. 2,
  • (^) [2,1] Breeze indicates that there is a pit in [2,2] or [3,1]
  • Return to [1,1] to try next safe cell

Exploring the Wumpus World

  • [2,2] Detect nothing Move to unvisited safe cell e.g. [2,3]
  • [2,3] Detect glitter , smell, breeze Thus… pick up gold Thus… pit in [3,3] or [2,4]

Logic in general

 Logics are formal languages for representing information

such that conclusions can be drawn

 Syntax defines the sentences in the language

 Semantics define the "meaning" of sentences;

 (^) i.e., define truth of a sentence in a world

 E.g., the language of arithmetic

 (^) x+2 ≥ y is a sentence; x2+y > {} is not a sentence  (^) x+2 ≥ y is true iff the number x+2 is no less than the number y  (^) x+2 ≥ y is true in a world where x = 7, y = 1  (^) x+2 ≥ y is false in a world where x = 0, y = 6

Schematic perspective

If KB is true in the real world, then any sentence α derived

from KB by a sound inference procedure is also true in the real world.

Models

 (^) Logicians typically think in terms of models, which are formally structured worlds with respect to which truth can be evaluated  (^) 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 = Giants won and Reds won α = Giants won

Wumpus models

Wumpus models

 KB = wumpus-world rules + observations

Wumpus models

 KB = wumpus-world rules + observations

Wumpus models

 KB = wumpus-world rules + observations

2

= "[2,2] is safe", KB ╞ α

2