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
> (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
;; Loading file unify.lisp ...
;; Loaded file unify.lisp
;; Loading file normal.lisp ...
;; Loaded file normal.lisp
;; Loading file infix.lisp ...
;; Loaded file infix.lisp
;; Loading file prop.lisp ...
;; Loaded file prop.lisp
;; Loading file tell-ask.lisp ...
;; Loaded file tell-ask.lisp
;; CREATE AN INITIAL KNOWLEDGE BASE
>(setf kb (make-prop-kb))
#S(PROP-KB :SENTENCE (AND))
;; ASSERT THAT A IS TRUE
> (tell kb "A")
;; ASSERT THAT RULE A AND B => C IS TRUE
> (tell kb "A & B => C")
;; ASK IF C IS TRUE (NIL INDICATES FALSE)
> (ask kb "C")
;; ASSERT B IS TRUE
> (tell kb "B")
;; ASK IF C IS TRUE (T INDICATES TRUE)
> (ask kb "C")
;; ASSERT RULE (A OR D) => E
> (tell kb "A | D => E")
;; ASK IF E IS TRUE (T INDICATES TRUE)
> (ask kb "E")
For this program you should write the following routines:
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.
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 firstname.lastname@example.org.