summaryrefslogtreecommitdiff
path: root/modeling/prod_multi.py
diff options
context:
space:
mode:
authorNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-06-28 13:01:54 +0200
committerNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-06-28 13:01:54 +0200
commit3af823401ef8151dd298c73b10f7c03886c27e3d (patch)
tree7b33f94638bbbdad642e04cf433271a433c74fd9 /modeling/prod_multi.py
parent6a0b7dad008cb8a9e48ade0dceb49082e1349c30 (diff)
fix higher multis
Diffstat (limited to 'modeling/prod_multi.py')
-rw-r--r--modeling/prod_multi.py41
1 files changed, 20 insertions, 21 deletions
diff --git a/modeling/prod_multi.py b/modeling/prod_multi.py
index 9b55f2a..88c5eed 100644
--- a/modeling/prod_multi.py
+++ b/modeling/prod_multi.py
@@ -123,6 +123,7 @@ def multiplication(Model):
=g>
isa math_goal
mul_counter =counted
+ ~retrieval>
+retrieval>
isa math_op
op add
@@ -149,47 +150,45 @@ def multiplication(Model):
==>
=g>
isa math_goal
- nextop mul
+ nextop mul_fail
op add
arg1 =arg
arg2 =result
+ mem_arg1 =mul
+ mem_arg2 =arg
ones1 None
tens1 None
hundreds1 None
ones2 None
tens2 None
hundreds2 None
- +retrieval>
- isa math_op
- op add
- arg1 =mul_counter
- arg2 1
+ ones_ans None
+ tens_ans None
+ hundreds_ans None
+ result None
+ ~retrieval>
""",
)
- mul_step_failure_return = Model.productionstring(
- name="mul_step_failure_return",
+ # instead of remembering original mult args, maybe should
+ # start from the beginning, with the addition results now
+ # retrievable
+ mul_step_addition_return = Model.productionstring(
+ name="mul_step_addition_return",
string="""
=g>
isa math_goal
- op mul
- arg1 =mul
- arg2 =arg
- ones2 =ones
- tens2 =tens
- hundreds2 =huns
+ op mul_fail
mul_counter =mul_counter
result =result
- =retrieval>
- isa math_op
- op add
- arg1 =arg
- arg2 =result
- result =sum
+ mem_arg1 =mem_arg1
+ mem_arg2 =mem_arg2
==>
=g>
isa math_goal
- result =sum
+ op mul
+ arg1 =mem_arg1
+ arg2 =mem_arg2
+retrieval>
isa math_op
op add