summaryrefslogtreecommitdiff
path: root/modeling/prod_multi.py
diff options
context:
space:
mode:
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