;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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.4" 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 find-sum arg1 arg2 sum)

(addwm
 (success
  isa chunk)
 (two 
  isa chunk)
 (four 
  isa chunk)
 (six
  isa chunk)
 (example2 
  isa dependency 
  goal goal6 
  modified nil
  stack success)
 (goal6 
  isa find-sum 
  arg1 two 
  arg2 four 
  sum six))

(goal-focus example2)

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