;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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.3" 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 answer-query arg1 arg2 relation answer)
(wmetype find-sum arg1 arg2 sum count)
(wmetype say arg)

(addwm
 (two 
  isa chunk)
 (four
  isa chunk)
 (answer
  isa chunk)
 (zero
  isa chunk)
 (sum 
  isa chunk)
 (six 
  isa chunk)
 (example1 
  isa dependency 
  goal goal3 
  modified goal4
  stack goal5)
 (goal3 
  isa answer-query 
  arg1 two 
  arg2 four 
  relation sum)
 (goal4 
  isa say 
  arg six)
 (goal5 
  isa find-sum 
  arg1 two 
  arg2 four 
  sum six 
  count zero))

(goal-focus example1)

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