;;; ;;; Serial-Subtraction Model ;;; with ACT-R/A/C overlay ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Author: Isaac Councill ;;; Created: 10/14/01 ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; ;;; i. initializations (clear-all) (pre-appraise) (sgp :ACT NIL :MT NIL ) ;;; ii. serial subtraction model chunk types (chunk-type serial-subtraction column) (chunk-type subtraction-fact top bottom diff) (chunk-type subtract-column top bottom diff column note) (chunk-type number tens value units) (chunk-type index) (chunk-type next-info before after) (chunk-type memory-object row column value) (chunk-type current-number ones tens hundreds thousands) (chunk-type comparison bigger smaller) (chunk-type add-ten num sum) (chunk-type symbol) (chunk-type sub-by-count start count column note) (chunk-type distractor last-night fight morning) (chunk-type problem event) (chunk-type worry-event) (chunk-type reset-goal) ;;; iii. ss declarative memory elements (add-dm (ones ISA index) (tens ISA index) (hundreds ISA index) (thousands ISA index) (top ISA index) (bottom ISA index) (n1 ISA next-info before ones after tens) (n2 ISA next-info before tens after hundreds) (n3 ISA next-info before hundreds after thousands) (m1 ISA memory-object column ones row top value three) (m2 ISA memory-object column tens row top value five) (m3 ISA memory-object column hundreds row top value one) (m4 ISA memory-object column thousands row top value six) (number ISA current-number ones three tens five hundreds one thousands six) (m5 ISA memory-object column ones row bottom value seven) (m6 ISA memory-object column tens row bottom value zero) (m7 ISA memory-object column hundreds row bottom value zero) (m8 ISA memory-object column thousands row bottom value -) (- ISA symbol) (no-borrow ISA symbol) (borrow ISA symbol) (SF16-7 ISA subtraction-fact top sixteen bottom seven diff nine) (SF15-7 ISA subtraction-fact top fifteen bottom seven diff eight) (SF14-7 ISA subtraction-fact top fourteen bottom seven diff seven) (SF13-7 ISA subtraction-fact top thirteen bottom seven diff six) (SF12-7 ISA subtraction-fact top twelve bottom seven diff five) (SF11-7 ISA subtraction-fact top eleven bottom seven diff four) (SF10-7 ISA subtraction-fact top ten bottom seven diff three) (SF9-7 ISA subtraction-fact top nine bottom seven diff two) (SF8-7 ISA subtraction-fact top eight bottom seven diff one) (SF7-7 ISA subtraction-fact top seven bottom seven diff zero) (SF19-1 ISA subtraction-fact top nineteen bottom one diff eighteen) (SF18-1 ISA subtraction-fact top eighteen bottom one diff seventeen) (SF17-1 ISA subtraction-fact top seventeen bottom one diff sixteen) (SF16-1 ISA subtraction-fact top sixteen bottom one diff fifteen) (SF15-1 ISA subtraction-fact top fifteen bottom one diff fourteen) (SF14-1 ISA subtraction-fact top fourteen bottom one diff thirteen) (SF13-1 ISA subtraction-fact top thirteen bottom one diff twelve) (SF12-1 ISA subtraction-fact top twelve bottom one diff eleven) (SF11-1 ISA subtraction-fact top eleven bottom one diff ten) (SF10-1 ISA subtraction-fact top ten bottom one diff nine) (SF9-1 ISA subtraction-fact top nine bottom one diff eight) (SF8-1 ISA subtraction-fact top eight bottom one diff seven) (SF7-1 ISA subtraction-fact top seven bottom one diff six) (SF6-1 ISA subtraction-fact top six bottom one diff five) (SF5-1 ISA subtraction-fact top five bottom one diff four) (SF4-1 ISA subtraction-fact top four bottom one diff three) (SF3-1 ISA subtraction-fact top three bottom one diff two) (SF2-1 ISA subtraction-fact top two bottom one diff one) (SF1-1 ISA subtraction-fact top one bottom one diff zero) (SF9-0 ISA subtraction-fact top nine bottom zero diff nine) (SF8-0 ISA subtraction-fact top eight bottom zero diff eight) (SF7-0 ISA subtraction-fact top seven bottom zero diff seven) (SF6-0 ISA subtraction-fact top six bottom zero diff six) (SF5-0 ISA subtraction-fact top five bottom zero diff five) (SF4-0 ISA subtraction-fact top four bottom zero diff four) (SF3-0 ISA subtraction-fact top three bottom zero diff three) (SF2-0 ISA subtraction-fact top two bottom zero diff two) (SF1-0 ISA subtraction-fact top one bottom zero diff one) (SF0-0 ISA subtraction-fact top zero bottom zero diff zero) (zero ISA number value 0 tens zero units zero) (one ISA number value 1 tens zero units one) (two ISA number value 2 tens zero units two) (three ISA number value 3 tens zero units three) (four ISA number value 4 tens zero units four) (five ISA number value 5 tens zero units five) (six ISA number value 6 tens zero units six) (seven ISA number value 7 tens zero units seven) (eight ISA number value 8 tens zero units eight) (nine ISA number value 9 tens zero units nine) (ten ISA number value 10 tens one units zero) (eleven ISA number value 11 tens one units one) (twelve ISA number value 12 tens one units two) (thirteen ISA number value 13 tens one units three) (fourteen ISA number value 14 tens one units four) (fifteen ISA number value 15 tens one units five) (sixteen ISA number value 16 tens one units six) (seventeen ISA number value 17 tens one units seven) (eighteen ISA number value 18 tens one units eight) (nineteen ISA number value 19 tens one units nine) (c1 ISA comparison bigger nineteen smaller zero) (c2 ISA comparison bigger eighteen smaller zero) (c3 ISA comparison bigger seventeen smaller zero) (c4 ISA comparison bigger sixteen smaller zero) (c5 ISA comparison bigger fifteen smaller zero) (c6 ISA comparison bigger fourteen smaller zero) (c7 ISA comparison bigger thirteen smaller zero) (c8 ISA comparison bigger twelve smaller zero) (c9 ISA comparison bigger eleven smaller zero) (c10 ISA comparison bigger ten smaller zero) (c11 ISA comparison bigger nine smaller zero) (c12 ISA comparison bigger eight smaller zero) (c13 ISA comparison bigger seven smaller zero) (c14 ISA comparison bigger six smaller zero) (c15 ISA comparison bigger five smaller zero) (c16 ISA comparison bigger four smaller zero) (c17 ISA comparison bigger three smaller zero) (c18 ISA comparison bigger two smaller zero) (c19 ISA comparison bigger one smaller zero) (cf1 ISA comparison bigger zero smaller zero) (c20 ISA comparison bigger nineteen smaller one) (c21 ISA comparison bigger eighteen smaller one) (c22 ISA comparison bigger seventeen smaller one) (c23 ISA comparison bigger sixteen smaller one) (c24 ISA comparison bigger fifteen smaller one) (c25 ISA comparison bigger fourteen smaller one) (c26 ISA comparison bigger thirteen smaller one) (c27 ISA comparison bigger twelve smaller one) (c28 ISA comparison bigger eleven smaller one) (c29 ISA comparison bigger ten smaller one) (c30 ISA comparison bigger nine smaller one) (c31 ISA comparison bigger eight smaller one) (c32 ISA comparison bigger seven smaller one) (c33 ISA comparison bigger six smaller one) (c34 ISA comparison bigger five smaller one) (c35 ISA comparison bigger four smaller one) (c36 ISA comparison bigger three smaller one) (c37 ISA comparison bigger two smaller one) (cf2 ISA comparison bigger one smaller one) (c38 ISA comparison bigger nineteen smaller two) (c39 ISA comparison bigger eighteen smaller two) (c40 ISA comparison bigger seventeen smaller two) (c41 ISA comparison bigger sixteen smaller two) (c42 ISA comparison bigger fifteen smaller two) (c43 ISA comparison bigger fourteen smaller two) (c44 ISA comparison bigger thirteen smaller two) (c45 ISA comparison bigger twelve smaller two) (c46 ISA comparison bigger eleven smaller two) (c47 ISA comparison bigger ten smaller two) (c48 ISA comparison bigger nine smaller two) (c49 ISA comparison bigger eight smaller two) (c50 ISA comparison bigger seven smaller two) (c51 ISA comparison bigger six smaller two) (c52 ISA comparison bigger five smaller two) (c53 ISA comparison bigger four smaller two) (c54 ISA comparison bigger three smaller two) (cf3 ISA comparison bigger two smaller two) (c55 ISA comparison bigger nineteen smaller three) (c56 ISA comparison bigger eighteen smaller three) (c57 ISA comparison bigger seventeen smaller three) (c58 ISA comparison bigger sixteen smaller three) (c59 ISA comparison bigger fifteen smaller three) (c60 ISA comparison bigger fourteen smaller three) (c61 ISA comparison bigger thirteen smaller three) (c62 ISA comparison bigger twelve smaller three) (c63 ISA comparison bigger eleven smaller three) (c64 ISA comparison bigger ten smaller three) (c65 ISA comparison bigger nine smaller three) (c66 ISA comparison bigger eight smaller three) (c67 ISA comparison bigger seven smaller three) (c68 ISA comparison bigger six smaller three) (c69 ISA comparison bigger five smaller three) (c70 ISA comparison bigger four smaller three) (cf4 ISA comparison bigger three smaller three) (c71 ISA comparison bigger nineteen smaller four) (c72 ISA comparison bigger eighteen smaller four) (c73 ISA comparison bigger seventeen smaller four) (c74 ISA comparison bigger sixteen smaller four) (c75 ISA comparison bigger fifteen smaller four) (c76 ISA comparison bigger fourteen smaller four) (c77 ISA comparison bigger thirteen smaller four) (c78 ISA comparison bigger twelve smaller four) (c79 ISA comparison bigger eleven smaller four) (c80 ISA comparison bigger ten smaller four) (c81 ISA comparison bigger nine smaller four) (c82 ISA comparison bigger eight smaller four) (c83 ISA comparison bigger seven smaller four) (c84 ISA comparison bigger six smaller four) (c85 ISA comparison bigger five smaller four) (cf5 ISA comparison bigger four smaller four) (c86 ISA comparison bigger nineteen smaller five) (c87 ISA comparison bigger eighteen smaller five) (c88 ISA comparison bigger seventeen smaller five) (c89 ISA comparison bigger sixteen smaller five) (c90 ISA comparison bigger fifteen smaller five) (c91 ISA comparison bigger fourteen smaller five) (c92 ISA comparison bigger thirteen smaller five) (c93 ISA comparison bigger twelve smaller five) (c94 ISA comparison bigger eleven smaller five) (c95 ISA comparison bigger ten smaller five) (c96 ISA comparison bigger nine smaller five) (c97 ISA comparison bigger eight smaller five) (c98 ISA comparison bigger seven smaller five) (c99 ISA comparison bigger six smaller five) (cf6 ISA comparison bigger five smaller five) (c100 ISA comparison bigger nineteen smaller six) (c101 ISA comparison bigger eighteen smaller six) (c102 ISA comparison bigger seventeen smaller six) (c103 ISA comparison bigger sixteen smaller six) (c104 ISA comparison bigger fifteen smaller six) (c105 ISA comparison bigger fourteen smaller six) (c106 ISA comparison bigger thirteen smaller six) (c107 ISA comparison bigger twelve smaller six) (c108 ISA comparison bigger eleven smaller six) (c109 ISA comparison bigger ten smaller six) (c110 ISA comparison bigger nine smaller six) (c111 ISA comparison bigger eight smaller six) (c112 ISA comparison bigger seven smaller six) (cf7 ISA comparison bigger six smaller six) (c113 ISA comparison bigger nineteen smaller seven) (c114 ISA comparison bigger eighteen smaller seven) (c115 ISA comparison bigger seventeen smaller seven) (c116 ISA comparison bigger sixteen smaller seven) (c117 ISA comparison bigger fifteen smaller seven) (c118 ISA comparison bigger fourteen smaller seven) (c119 ISA comparison bigger thirteen smaller seven) (c120 ISA comparison bigger twelve smaller seven) (c121 ISA comparison bigger eleven smaller seven) (c122 ISA comparison bigger ten smaller seven) (c123 ISA comparison bigger nine smaller seven) (c124 ISA comparison bigger eight smaller seven) (cf8 ISA comparison bigger seven smaller seven) (c125 ISA comparison bigger nineteen smaller eight) (c127 ISA comparison bigger eighteen smaller eight) (c128 ISA comparison bigger seventeen smaller eight) (c129 ISA comparison bigger sixteen smaller eight) (c130 ISA comparison bigger fifteen smaller eight) (c131 ISA comparison bigger fourteen smaller eight) (c132 ISA comparison bigger thirteen smaller eight) (c133 ISA comparison bigger twelve smaller eight) (c134 ISA comparison bigger eleven smaller eight) (c135 ISA comparison bigger ten smaller eight) (c136 ISA comparison bigger nine smaller eight) (cf9 ISA comparison bigger eight smaller eight) (c137 ISA comparison bigger nineteen smaller nine) (c138 ISA comparison bigger eighteen smaller nine) (c139 ISA comparison bigger seventeen smaller nine) (c140 ISA comparison bigger sixteen smaller nine) (c141 ISA comparison bigger fifteen smaller nine) (c142 ISA comparison bigger fourteen smaller nine) (c143 ISA comparison bigger thirteen smaller nine) (c144 ISA comparison bigger twelve smaller nine) (c145 ISA comparison bigger eleven smaller nine) (c146 ISA comparison bigger ten smaller nine) (cf10 ISA comparison bigger nine smaller nine) (t1 ISA add-ten num zero sum ten) (t2 ISA add-ten num one sum eleven) (t3 ISA add-ten num two sum twelve) (t4 ISA add-ten num three sum thirteen) (t5 ISA add-ten num four sum fourteen) (t6 ISA add-ten num five sum fifteen) (t7 ISA add-ten num six sum sixteen) (t8 ISA add-ten num seven sum seventeen) (t9 ISA add-ten num eight sum eighteen) (t10 ISA add-ten num nine sum nineteen) ;; some chunks relating to why the model might be worried (exam ISA distractor last-night study-not-enough fight with-sleep morning unprepared) (study-not-enough ISA problem event play-play-station-instead) (with-sleep ISA problem event give-up-and-goto-bed) (unprepared ISA problem event going-to-fail) (play-play-station-instead ISA worry-event) (give-up-and-goto-bed ISA worry-event) (going-to-fail ISA worry-event) (goal ISA serial-subtraction) (reset-goal isa reset-goal)) ;;; iv. productions ;; the worry production (P worry =goal> ISA subtract-column =distraction> ISA distractor last-night =d1 fight =d2 morning =d3 ==> !eval! (worry-light) !pop! ) (P stop-subtraction =goal> ISA subtract-column !eval! (>= (floor *time*) *stop-time*) ==> !eval! (post-appraise) !eval! (setf run-history t) !stop! ) ;; In the task we are modeling, the subject is corrected after ;; making a mistake (p reset-after-error =goal> ISA reset-goal =object1> ISA memory-object row top column ones value =val1 =object2> ISA memory-object row top column tens value =val2 =object3> ISA memory-object row top column hundreds value =val3 =object4> ISA memory-object row top column thousands value =val4 !bind! =o (gv units-parse) !bind! =t (gv tens-parse) !bind! =h (gv hunds-parse) !bind! =th (gv thous-parse) ==> =newgoal> ISA subtract-column column ones note no-borrow =object1> ISA memory-object row top column ones value =o =object2> ISA memory-object row top column tens value =t =object3> ISA memory-object row top column hundreds value =h =object4> ISA memory-object row top column thousands value =th !eval! (get-right-answer) (Actr-Time 4) !pop! !push! =newgoal ) (P start-subtraction =goal> ISA serial-subtraction column nil =object1> ISA memory-object row top column ones value =val1 =object2> ISA memory-object row top column tens value =val2 =object3> ISA memory-object row top column hundreds value =val3 =object4> ISA memory-object row top column thousands value =val4 !eval! (parse-answer) !bind! =o (gv units-parse) !bind! =t (gv tens-parse) !bind! =h (gv hunds-parse) !bind! =th (gv thous-parse) ==> =newgoal> ISA subtract-column column ones note no-borrow =goal> column tens =object1> ISA memory-object row top column ones value =o =object2> ISA memory-object row top column tens value =t =object3> ISA memory-object row top column hundreds value =h =object4> ISA memory-object row top column thousands value =th !push! =newgoal !eval! (get-right-answer) ) (P recall-number1 =goal> ISA subtract-column top nil column =col =object> ISA memory-object value =num1 row top column =col =num1> ISA number value =val ==> =goal> top =num1 !eval! (grid-highlight =val) ) (P recall-number2 =goal> ISA subtract-column bottom nil column =col =object> ISA memory-object value =num2 column =col row bottom ==> =goal> bottom =num2 ) (P simple-subtract-note-borrow-ones-dm =goal> ISA subtract-column column ones top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens one =diff> ISA number value =ans =col1> ISA memory-object column ones row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note borrow =current> ones =diff =col1> value =diff !eval! (proc-ans *answer* 3 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-note-borrow-tens-dm =goal> ISA subtract-column column tens top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens one =diff> ISA number value =ans =col2> ISA memory-object column tens row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note borrow =current> tens =diff =col2> value =diff !eval! (proc-ans *answer* 2 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-note-borrow-hundreds-dm =goal> ISA subtract-column column hundreds top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens one =diff> ISA number value =ans =col3> ISA memory-object column hundreds row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note borrow =current> hundreds =diff =col3> value =diff !eval! (proc-ans *answer* 1 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-note-borrow-thousands-dm =goal> ISA subtract-column column thousands top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens one =diff> ISA number value =ans =col4> ISA memory-object column thousands row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note borrow =current> thousands =diff =col4> value =diff !eval! (grid-highlight =ans) !eval! (proc-ans *answer* 0 =diff) ) (P simple-subtract-no-borrow-ones-dm =goal> ISA subtract-column column ones top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens zero =diff> ISA number value =ans =col1> ISA memory-object column ones row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note no-borrow =current> ones =diff =col1> value =diff !eval! (proc-ans *answer* 3 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-no-borrow-tens-dm =goal> ISA subtract-column column tens top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens zero =diff> ISA number value =ans =col2> ISA memory-object column tens row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note no-borrow =current> tens =diff =col2> value =diff !eval! (proc-ans *answer* 2 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-no-borrow-hundreds-dm =goal> ISA subtract-column column hundreds top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens zero =diff> ISA number value =ans =col3> ISA memory-object column hundreds row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note no-borrow =current> hundreds =diff =col3> value =diff !eval! (proc-ans *answer* 1 =diff) !eval! (grid-highlight =ans) ) (P simple-subtract-no-borrow-thousands-dm =goal> ISA subtract-column column thousands top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller =num2 =fact> ISA subtraction-fact top =num1 bottom =num2 diff =diff =num1> ISA number tens zero =diff> ISA number value =ans =col4> ISA memory-object column thousands row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =goal> diff =diff note no-borrow =current> thousands =diff =col4> value =diff !eval! (proc-ans *answer* 0 =diff) !eval! (grid-highlight =ans) ) ;; the count strategy -----------{ (P simple-subtract-note-borrow-c =goal> ISA subtract-column column =col top =num1 bottom seven diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller seven =num1> ISA number tens one ==> =newgoal> ISA sub-by-count start =num1 count seven column =col note borrow !push! =newgoal ) (P simple-subtract-no-borrow-c =goal> ISA subtract-column column =col top =num1 bottom seven diff nil note no-borrow =compare> ISA comparison bigger =num1 smaller seven =num1> ISA number tens zero value =val ==> =newgoal> ISA sub-by-count start =num1 count seven column =col note no-borrow !push! =newgoal ) (P count =goal> ISA sub-by-count start =num count =count =count> ISA number - value 0 =decrement-num> ISA subtraction-fact top =num bottom one diff =newnum =newnum> ISA number value =val =decrement-count> ISA subtraction-fact top =count bottom one diff =newcount ==> =goal> start =newnum count =newcount !output! ("*** counting: ~A" =newnum) !eval! (grid-highlight =val) ) (P stop-count-ones =goal> ISA sub-by-count start =num count zero column ones note =note =num> ISA number value =ans =col1> ISA memory-object column ones row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =col1> value =num =current> ones =num !output! ("column ones answer: ~A~%" =num) !eval! (proc-ans *answer* 3 =num) !eval! (grid-highlight =ans) !pop! =old-goal> ISA subtract-column column tens note =note !push! =old-goal ) (P stop-count-tens =goal> ISA sub-by-count start =num count zero column tens note =note =num> ISA number value =ans =col2> ISA memory-object column tens row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =col2> value =num =current> tens =num !output! ("column tens answer: ~A~%" =num) !eval! (proc-ans *answer* 2 =num) !eval! (grid-highlight =ans) !pop! =old-goal> ISA subtract-column column hundreds note =note !push! =old-goal ) (P stop-count-hundreds =goal> ISA sub-by-count start =num count zero column hundreds note =note =num> ISA number value =ans =col3> ISA memory-object column hundreds row top value =val =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =col3> value =num =current> hundreds =num !output! ("column hundreds answer: ~A~%" =num) !eval! (proc-ans *answer* 1 =num) !eval! (grid-highlight =ans) !pop! =old-goal> ISA subtract-column column thousands note =note !push! =old-goal ) ;; end count strategy -----------} (P subtract-with-borrow =goal> ISA subtract-column top =num1 bottom =num2 diff nil note no-borrow =compare> ISA comparison bigger =num2 smaller =num1 =fact> ISA add-ten num =num1 sum =newtop =newtop> ISA number value =val !eval! (not (equal =num1 =num2)) ==> =goal> top =newtop !eval! (grid-highlight =val) ) (P process-borrow =goal> ISA subtract-column column =col top =num1 bottom =num2 diff nil note borrow =num1> ISA number - units zero =fact> ISA subtraction-fact top =num1 bottom one diff =newtop =newtop> ISA number value =val ==> =goal> top =newtop note no-borrow !eval! (grid-highlight =val) ) (P process-borrow-with-zero =goal> ISA subtract-column column =col top =num1 bottom =num2 diff nil note borrow =num1> ISA number tens zero units zero =fact1> ISA add-ten num =num1 sum =sum =fazt2> ISA subtraction-fact top =sum bottom one diff =newtop =next> ISA next-info before =col after =nextcol =one-over> ISA memory-object column =nextcol row top value =val =val> ISA number - units zero =fact3> ISA subtraction-fact top =val bottom one diff =newval ==> =goal> top =newtop note no-borrow =one-over> value =newval ) (P process-borrow-with-zero-zero =goal> ISA subtract-column column =col top =num1 bottom =num2 diff nil note borrow =num1> ISA number tens zero units zero =fact1> ISA add-ten num =num1 sum =sum =fazt2> ISA subtraction-fact top =sum bottom one diff =newtop =next1> ISA next-info before =col after =one-over-col =one-over> ISA memory-object column =one-over-col row top value =val-one-over =val-one-over> ISA number units zero =fact3> ISA add-ten num =val-one-over sum =sum-one-over =fact4> ISA subtraction-fact top =sum-one-over bottom one diff =new-val-one-over =next2> ISA next-info before =one-over-col after =two-over-col =two-over> ISA memory-object column =two-over-col row top value =val-two-over =fact5> ISA subtraction-fact top =val-two-over bottom one diff =new-val-two-over ==> =goal> top =newtop note no-borrow =one-over> value =new-val-one-over =two-over> value =new-val-two-over ) (P last-column-no-borrow =goal> ISA subtract-column top =num bottom - column =col note no-borrow =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =newgoal> ISA serial-subtraction column nil =goal> diff =num =current> thousands =num !output! ( "~%~%Model Speaks: *** ~s ~s ~s ~s ***~%" =num =h =t =o) !eval! (update-interface =num) !pop! !focus-on! =newgoal !eval! (check-answer) !eval! (Actr-time 2) ) (P last-column-with-borrow =goal> ISA subtract-column top =num bottom - column =col note borrow =fact> ISA subtraction-fact top =num bottom one diff =diff =current> ISA current-number ones =o tens =t hundreds =h thousands =th ==> =newgoal> ISA serial-subtraction column nil =goal> diff =diff =current> thousands =diff !output! ( "~%~%Model Speaks: *** ~s ~s ~s ~s ***~%" =diff =h =t =o) !eval! (update-interface =diff) !pop! !focus-on! =newgoal !eval! (check-answer) !eval! (Actr-time 2) ) (P next-column-no-borrow =goal> ISA subtract-column column =pos1 diff =diff note no-borrow =next> ISA next-info before =pos1 after =pos2 ==> =newgoal> ISA subtract-column column =pos2 note no-borrow !focus-on! =newgoal ) (P next-column-with-borrow =goal> ISA subtract-column column =pos1 diff =diff note borrow =next> ISA next-info before =pos1 after =pos2 ==> =newgoal> ISA subtract-column column =pos2 note borrow !focus-on! =newgoal ) (PDisable worry) (goal-focus goal)