Category : Files from Magazines
Archive   : AIOCT86.ZIP
Filename : INSIDE3.LTG

 
Output of file : INSIDE3.LTG contained in archive : AIOCT86.ZIP

LISTING 3

;;; Production System. Copyright Raul E. Valdes-Perez, 1986. All Rights Reserved.
;;; USER FUNCTIONS ARE:
;;; (defrule name lhs rhs)
;;; (fact datum)
;;; (data)
;;; (run)
;;; (see-rule rule)
;;;
;;; GLOBAL VARIABLES ARE:
;;; *rules*
;;; *facts*

(defun defrule (name lhs rhs)
(prog (rule)
(setq rule (gensym 'r))
(putprop rule name 'name)
(putprop rule (cdr (assoc 'patterns lhs)) 'patterns)
(putprop rule (cdr (assoc 'assert rhs)) 'assert)
(putprop rule (cdr (assoc 'delete rhs)) 'delete)
(setq *rules* (cons rule *rules*))))

;;; user adds a fact
(defun fact (datum)
(add-fact datum 'user))

(defun add-fact (datum origin)
(prog (fact)
(setq fact (gensym 'f))
(putprop fact datum 'datum)
(putprop fact origin 'origin)
(setq *facts* (cons fact *facts*))))

;;; print data in working memory
(defun data ()
(data2 *facts*))

(defun data2 (f)
(cond ((null f) nil)
(t (pr (get (car f) 'datum))
(data2 (cdr f)))))


  3 Responses to “Category : Files from Magazines
Archive   : AIOCT86.ZIP
Filename : INSIDE3.LTG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/