From 3af823401ef8151dd298c73b10f7c03886c27e3d Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Fri, 28 Jun 2024 13:01:54 +0200 Subject: fix higher multis --- modeling/prod_multi.py | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'modeling/prod_multi.py') 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 -- cgit v1.2.3