;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; 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.2" 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 add-column number1 number2 answer sum)
(wmetype addition-fact arg1 arg2 sum)

(addwm
 (example0
  isa dependency
  goal goal1
  modified goal2
  constraints fact34)
 (three 
  isa chunk)
 (four 
  isa chunk)
 (seven
  isa chunk)
 (goal1
  isa add-column
  number1 three
  number2 four
  answer nil)
 (goal2
  isa add-column
  number1 three
  number2 four
  sum seven)
 (fact34
  isa addition-fact
  arg1 three
  arg2 four
  sum seven))

(goal-focus example0)

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