The Wumpus World was introduced by Genesereth, and is discussed in Russell-Norvig. The Wumpus World is a simple world (as is the Block World) for which to represent knowledge and to reason.

It is a cave with a number of rooms, represented as a 4x4 square.

+---------+---------+---------+---------+ 4 | stench | | breeze | pit | | | | | | | | | | | +---------+---------+---------+---------+ 3 | wumpus | stench | pit | breeze | | | breeze | | | | | gold | | | +---------+---------+---------+---------+ 2 | stench | | breeze | | | | | | | | | | | | +---------+---------+---------+---------+ 1 | start | breeze | pit | breeze | | | | | | | ==> | | | | +---------+---------+---------+---------+ 1 2 3 4

In a square the agent gets a vector of percepts, with components

**Stench,Breeze,Glitter,Bump,Scream**

- Stench is perceived at a square iff the wumpus is at this square or in its neighborhood.
- Breeze is perceived at a square iff a pit is in the neighborhood of this square.
- Glitter is perceived at a square iff gold is in this square
- Bump is perceived at a square iff the agent goes Forward into a wall
- Scream is perceived at a square iff the wumpus is killed anywhere in the cave

An agent can do the following actions (one at a time):

**Turn(Right), Turn(Left), Forward, Shoot, Grab, Release, Climb**

- The agent can go Forward in the direction it is currently facing, or Turn Right, or Turn Left. Going Forward into a wall will generate a Bump percept.
- The agent has a single arrow that it can Shoot. It will go straight in the direction faced by the agent until it hits (and kills) the wumpus, or hits (and is absorbed by) a wall.
- The agent can Grab a portable object at the current square or it can Release an object that it is holding.
- The agent can Climb out of the cave if at the Start square.

The objective of the game is to kill the wumpus, to pick up the gold, and to climb out with it.

We will limit our discussion of the Situation Calculus to the case of the Wumpus World.

We deal with the frame problem by introducing a certain number of axioms, that go by names such as Effect Axioms, Frame Axioms, and Successor-State Axioms.

**Percept(x,y)**- where x must be a percept vector and y must be a situation.
It means that at situation y the agent perceives x.

For convenience we introduce the following definitions:- Percept([Stench,y,z,w,v],t) = > Stench(t)
- Percept([x,Breeze,z,w,v],t) = > Breeze(t)
- Percept([x,y,Glitter,w,v],t) = > AtGold(t)

**Holding(x,y)**- where x is an object and y is a situation. It means that the agent is holding the object x in situation y.
**Action(x,y)**- where x must be an action (i.e. Turn(Right), Turn(Left), Forward, ..) and y must be a situation. It means that at situation y the agent takes action x.
**At(x,y,z)**- where x is an object, y is a Location, i.e. a pair [u,v] with u and v in {1,2,3,4}, and z is a situation. It means that the agent x in situation z is at location y.
**Present(x,s)**- means that object x is in the current room in the situation s.
**Result(x,y)**- It means that the result of applying action x to the situation y is the
situation Result(x,y). Note that Result(x,y) is a term, not a statement.

For example we can say- Result(Forward, S0) = S1
- Result(Turn(Right),S1) = S2

These definitions could be made more general. Since in the Wumpus World
there is a single agent, there is no reason for us to make predicates and
functions relative to a specific agent. In other "worlds" we should change
things appropriately.

Another generalization is possible, to write all assertions
about the world as terms, and then add the predicates

**T(situation assertion-term)**- to mean that in the specified situation the specified assertion is true.
**Belief(agent situation assertion-term)**- to mean that the specified agent in the specified situation believes the specified assertion to be true.

- Present(x,s) & Portable(x) = > Holding(x, Result(Grab,s))
- Not Holding(x, Result(Release,s))

- Holding(x,s) & (a/=Release) = > Holding(x,Result(a,s))
- NOT Holding(x,s) & ((a/=Grab)) | NOT(Present(x,s) & Portable(x)) = > NOT Holding(x,Result(a,s))

- Holding(x,Result(a,s)) IFF [(a=Grab & Present(x,s) & Portable(x)) OR (Holding(x,s) & (a/=Release))

- Orientation(Agent,s0) = 0
- At(Agent,[1,1],s0)
- Portable(Gold)
- AtGold(s) = > Present(Gold, s)
- LocationToward([x,y],0) = [x+1,y]
- LocationToward([x,y],90) = [x,y+1]
- LocationToward([x,y],180) = [x-1,y]
- LocationToward([x,y],270) = [x,y-1]
- At(p,l,s) = > LocationAhead(p,s) = LocationToward(l, Orientation(p,s))
- Adjacent(l1,l2) IFF EXISTS d (l1 = LocationToward(l2,d))
- Wall([x,y]) IFF (x=0 OR x=5 OR y=0 OR y=5)
- At(p,l,Result(a,s)) IFF [(a=Forward & l=LocationAhead(p,s) & NOT Wall(l)) OR (At(p,l,s) & a/=Forward)]
- Orientation(p,Result(a,s))=d IFF [

(a=Turn(Right) & d=Mod(Orientation(p,s)-90,360)) OR

(a=Turn(Left) & d=Mod(Orientation(p,s)+90,360)) OR

(Orientation(p,s)=d & NOT(a=Turn(Right) & a=Turn(Left)))] - At(Wumpus.l1,s) & Adjacent(l1,l2) = > Smelly(l2)
- At(Pit,l1,s) & Adjacent(l1,l2) = > Breezy(l2)

- At(Wumpus,l1,s) & Adjacent(l1,l2) = > Smelly(l2)
- At(Pit,l1,s) & Adjacent(l1,l2) = > Breezy(l2)

- At(Agent,l,s) & Breeze(s) = > Breezy(l)
- At(Agent,l,s) & Stench(s) = > Smelly(l)
- Smelly(l1) = > (EXISTS l2 At(Wumpus,l2,s) & (l2=l1 OR Adjacent(l1,l2)))
- At(Wumpus,x,t) & NOT Pit(x) IFF OK(x)

- Have we specified enough axioms about the Wumpus World for us to solve our stated problem?
- How does one acquire the needed domain knowledge about the Wumpus World?
- How much of the work done for this world can be used when studying other worlds?
- Clearly we could write an algorithm that would solve the Wumpus problem in an ad-hoc fashion. Is the approach that we have chosen ultimately more general, more effective than the use ad-hoc prescriptive procedures?

ingargiola@cis.temple.edu