Artificial Intelligence II

CSE 5361 Section 001 Spring 2005

Homework 3

Due: March 24, 2005 (midnight). No late submissions accepted.

For this homework you will utilize a Java implementation of Prolog to help deduce the locations of pits and wumpii given information about breezes, pits and safe locations. The specific requirements are enumerated below.

  1. Download the Java implementation of Prolog here. There is a README file to get you started. You will be using the Prolog class inside your wumpus-world agent to perform logical reasoning.

  2. The wumpus.pl Prolog file that comes with the distribution contains the beginnings of a set of rules to deduce whether a location is unsafe (i.e., has a pit or wumpus). The one rule that is in the file pertains to the following configuration for detecting a pit.

    You will need to complete this file, adding the other three configurations for pit and the four configurations for wumpus. These rules may assume all relevant locations exist in the world. You may also assume the constraints on the possible worlds as specified in HW2. Optionally, you can add special rules pertaining to pits and wumpii along walls and dealing with obstacles (which are safe, but unreachable locations).

  3. You will need to integrate this capability into your agent from HW2. This will involve instantiating a Prolog class, reading in your wumpus.pl file, asserting relevant facts as they are perceived (breeze(X,Y), stench(X,Y), safe(X,Y), pit(X,Y), wumpus(X,Y) and possibly obstacle(X,Y)), and querying about the safety of specific locations, i.e., the locations you are contemplating moving to. The asserting of facts should be part of your UpdateState method, and the querying should be part of your ChooseAction method. Any mechanisms for achieving this capability that you had already implemented in HW2 should be removed.

  4. Update your design document from HW2 to reflect this new capability and any other changes you make.

  5. Submit your wumpus.pl file, all source code for your agent, and the design document in one zip file to me (holder@cse.uta.edu) by the above deadline. Also include in your submission a README file that describes what files are in your submission and any special instructions for building and running your agent. In addition to correct functionality and satisfaction of the above constraints, your submission will be graded based on good programming style and documentation.