CS 5541
Program 3 - Propositional Logic (Wumpus World)
Due December 7, 2010
40 points

Introduction

The Wumpus World operates by rules as laid out in the text book and in class. In this program we will practice a bit with representing knowledge in propositional logic. We will make use of a set of lisp routines defined for the textbook called the aima-lisp package. To make sure the routines needed will work with clisp I have created a zip file of the routines you will need at prog3.zip. These lisp routines once loaded provide a basic propositional logic interface. It provides basic propositional routines including tell and ask which allow a user to assert a proposition and to make a query. For example, you might do the following with this code:

;; LOAD ALL FILES
[1]> (load "utilities.lisp") (load "unify.lisp") (load "normal.lisp") (load "infix.lisp") (load "prop.lisp") (load "tell-ask.lisp")
;; Loading file utilities.lisp ...
;; Loaded file utilities.lisp
T
[2]>
;; Loading file unify.lisp ...
;; Loaded file unify.lisp
T
[3]>
;; Loading file normal.lisp ...
;; Loaded file normal.lisp
T
[4]>
;; Loading file infix.lisp ...
;; Loaded file infix.lisp
T
[5]>
;; Loading file prop.lisp ...
;; Loaded file prop.lisp
T
[6]>
;; Loading file tell-ask.lisp ...
;; Loaded file tell-ask.lisp
T

;; CREATE AN INITIAL KNOWLEDGE BASE
[7]>(setf kb (make-prop-kb))
#S(PROP-KB :SENTENCE (AND))

;; ASSERT THAT A IS TRUE
[8]> (tell kb "A")
T

;; ASSERT THAT RULE A AND B => C IS TRUE
[9]> (tell kb "A & B => C")
T

;; ASK IF C IS TRUE (NIL INDICATES FALSE)
[10]> (ask kb "C")
NIL

;; ASSERT B IS TRUE
[11]> (tell kb "B")
T

;; ASK IF C IS TRUE (T INDICATES TRUE)
[12]> (ask kb "C")
T

;; ASSERT RULE (A OR D) => E
[13]> (tell kb "A | D => E")
T

;; ASK IF E IS TRUE (T INDICATES TRUE)
[14]> (ask kb "E")
T

Implementation

For this program you should write the following routines:

Notes

Testing

Generate at least four sample sets of facts with at least ten facts in each case using wumpus worlds of different sizes and then test your routine using these samples. Then run your routines to represent those wumpus worlds and print out what the available spots to move are in that world using only logical queries.

What To Hand In

Hand in clean, nicely commented copies of all of your code (make sure to include the class code so we can tell if anything is changed). In addition, print out the data used to test your code and the corresponding results. Finally, email your code to me at rmaclin@d.umn.edu.