(defun cognize-epistemically ()
(when *new-beliefs*
(let ((unprocessed-beliefs *new-beliefs*))
(loop
(let ((P (first unprocessed-beliefs)))
;; make all the inferences you can from the first
;; unprocessed belief
(let ((conclusions (make-inferences-from P)))
;; Move P from the list of unprocessed beliefs
;; to the list of beliefs.
(setf unprocessed-beliefs (cdr unprocessed-beliefs))
(setf *beliefs* (cons P *beliefs*))
;; add all new conclusions to the list of unprocessed
;; beliefs and the list of new-beliefs.
(when conclusions
(dolist (Q conclusions) (princ "I have concluded that ") (princ Q) (terpri))
(setf unprocessed-beliefs
(append unprocessed-beliefs conclusions))
(setf *new-beliefs* (append *new-beliefs* conclusions)))
;; when the list of unprocessed beliefs is exhausted,
;; exit the loop. Otherwise go around again.
(when (null unprocessed-beliefs) (return))))))))
Previous slide | Next slide | Back to first slide | View graphic version |