;;; Common Lisp Programming for Artificial Intelligence
;;; Tony Hasemer & John Domingue
;;;
;;; pag. 159
;;;
;;; In 1969 A. M. Collins and M. R. Quilliam published their conclusions about how human memory might work, based upon their own experimental data...
(defmacro name(x) `(car ,x) )
(defmacro parent(x) `(cadr ,x) )
(defmacro attributes(x) `(caddr ,x) )
(defstruct node
(parent nil)
(attributes nil) )
(defun create-node(name parent &optional attributes)
(setf (symbol-value name)
(make-node :parent parent :attributes attributes) ) )
(defun make-tree(data)
(mapc #'(lambda(object)
(create-node (name object) (parent object) (attributes object) ) )
data ) )
(make-tree '((root nil)
(physical-entity root)
(living-thing physical-entity)
(carnivore living-thing ((eats meat)))
(human carnivore ((has soul)))
(woman human)
(man human)
(queen-elizabeth woman)
(prince-philip man)
(mother woman)
(father man) ))