;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; ACT-R 4.0 model for demonstrating an analogy feature 
;;; to run the model, load the model and call
;;; (run)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; This section contains the interface for the WWW using the
;;; ACT-R on the Web application by Elmar Schwarz


(defvar *WWW-interface*)

(setf  *WWW-interface* 
      '((:heading "Analogy Example Table 4.5" 2)
        (:new-para)
        
        (:button "Run model" "(progn 
                               (reset)
                               (run)
                           (format *standard-output* \"~%New production:~%~%\")
                              
                              (dolist (x (no-output (pp)))
                                  (unless (equal x 'study-dependency)
                                      (pp-fct (list x)))))")
        (:button "Production Rules" "(let ((prods (no-output (pp))))
                                       (dolist (x prods)
                                         (pp-fct (list x))
                                         (spp-fct (list x))
                                         (format *standard-output* \"~%\")))")
        (:button "Chunk types" "(chunk-type)")
        (:button "Chunks" "(dm)")
        ))

;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;

(clearall)

(sgp :v t)

(wmetype calculate-product arg1 arg2 product)

(addwm
 (zero
  isa chunk)
 (five
  isa chunk)
 (example3
  isa dependency
  goal goal7
  modified goal8
  specifics zero)
 (goal7 
  isa calculate-product
  arg1 five
  arg2 zero
  product nil)
 (goal8
  isa calculate-product
  arg1 five
  arg2 zero
  product zero))

(goal-focus example3)

(p study-dependency
   =goal>
      isa dependency
==>
   !pop!
)