We've been at logical agents for a few weeks, and it's time to
deliver; here's an example from the AIMA Lisp code for telling a
knowledge base about the Wumpus world and asking questions:
"Use the KB to solve the `Wumpus at [1,3]' problem [p 174-176]."
"This builds a KB with 12 propositional symbols -- about the max."
"you can do without starting to slow down."
((setq kb1 (make-prop-kb)))
"The initial state of knowledge"
((tell kb1 "~S11 ^ ~S21 ^S12 ^ ~B11 ^ B21 ^ ~B12"))
"Rules R1 through R4"
((tell kb1 "~S11 => ~W11 ^ ~W12 ^ ~W21"))
((tell kb1 "~S21 => ~W11 ^ ~W21 ^ ~W22 ^ ~W31"))
((tell kb1 "~S12 => ~W11 ^ ~W12 ^ ~W22 ^ ~W13"))
((tell kb1 "S12 => W13 | W12 | W22 | W11"))
"Now the query -- this may take a while."
((ask kb1 "W13") *)
See page 270 for a hybrid logical-A* agent. I'll try to use my DPLL
solver and Ryan may try to use core.logic (i.e. mini-Kanren).