A toy world for logical exploration - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

A toy world for logical exploration

Description:

Pits and breeze. Gold and glitter. Movement and location, direction and bumps ... percepts: Stench, Breeze, Glitter, Bump, Scream, None ... – PowerPoint PPT presentation

Number of Views:107
Avg rating:3.0/5.0
Slides: 23
Provided by: davidg89
Category:

less

Transcript and Presenter's Notes

Title: A toy world for logical exploration


1
The Wumpus example
  • A toy world for logical exploration

2
Wumpus world
  • A four by four cave with locations identified by
    coordinates (3,4), etc.
  • Agent is at a location, facing a particular
    direction (L,R,D,U)
  • Agent starts at (1,1) facing R

4
gt
1
1
4
3
Wumpus world
  • In the cave is
  • A wumpus that smells
  • It can kill the agent if at same location
  • It can be killed by the agent shooting an arrow
    if facing the wumpus. When the wumpus dies, it
    SCREAMs

4

1
1
4
4
Wumpus world
  • In the cave are
  • 3 Pits. Breezes blow from pits.
  • If an agent steps into a pit, it falls to its
    death.
  • A heap of gold that glitters

4

1
1
4
5
Wumpus world
  • Agent goal
  • get gold and get out alive
  • Agent actions
  • Move forward one square in current direction
    (Fwd)
  • Turn left or right 90o (TL,TR)
  • Shoot arrow in current direction
  • Grab gold
  • Agent perceptions at each location
  • Stench, Breeze, Glitter, Bump, Scream

6
Wumpus world
  • Cave is created randomly (location of wumpus,
    pits and gold)
  • Perception / action loop
  • Agent must construct a model knowledge base
    about the cave as it tries to achieve its goal

4
gt
1
1
4
7
Wumpus world knowledge
  • General knowledge (known at start)
  • Location and direction
  • Living
  • Grab and holding
  • Wumpus and stench, shooting, scream, life
  • Pits and breeze
  • Gold and glitter
  • Movement and location, direction and bumps
  • Starting state of agent
  • Goal
  • Facts (not known)
  • Location of wumpus, pits, gold

8
Wumpus world in propositional logic
  • Facts are propositions
  • e.g., W44 Wumpus is at square (4,4)
  • 96 propositions (16 each for wumpus, stench, pit,
    breeze, gold, glitter) to represent a particular
    cave
  • General knowledge in sentences
  • e.g., W44?(S44 ? S43 ? S34) if the wumpus is at
    (4,4), there is stench at (4,4), (4,3) and (3,4)
  • many sentences

9
Wumpus world in propositional logic
  • Facts that may change
  • Location of agent, direction of agent
  • Agent holding gold
  • Agent has shot arrow
  • Agent, wumpus are alive
  • ?timed logic
  • ?proliferation of propositions

10
Wumpus world in FOL
  • the objects in the environment
  • terms constants, variables, functions
  • constants
  • times 0, 1, 2, ...
  • headings R, L, D, U
  • coordinates 1, 2, 3, 4
  • locations 16 squares
  • percepts Stench, Breeze, Glitter, Bump, Scream,
    None
  • actions Turn(Left), Turn(Right), Forward, Grab,
    Shoot
  • Agent, Wumpus

11
Wumpus world in FOL
  • the objects in the environment
  • terms constants, variables, functions
  • functions
  • Square(x,y) // x,y p.259
  • Home(Wumpus)
  • Perception(s, b, g, h, y) // s, b, g, h, y
    p.258
  • Heading(t), Location(t)

12
Wumpus world in FOL
  • the basic knowledge
  • atomic sentences predicates, termterm
  • predicates (true or false)
  • properties (of one term/object)
  • Breezy(t) // agent feeling breeze at time t
  • Breeze(s) // breeze blowing on square s
  • Pit(s), Gold(s), etc.
  • Time(x) // object x is a time
  • Coordinate(x), Action(x), Heading(x), etc.

13
Wumpus world in FOL
  • the basic knowledge
  • atomic sentences predicates, termterm
  • predicates (true or false)
  • relations (of multiple terms/objects)
  • At(s,t) // agent on square s at time t
  • Adjacent (r,s) // squares r and s are adjacent
  • Alive(x,t) // x is alive at time t
  • Percept(p,t) // perception at time t
  • BestAction(a,t) // action a to take at time t

compare with p.259
14
Wumpus world in FOL
  • the basic knowledge
  • atomic sentences predicates, termterm
  • term term (true or false)
  • Home(Wumpus) 3,3
  • Heading(5) U

15
Wumpus world in FOL
  • the knowledge base
  • General knowledge
  • Facts that are fixed
  • Facts that may change over time

Compound sentences
Atomic sentences
16
Wumpus world in FOL
  • the knowledge base
  • General knowledge
  • Facts that are constant
  • Facts that may change over time

17
Exploring Wumpus world in FOL
Initial conditions known unknown
After first perception P0, action
A0 known new unknown
P0
A0
18
Exploring Wumpus world in FOL
After first perception P0, action
A0 known new unknown
After second perception P1, action A1
P0
P1
A0
A1
19
Exploring Wumpus world in FOL
Timed atomic sentences Initial
conditions At(1,1,0) Heading(R,0) Alive(Agent,0)
Alive(Wumpus,0) then First perception Percept(S
tench,None, None, None, None,0)
20
Exploring Wumpus world in FOL
Percept(Stench, None, None, None,
None,0) Understanding what is perceived ?b ?g ?h
?y ?t Percept(Stench,b,g, h, y,t)?Stinky(t) ?s
?g ?h ?y ?t Percept(s,None,g, h,
y,t)??Glittery(t) Stinky(0) ?Glittery(0) ?r ?t
Stinky(t) ? At(r,t) ? Stinks(r) ?r ?t
?Glittery(t) ? At(r,t) ? ?Glitters(r) Stinks(1,1
) ?Glitters (1,1)
Fixed knowledge
21
Exploring Wumpus world in FOL
Updating timed knowledge All atomic sentences
may be different from t to t1 BUT Most are the
same UNLESS An action changes them ?r ?t At(r,t)
? (?BestAction(Forward,t) ? (Bumped(t1))
?At(r,t1) ?t Screams(t) ? ?Alive(Wumpus,t)
Time t
Time t1
22
Exploring Wumpus world in FOL
Deciding the best action (incomplete description
here) Need to reason about the cave
conditions Diagnostic rules (p.259) ?s Breezy(s)
? ?r Adjacent(r,s) ? Pit(r) Causal rules
(p.260) ?r Pit(r) ? ?s Adjacent(r,s) ?
Breezy(s)
Write a Comment
User Comments (0)
About PowerShow.com