summaryrefslogtreecommitdiff
path: root/modeling/prod_multi.py
diff options
context:
space:
mode:
authorDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-05-10 09:08:22 +0200
committerDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-05-10 09:08:22 +0200
commit6cb9ee72ba1b2dffcbe418129a110c1d0bbcc0b3 (patch)
tree4d2259701042a9b7798a05f38d629bbf1dd35dfb /modeling/prod_multi.py
parentee5e4fbb8c211beb8e643116ee62b2592c6b3150 (diff)
progress
Diffstat (limited to 'modeling/prod_multi.py')
-rw-r--r--modeling/prod_multi.py53
1 files changed, 43 insertions, 10 deletions
diff --git a/modeling/prod_multi.py b/modeling/prod_multi.py
index 667241e..4b4e7c5 100644
--- a/modeling/prod_multi.py
+++ b/modeling/prod_multi.py
@@ -22,7 +22,6 @@ def multiplication(Model):
=g>
isa math_goal
op mul
- task calc
=imaginal>
isa math_op
op mul
@@ -41,7 +40,7 @@ def multiplication(Model):
+g>
isa math_goal
op add
- task calc
+ task mul
+imaginal>
isa math_op
op add
@@ -53,6 +52,7 @@ def multiplication(Model):
ones2 =ones
tens2 =tens
hundreds2 =huns
+ mul_counter =mul
+retrieval>
isa math_op
op add
@@ -62,29 +62,62 @@ def multiplication(Model):
)
prods.append(start_mul)
+ count_mul = Model.productionstring(
+ name="count_mul",
+ string="""
+ =g>
+ isa math_goal
+ op add_done
+ task mul
+ =imaginal>
+ isa math_op
+ op add
+ mul_counter =counter
+ ==>
+ =g>
+ isa math_goal
+ op count_done
+ +retrieval>
+ isa math_op
+ op add
+ arg1 1
+ result =counter
+ """
+ )
step_mul = Model.productionstring(
name="step_mul",
string="""
=g>
isa math_goal
- op mul
- task calc
+ op count_done
+ task mul
=imaginal>
isa math_op
- op mul
- arg2 =arg
+ op add
+ hundreds_ans =hun_ans
+ tens_ans =ten_ans
+ ones_ans =one_ans
+ mul_counter =mul_counter
=retrieval>
isa math_op
op add
- arg1 =arg
- arg2 =arg
- result =sum
+ result =mul_counter
+ arg2 =new_counter
==>
=g>
isa math_goal
op mul
- one_ans =sum
+ task mul
+ +imaginal>
+ isa math_op
+ op mul
+ arg1 =new_counter
+ ones1 =new_counter
+ hundreds2 =hun_ans
+ tens2 =ten_ans
+ ones2 =one_ans
+ mul_counter =new_counter
""",
)
prods.append(step_mul)