From 6a0b7dad008cb8a9e48ade0dceb49082e1349c30 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Thu, 27 Jun 2024 22:31:33 +0200 Subject: update --- modeling/prod_multi.py | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'modeling/prod_multi.py') 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 -- cgit v1.2.3