summaryrefslogtreecommitdiff
path: root/modeling/prod_numbers.py
diff options
context:
space:
mode:
authorDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-05-10 09:08:22 +0200
committerDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-05-10 09:08:22 +0200
commit6cb9ee72ba1b2dffcbe418129a110c1d0bbcc0b3 (patch)
tree4d2259701042a9b7798a05f38d629bbf1dd35dfb /modeling/prod_numbers.py
parentee5e4fbb8c211beb8e643116ee62b2592c6b3150 (diff)
progress
Diffstat (limited to 'modeling/prod_numbers.py')
-rw-r--r--modeling/prod_numbers.py134
1 files changed, 134 insertions, 0 deletions
diff --git a/modeling/prod_numbers.py b/modeling/prod_numbers.py
new file mode 100644
index 0000000..8bf1ebb
--- /dev/null
+++ b/modeling/prod_numbers.py
@@ -0,0 +1,134 @@
+#!/usr/bin/env python3
+
+def number(Model):
+ prods = []
+
+ number_expand_arg1 = Model.productionstring(
+ name="number_expand_arg1",
+ string="""
+ =g>
+ isa math_goal
+ op expand
+ expand_slot arg1
+ arg1 =num
+ ==>
+ +retrieval>
+ isa number
+ number =num
+ """
+ )
+ prods.append(number_expand_arg1)
+
+ number_expand_arg1_done = Model.productionstring(
+ name="number_expand_arg1_done",
+ string="""
+ =g>
+ isa math_goal
+ op expand
+ expand_slot arg1
+ arg1 =num
+ =retrieval>
+ isa number
+ number =num
+ ones =one
+ tens =ten
+ hundreds =hun
+ ==>
+ =g>
+ isa math_goal
+ op done
+ ones1 =one
+ tens1 =ten
+ hundreds1 =hun
+ """
+ )
+ prods.append(number_expand_arg1_done)
+
+
+ number_expand_arg2 = Model.productionstring(
+ name="number_expand_arg2",
+ string="""
+ =g>
+ isa math_goal
+ op expand
+ expand_slot 2arg
+ arg2 =num
+ ==>
+ +retrieval>
+ isa number
+ number =num
+ """
+ )
+ prods.append(number_expand_arg2)
+
+ number_expand_arg2_done = Model.productionstring(
+ name="number_expand_arg2_done",
+ string="""
+ =g>
+ isa math_goal
+ op expand
+ expand_slot arg2
+ arg2 =num
+ =retrieval>
+ isa number
+ number =num
+ ones =one
+ tens =ten
+ hundreds =hun
+ ==>
+ =g>
+ isa math_goal
+ op done
+ ones2 =one
+ tens2 =ten
+ hundreds2 =hun
+ """
+ )
+ prods.append(number_expand_arg2_done)
+
+ number_contract_result = Model.productionstring(
+ name="number_contract_result",
+ string="""
+ =g>
+ isa math_goal
+ op contract
+ expand_slot result
+ ones_ans =ones
+ tens_ans =tens
+ hundreds_ans =huns
+ ==>
+ +retrieval>
+ isa number
+ ones =ones
+ tens =tens
+ hundreds =huns
+ """
+ )
+ prods.append(number_contract_result)
+
+ number_contract_result_done = Model.productionstring(
+ name="number_contract_result_done",
+ string="""
+ =g>
+ isa math_goal
+ op contract
+ expand_slot result
+ ones_ans =ones
+ tens_ans =tens
+ hundreds_ans =huns
+ =retrieval>
+ isa number
+ number =num
+ ones =ones
+ tens =tens
+ hundreds =huns
+ ==>
+ =g>
+ isa math_goal
+ op done
+ result =num
+ """
+ )
+ prods.append(number_contract_result_done)
+
+ return prods