summaryrefslogtreecommitdiff
path: root/modeling/prod_subtraction.py
diff options
context:
space:
mode:
Diffstat (limited to 'modeling/prod_subtraction.py')
-rw-r--r--modeling/prod_subtraction.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/modeling/prod_subtraction.py b/modeling/prod_subtraction.py
index a0ac8b7..91137bb 100644
--- a/modeling/prod_subtraction.py
+++ b/modeling/prod_subtraction.py
@@ -17,29 +17,31 @@ def subtraction(Model):
==>
=g>
isa math_goal
+ op sub_retrieve
+retrieval>
isa math_op
- op sub
- arg1 =arg1
+ op add
+ result =arg1
arg2 =arg2
""",
)
# Can remember addition fact, addition done
+ # TODO: save all sub-facts as addition facts?
sub_retrieve_success = Model.productionstring(
name="sub_retrieve_success",
string="""
=g>
isa math_goal
- op sub
+ op sub_retrieve
arg1 =arg1
- arg2 =arg1
+ arg2 =arg2
=retrieval>
isa math_op
op add
- arg1 =arg1
+ arg1 =result
arg2 =arg2
- result =result
+ result =arg1
==>
=g>
isa math_goal
@@ -47,10 +49,10 @@ def subtraction(Model):
result =result
+imaginal>
isa math_op
- op sub
- arg1 =arg1
+ op add
+ arg1 =result
arg2 =arg2
- result =result
+ result =arg1
~retrieval>
""",
)
@@ -59,7 +61,7 @@ def subtraction(Model):
string="""
=g>
isa math_goal
- op sub
+ op sub_retrieve
ones1 =num1
ones2 =num2
?retrieval>