Computer Science 315
Artificial Intelligence

Assignment 4 - AIMIA Chapter 7: Logical Agents & Wumpus World

Ooooh that smell
Can't you smell that smell


Lynyrd Skynyrd, "That Smell" (1977)

Due Friday, 26 October

As promised/threatened, I have written a Prolog implementation of Wumpus World, available as wumpg.P. You can try this program out by saving it to disk and running XSB Prolog1 :
% xsb 
... 
| ?- consult(wumpg). 
[wumpg loaded] 
yes 
| ?- play(human). 
0 > f. 
You feel a breeze. 
1 > l. 
You feel a breeze. 
2 > f. 
3 > f. 
You perceive a stench. 
You feel a breeze. 
You perceive a glitter. 
4 > 
Note that you have to type a period to end each action command (f orward, l eft turn, r ight turn, s hoot arrow, g rab gold, c limb out), and that the prompt shows the current time step.

For extra fun, you can run the program with a GUI, including sound. Just save and unzip this file, cd to the wumpus directory, and type
make hrun
at the Linux prompt. Typing make arun will run whatever version of wumpa.P lives in the directory.

Your task is to write and email me a completed wumpa.P, containing a set of Prolog predicates to implement the Wumpus-hunting agent. Specifically, you will have to write the tell/7, ask/3, and tell/3 predicates, which implement something like the algorithm in Figure 6.1 (page 152). If you want your agent to work with the GUI version, you will also have to implement ask_pit/2 and ask_wumpus/2. To help you get started, I have written a brain-dead version, which you can try out by telling XSB play(agent) instead of play(human). This agent will simply ignore the percepts passed to it in tell/7, and return the f(orward) ac- tion, causing it to run into a pit and die. There is no "correct" solution to this problem; instead, I am interested in seeing what people will come up with, and whether anyone can solve the problem. I have set up the world to appear as in Figure 6.2 (page 154), but will test your code using other configurations. So your agent should work generally, and not rely on that configuration being used.

Have fun, and watch out for the Wu-AAAAAAAAARRRGH!


1To get the latest version of XSB, put the following line at the end of the .bashrc file in your home directory:
PATH=/home/courses/cs315/shared/XSB/bin:$PATH