Presentation is loading. Please wait.

Presentation is loading. Please wait.

A toy world for logical exploration The Wumpus example.

Similar presentations


Presentation on theme: "A toy world for logical exploration The Wumpus example."— Presentation transcript:

1 A toy world for logical exploration The Wumpus example

2 D. Goforth, fall 20062 1 4 1 4 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 >

3 D. Goforth, fall 20063 1 4 1 4 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 D. Goforth, fall 20064 1 4 1 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 ^

5 D. Goforth, fall 20065 Wumpus world  Agent goal: get gold and get out alive  Agent actions: Move forward one square in current direction (Fwd) Turn left or right 90 o (TL,TR) Shoot arrow in current direction Grab gold  Agent perceptions at each location: [Stench, Breeze, Glitter, Bump, Scream]

6 D. Goforth, fall 20066 1 4 1 4 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 >

7 D. Goforth, fall 20067 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 D. Goforth, fall 20068 Wumpus world in propositional logic  Facts are propositions: e.g., W 44 “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., W 44  (S 44  S 43  S 34 ) “if the wumpus is at (4,4), there is stench at (4,4), (4,3) and (3,4)” “many” sentences

9 D. Goforth, fall 20069 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 D. Goforth, fall 200610 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 D. Goforth, fall 200611 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 D. Goforth, fall 200612 Wumpus world in FOL  the basic knowledge atomic sentences: predicates, term=term  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 D. Goforth, fall 200613 Wumpus world in FOL  the basic knowledge atomic sentences: predicates, term=term  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 D. Goforth, fall 200614 Wumpus world in FOL  the basic knowledge atomic sentences: predicates, term=term  term = term: (true or false) Home(Wumpus) = [3,3] Heading(5) = U

15 D. Goforth, fall 200615 Wumpus world in FOL  the knowledge base General knowledge Facts that are fixed Facts that may change over time Atomic sentences Compound sentences

16 D. Goforth, fall 200616 Wumpus world in FOL  the knowledge base General knowledge Facts that are constant Facts that may change over time

17 D. Goforth, fall 200617 Exploring Wumpus world in FOL Initial conditions: known unknown After first perception P 0, action A 0 : knownnew unknown P0P0 A0A0

18 D. Goforth, fall 200618 Exploring Wumpus world in FOL After first perception P 0, action A 0 : knownnew unknown P0P0 A0A0 After second perception P 1, action A 1 P1P1 A1A1

19 D. Goforth, fall 200619 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([Stench,None, None, None, None],0)

20 D. Goforth, fall 200620 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 D. Goforth, fall 200621 Exploring Wumpus world in FOL Updating timed knowledge: All atomic sentences may be different from t to t+1 BUT Most are the same UNLESS An action changes them ∀ r ∀ t At(r,t)  (  BestAction(Forward,t)  (Bumped(t+1)) ⇒ At(r,t+1) ∀ t Screams(t) ⇒  Alive(Wumpus,t) Time t Time t+1

22 D. Goforth, fall 200622 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)]


Download ppt "A toy world for logical exploration The Wumpus example."

Similar presentations


Ads by Google