From 42c84ec037e9dee5038fbd0e6da1369493c99370 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Thu, 5 Sep 2024 20:21:37 +0200 Subject: retrieval retry --- modeling/prod_multi.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) (limited to 'modeling/prod_multi.py') diff --git a/modeling/prod_multi.py b/modeling/prod_multi.py index 811e418..d7cf073 100644 --- a/modeling/prod_multi.py +++ b/modeling/prod_multi.py @@ -115,6 +115,61 @@ def multiplication(Model): arg1 ~1 arg2 ~0 arg1 ~1 + arg1 =arg1 + arg2 =arg2 + ?retrieval> + state free + ==> + =g> + isa math_goal + +retrieval> + isa math_op + op mul + arg1 =arg1 + arg2 =arg2 + """, + ) + prods.append(mul_start) + + mul_start_success = Model.productionstring( + name="mul_start_success", + string=""" + =g> + isa math_goal + op mul + arg1 =arg1 + arg2 =arg2 + =retrieval> + isa math_op + op mul + arg1 =arg1 + arg2 =arg2 + result =result + ==> + =g> + isa math_goal + op done + +imaginal> + isa math_op + op mul + arg1 =arg1 + arg2 =arg2 + result =result + ~retrieval> + """, + ) + + + mul_step = Model.productionstring( + name="mul_step", + string=""" + =g> + isa math_goal + op mul + arg1 ~0 + arg1 ~1 + arg2 ~0 + arg1 ~1 arg1 =mul arg2 =arg ones2 =ones @@ -122,7 +177,7 @@ def multiplication(Model): hundreds2 =huns mul_counter None ?retrieval> - state free + state error ==> =g> isa math_goal @@ -135,7 +190,7 @@ def multiplication(Model): arg2 =arg """, ) - prods.append(mul_start) + prods.append(mul_step) mul_step_success = Model.productionstring( name="mul_step_success", -- cgit v1.2.3