summaryrefslogtreecommitdiff
path: root/modeling/addition.py
diff options
context:
space:
mode:
authorDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-03-12 14:44:40 +0100
committerDobbertin, Niclas <niclas.dobbertin@mailbox.org>2024-03-12 14:44:40 +0100
commit17628173f118d842c3206a20702bdbdd3de26d5d (patch)
tree3e7ccff5d885ece89703d7be5f51d847cb37ddd5 /modeling/addition.py
parent75d79a13473150b04dd899be2b892915e408962f (diff)
parent944bbb93c39d8a3ee186dacfa50ba4ec514ad160 (diff)
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'modeling/addition.py')
-rw-r--r--modeling/addition.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/modeling/addition.py b/modeling/addition.py
new file mode 100644
index 0000000..a32adba
--- /dev/null
+++ b/modeling/addition.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+
+import pyactr as actr
+
+
+addition = actr.ACTRModel()
+actr.chunktype("countOrder", ("first", "second"))
+actr.chunktype("add", ("arg1", "arg2", "sum", "count"))
+
+dm = addition.decmem
+
+for i in range(0, 11):
+ dm.add(actr.makechunk("chunk" + str(i), "countOrder", first=i, second=i + 1))
+
+addition.goal.add(actr.makechunk("", "add", arg1=5, arg2=2))
+
+addition.productionstring(
+ name="init_addition",
+ string="""
+ =g>
+ isa add
+ arg1 =num1
+ arg2 =num2
+ sum None
+ ==>
+ =g>
+ isa add
+ sum =num1
+ count 0
+ +retrieval>
+ isa countOrder
+ first =num1
+""",
+)