diff options
Diffstat (limited to 'modeling/prod_multi.py')
-rw-r--r-- | modeling/prod_multi.py | 59 |
1 files changed, 57 insertions, 2 deletions
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", |