Practical Cognition — first pass
This will be a reflexive agent. That is, it does no real practical reasoning. It responds to new beliefs with built-in reflexes.
For this we need a list *reflexes*, which will be an a-list, i.e., a list of pairs (new-belief action).
COGNIZE-PRACTICALLY will simply match new-beliefs with the car’s of the pairs, and when a match is found it will execute the action. For action execution, we will just print the action.
(proclaim '(special *reflexes*))
(defun cognize-practically ()
(dolist (P *new-beliefs*)
(let ((A (cadr (assoc P *reflexes* :test 'equal))))
(when A (princ "performing action: ") (princ A) (terpri))))
(setf *new-beliefs* nil))