summaryrefslogtreecommitdiff
path: root/modeling/prod_multi.py
diff options
context:
space:
mode:
authorNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-06-27 22:31:33 +0200
committerNiclas Dobbertin <niclas.dobbertin@mailbox.org>2024-06-27 22:31:33 +0200
commit6a0b7dad008cb8a9e48ade0dceb49082e1349c30 (patch)
tree46241ff78b6905e2a1339fc7608299fdf760e632 /modeling/prod_multi.py
parenteb2e5ca2ffa74e3dd2579dcb70a347e6cd481545 (diff)
update
Diffstat (limited to 'modeling/prod_multi.py')
-rw-r--r--modeling/prod_multi.py49
1 files changed, 39 insertions, 10 deletions
diff --git a/modeling/prod_multi.py b/modeling/prod_multi.py
index 9009f6b..9b55f2a 100644
--- a/modeling/prod_multi.py
+++ b/modeling/prod_multi.py
@@ -99,7 +99,7 @@ def multiplication(Model):
=g>
isa math_goal
op done
- """
+ """,
)
mul_continue = Model.productionstring(
@@ -128,10 +128,9 @@ def multiplication(Model):
op add
arg1 =arg2
arg2 =result
- """
+ """,
)
-
mul_step_failure = Model.productionstring(
name="mul_step_failure",
string="""
@@ -152,15 +151,14 @@ def multiplication(Model):
isa math_goal
nextop mul
op add
- arg1 =arg2
+ arg1 =arg
arg2 =result
ones1 None
- ones1 None
- ones1 None
- ones1 None
- ones1 None
- ones1 None
- ones1 None
+ tens1 None
+ hundreds1 None
+ ones2 None
+ tens2 None
+ hundreds2 None
+retrieval>
isa math_op
op add
@@ -169,5 +167,36 @@ def multiplication(Model):
""",
)
+ mul_step_failure_return = Model.productionstring(
+ name="mul_step_failure_return",
+ string="""
+ =g>
+ isa math_goal
+ op mul
+ arg1 =mul
+ arg2 =arg
+ ones2 =ones
+ tens2 =tens
+ hundreds2 =huns
+ mul_counter =mul_counter
+ result =result
+ =retrieval>
+ isa math_op
+ op add
+ arg1 =arg
+ arg2 =result
+ result =sum
+ ==>
+ =g>
+ isa math_goal
+ result =sum
+ +retrieval>
+ isa math_op
+ op add
+ arg1 =mul_counter
+ arg2 1
+ """,
+ )
+ prods.append(mul_start)
return prods