summaryrefslogtreecommitdiff
path: root/modeling
diff options
context:
space:
mode:
Diffstat (limited to 'modeling')
-rw-r--r--modeling/model_env.py4
-rw-r--r--modeling/model_init.py20
-rw-r--r--modeling/prod_numbers.py2
-rw-r--r--modeling/prod_vis.py1240
-rw-r--r--modeling/productions_math.py2
5 files changed, 1229 insertions, 39 deletions
diff --git a/modeling/model_env.py b/modeling/model_env.py
index 1565cf4..ab4b219 100644
--- a/modeling/model_env.py
+++ b/modeling/model_env.py
@@ -14,8 +14,8 @@ def get_env():
screen["Gifte"] = {"text": "Gifte", "position": (300, 100)}
screen["GifteVar1"] = {"text": "3", "position": (300, 200)}
- screen["GifteVar2"] = {"text": "4", "position": (300, 300)}
- screen["GifteVar3"] = {"text": "5", "position": (300, 400)}
+ screen["GifteVar2"] = {"text": "8", "position": (300, 300)}
+ screen["GifteVar3"] = {"text": "1", "position": (300, 400)}
screen["GifteVar4"] = {"text": "6", "position": (300, 500)}
diff --git a/modeling/model_init.py b/modeling/model_init.py
index a61fc9b..369cb50 100644
--- a/modeling/model_init.py
+++ b/modeling/model_init.py
@@ -223,16 +223,16 @@ def init():
result=max(i, j),
)
)
- # DM.add(
- # actr.makechunk(
- # f"lesser{i}{j}",
- # "math_op",
- # op="lesser",
- # arg1=i,
- # arg2=j,
- # result=min(i, j),
- # )
- # )
+ DM.add(
+ actr.makechunk(
+ f"lesser{i}{j}",
+ "math_op",
+ op="lesser",
+ arg1=i,
+ arg2=j,
+ result=min(i, j),
+ )
+ )
for i in range(0, 21):
for j in range(0, 21):
DM.add(
diff --git a/modeling/prod_numbers.py b/modeling/prod_numbers.py
index d0c8466..0316691 100644
--- a/modeling/prod_numbers.py
+++ b/modeling/prod_numbers.py
@@ -12,6 +12,7 @@ def number(Model):
ones1 None
?retrieval>
state free
+ buffer empty
==>
=g>
isa math_goal
@@ -57,6 +58,7 @@ def number(Model):
ones2 None
?retrieval>
state free
+ buffer empty
==>
=g>
isa math_goal
diff --git a/modeling/prod_vis.py b/modeling/prod_vis.py
index 31e53ca..bc1f0b4 100644
--- a/modeling/prod_vis.py
+++ b/modeling/prod_vis.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python3
+
def procedures(Model):
prods = []
vis_find_arg1_header = Model.productionstring(
- name = "vis_find_arg1_header",
+ name="vis_find_arg1_header",
string="""
=g>
isa math_goal
@@ -19,17 +20,19 @@ def procedures(Model):
+visual_location>
isa _visuallocation
value =var
- """
+ """,
)
# start value index search
vis_find_arg1_header_done = Model.productionstring(
- name = "vis_find_arg1_header_done",
+ name="vis_find_arg1_header_done",
string="""
=g>
isa math_goal
op find_arg1_header
arg1 =var
+ arg1_idx ~max
+ arg1_idx ~min
arg1_idx =idx
vis_counter ~=idx
vis_counter =vis_counter
@@ -51,11 +54,11 @@ def procedures(Model):
+retrieval>
isa number
number 1
- """
+ """,
)
vis_find_arg1_search_step1 = Model.productionstring(
- name = "vis_find_arg1_search_step1",
+ name="vis_find_arg1_search_step1",
string="""
=g>
isa math_goal
@@ -87,11 +90,11 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
vis_find_arg1_search_step2 = Model.productionstring(
- name = "vis_find_arg1_search_step2",
+ name="vis_find_arg1_search_step2",
string="""
=g>
isa math_goal
@@ -123,11 +126,11 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
vis_find_arg1_search_step3 = Model.productionstring(
- name = "vis_find_arg1_search_step3",
+ name="vis_find_arg1_search_step3",
string="""
=g>
isa math_goal
@@ -159,7 +162,7 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
vis_find_arg1_search_done = Model.productionstring(
@@ -185,7 +188,7 @@ def procedures(Model):
cmd move_attention
screen_pos =visual_location
~visual_location>
- """
+ """,
)
vis_find_arg1_replace = Model.productionstring(
@@ -206,12 +209,605 @@ def procedures(Model):
arg1 =arg1
vis_counter None
~visual>
- """
+ """,
+ )
+
+ vis_max_arg1_header_done = Model.productionstring(
+ name="vis_max_arg1_header_done",
+ string="""
+ =g>
+ isa math_goal
+ op find_arg1_header
+ arg1 =var
+ arg1_idx max
+ vis_counter =vis_counter
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ vis_counter 1
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y closest
+ ~retrieval>
+ """,
+ )
+
+ vis_max_arg1_search_step1_attend = Model.productionstring(
+ name="vis_max_arg1_search_step1_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ arg1_idx max
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg1_search_step1_encode = Model.productionstring(
+ name="vis_max_arg1_search_step1_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ arg1_idx max
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ vis_counter 2
+ arg1 =value
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 300
+ """,
)
+ vis_max_arg1_search_step2_attend = Model.productionstring(
+ name="vis_max_arg1_search_step2_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ arg1_idx max
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg1_search_step2_check = Model.productionstring(
+ name="vis_max_arg1_search_step2_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_check
+ arg1 =arg1
+ arg1_idx max
+ vis_counter 2
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_max_arg1_search_step2_encode = Model.productionstring(
+ name="vis_max_arg1_search_step2_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ arg1_idx max
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ vis_counter 3
+ arg1 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 400
+ ~retrieval>
+ """,
+ )
+ vis_max_arg1_search_step3_attend = Model.productionstring(
+ name="vis_max_arg1_search_step3_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ arg1_idx max
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg1_search_step3_check = Model.productionstring(
+ name="vis_max_arg1_search_step3_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_check
+ arg1 =arg1
+ arg1_idx max
+ vis_counter 3
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_max_arg1_search_step3_encode = Model.productionstring(
+ name="vis_max_arg1_search_step3_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ arg1_idx max
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ vis_counter 4
+ arg1 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 500
+ ~retrieval>
+ """,
+ )
+ vis_max_arg1_search_step4_attend = Model.productionstring(
+ name="vis_max_arg1_search_step4_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_attend
+ arg1_idx max
+ vis_counter 4
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg1_search_step4_check = Model.productionstring(
+ name="vis_max_arg1_search_step4_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_check
+ arg1 =arg1
+ arg1_idx max
+ vis_counter 4
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_max_arg1_search_step4_encode = Model.productionstring(
+ name="vis_max_arg1_search_step4_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg1_encode
+ arg1_idx max
+ vis_counter 4
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op check_if_number_arg2_start
+ arg1 =result
+ vis_counter None
+ ~visual>
+ ~retrieval>
+ """,
+ )
+
+ vis_min_arg1_header_done = Model.productionstring(
+ name="vis_min_arg1_header_done",
+ string="""
+ =g>
+ isa math_goal
+ op find_arg1_header
+ arg1 =var
+ arg1_idx min
+ vis_counter =vis_counter
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ vis_counter 1
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y closest
+ ~retrieval>
+ """,
+ )
+
+ vis_min_arg1_search_step1_attend = Model.productionstring(
+ name="vis_min_arg1_search_step1_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ arg1_idx min
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg1_search_step1_encode = Model.productionstring(
+ name="vis_min_arg1_search_step1_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ arg1_idx min
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ vis_counter 2
+ arg1 =value
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 300
+ """,
+ )
+
+ vis_min_arg1_search_step2_attend = Model.productionstring(
+ name="vis_min_arg1_search_step2_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ arg1_idx min
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg1_search_step2_check = Model.productionstring(
+ name="vis_min_arg1_search_step2_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_check
+ arg1 =arg1
+ arg1_idx min
+ vis_counter 2
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_min_arg1_search_step2_encode = Model.productionstring(
+ name="vis_min_arg1_search_step2_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ arg1_idx min
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ vis_counter 3
+ arg1 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 400
+ ~retrieval>
+ """,
+ )
+ vis_min_arg1_search_step3_attend = Model.productionstring(
+ name="vis_min_arg1_search_step3_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ arg1_idx min
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg1_search_step3_check = Model.productionstring(
+ name="vis_min_arg1_search_step3_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_check
+ arg1 =arg1
+ arg1_idx min
+ vis_counter 3
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_min_arg1_search_step3_encode = Model.productionstring(
+ name="vis_min_arg1_search_step3_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ arg1_idx min
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ vis_counter 4
+ arg1 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 500
+ ~retrieval>
+ """,
+ )
+ vis_min_arg1_search_step4_attend = Model.productionstring(
+ name="vis_min_arg1_search_step4_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_attend
+ arg1_idx min
+ vis_counter 4
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg1_search_step4_check = Model.productionstring(
+ name="vis_min_arg1_search_step4_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_check
+ arg1 =arg1
+ arg1_idx min
+ vis_counter 4
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg1
+ arg2 =value
+ """,
+ )
+ vis_min_arg1_search_step4_encode = Model.productionstring(
+ name="vis_min_arg1_search_step4_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg1_encode
+ arg1_idx min
+ vis_counter 4
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op check_if_number_arg2_start
+ arg1 =result
+ vis_counter None
+ ~visual>
+ ~retrieval>
+ """,
+ )
vis_find_arg2_header = Model.productionstring(
- name = "vis_find_arg2_header",
+ name="vis_find_arg2_header",
string="""
=g>
isa math_goal
@@ -226,18 +822,20 @@ def procedures(Model):
+visual_location>
isa _visuallocation
value =var
- """
+ """,
)
# start value index search
vis_find_arg2_header_done = Model.productionstring(
- name = "vis_find_arg2_header_done",
+ name="vis_find_arg2_header_done",
string="""
=g>
isa math_goal
op find_arg2_header
arg2 =var
arg2_idx =idx
+ arg2_idx ~min
+ arg2_idx ~max
vis_counter ~=idx
vis_counter =vis_counter
=visual_location>
@@ -259,11 +857,11 @@ def procedures(Model):
+retrieval>
isa number
number 1
- """
+ """,
)
vis_find_arg2_search_step1 = Model.productionstring(
- name = "vis_find_arg2_search_step1",
+ name="vis_find_arg2_search_step1",
string="""
=g>
isa math_goal
@@ -295,11 +893,11 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
vis_find_arg2_search_step2 = Model.productionstring(
- name = "vis_find_arg2_search_step2",
+ name="vis_find_arg2_search_step2",
string="""
=g>
isa math_goal
@@ -331,11 +929,11 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
vis_find_arg2_search_step3 = Model.productionstring(
- name = "vis_find_arg2_search_step3",
+ name="vis_find_arg2_search_step3",
string="""
=g>
isa math_goal
@@ -367,10 +965,9 @@ def procedures(Model):
+retrieval>
isa number
number =next
- """
+ """,
)
-
vis_find_arg2_search_done = Model.productionstring(
name="vis_find_arg2_search_done",
string="""
@@ -394,7 +991,7 @@ def procedures(Model):
cmd move_attention
screen_pos =visual_location
~visual_location>
- """
+ """,
)
vis_find_arg2_replace = Model.productionstring(
@@ -416,9 +1013,600 @@ def procedures(Model):
vis_counter None
~visual>
~retrieval>
- """
+ """,
)
+ vis_max_arg2_header_done = Model.productionstring(
+ name="vis_max_arg2_header_done",
+ string="""
+ =g>
+ isa math_goal
+ op find_arg2_header
+ arg2 =var
+ arg2_idx max
+ vis_counter =vis_counter
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ vis_counter 1
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y closest
+ ~retrieval>
+ """,
+ )
- return prods
+ vis_max_arg2_search_step1_attend = Model.productionstring(
+ name="vis_max_arg2_search_step1_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ arg2_idx max
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg2_search_step1_encode = Model.productionstring(
+ name="vis_max_arg2_search_step1_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ arg2_idx max
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ vis_counter 2
+ arg2 =value
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 300
+ """,
+ )
+ vis_max_arg2_search_step2_attend = Model.productionstring(
+ name="vis_max_arg2_search_step2_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ arg2_idx max
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg2_search_step2_check = Model.productionstring(
+ name="vis_max_arg2_search_step2_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_check
+ arg2 =arg2
+ arg2_idx max
+ vis_counter 2
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_max_arg2_search_step2_encode = Model.productionstring(
+ name="vis_max_arg2_search_step2_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ arg2_idx max
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ vis_counter 3
+ arg2 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 400
+ ~retrieval>
+ """,
+ )
+ vis_max_arg2_search_step3_attend = Model.productionstring(
+ name="vis_max_arg2_search_step3_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ arg2_idx max
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg2_search_step3_check = Model.productionstring(
+ name="vis_max_arg2_search_step3_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_check
+ arg2 =arg2
+ arg2_idx max
+ vis_counter 3
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_max_arg2_search_step3_encode = Model.productionstring(
+ name="vis_max_arg2_search_step3_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ arg2_idx max
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ vis_counter 4
+ arg2 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 500
+ ~retrieval>
+ """,
+ )
+ vis_max_arg2_search_step4_attend = Model.productionstring(
+ name="vis_max_arg2_search_step4_attend",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_attend
+ arg2_idx max
+ vis_counter 4
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_max_arg2_search_step4_check = Model.productionstring(
+ name="vis_max_arg2_search_step4_check",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_check
+ arg2 =arg2
+ arg2_idx max
+ vis_counter 4
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ +retrieval>
+ isa math_op
+ op greater
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_max_arg2_search_step4_encode = Model.productionstring(
+ name="vis_max_arg2_search_step4_encode",
+ string="""
+ =g>
+ isa math_goal
+ op max_arg2_encode
+ arg2_idx max
+ vis_counter 4
+ =retrieval>
+ isa math_op
+ op greater
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op done
+ arg2 =result
+ vis_counter None
+ ~visual>
+ ~retrieval>
+ """,
+ )
+
+ vis_min_arg2_header_done = Model.productionstring(
+ name="vis_min_arg2_header_done",
+ string="""
+ =g>
+ isa math_goal
+ op find_arg2_header
+ arg2 =var
+ arg2_idx min
+ vis_counter =vis_counter
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ vis_counter 1
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y closest
+ ~retrieval>
+ """,
+ )
+
+ vis_min_arg2_search_step1_attend = Model.productionstring(
+ name="vis_min_arg2_search_step1_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ arg2_idx min
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg2_search_step1_encode = Model.productionstring(
+ name="vis_min_arg2_search_step1_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ arg2_idx min
+ vis_counter 1
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ vis_counter 2
+ arg2 =value
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 300
+ """,
+ )
+
+ vis_min_arg2_search_step2_attend = Model.productionstring(
+ name="vis_min_arg2_search_step2_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ arg2_idx min
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg2_search_step2_check = Model.productionstring(
+ name="vis_min_arg2_search_step2_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_check
+ arg2 =arg2
+ arg2_idx min
+ vis_counter 2
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_min_arg2_search_step2_encode = Model.productionstring(
+ name="vis_min_arg2_search_step2_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ arg2_idx min
+ vis_counter 2
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ vis_counter 3
+ arg2 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 400
+ ~retrieval>
+ """,
+ )
+ vis_min_arg2_search_step3_attend = Model.productionstring(
+ name="vis_min_arg2_search_step3_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ arg2_idx min
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg2_search_step3_check = Model.productionstring(
+ name="vis_min_arg2_search_step3_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_check
+ arg2 =arg2
+ arg2_idx min
+ vis_counter 3
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_min_arg2_search_step3_encode = Model.productionstring(
+ name="vis_min_arg2_search_step3_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ arg2_idx min
+ vis_counter 3
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ vis_counter 4
+ arg2 =result
+ +visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y 500
+ ~retrieval>
+ """,
+ )
+ vis_min_arg2_search_step4_attend = Model.productionstring(
+ name="vis_min_arg2_search_step4_attend",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_attend
+ arg2_idx min
+ vis_counter 4
+ =visual_location>
+ isa _visuallocation
+ screen_x =screen_x
+ screen_y =screen_y
+ ?visual>
+ state free
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_check
+ +visual>
+ isa _visual
+ cmd move_attention
+ screen_pos =visual_location
+ """,
+ )
+ vis_min_arg2_search_step4_check = Model.productionstring(
+ name="vis_min_arg2_search_step4_check",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_check
+ arg2 =arg2
+ arg2_idx min
+ vis_counter 4
+ =visual>
+ isa _visual
+ value =value
+ ==>
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ +retrieval>
+ isa math_op
+ op lesser
+ arg1 =arg2
+ arg2 =value
+ """,
+ )
+ vis_min_arg2_search_step4_encode = Model.productionstring(
+ name="vis_min_arg2_search_step4_encode",
+ string="""
+ =g>
+ isa math_goal
+ op min_arg2_encode
+ arg2_idx min
+ vis_counter 4
+ =retrieval>
+ isa math_op
+ op lesser
+ result =result
+ ==>
+ =g>
+ isa math_goal
+ op done
+ arg2 =result
+ vis_counter None
+ ~visual>
+ ~retrieval>
+ """,
+ )
+ return prods
diff --git a/modeling/productions_math.py b/modeling/productions_math.py
index 42c08da..aa06ffb 100644
--- a/modeling/productions_math.py
+++ b/modeling/productions_math.py
@@ -54,7 +54,7 @@ def start():
# op, arg1, arg2 = wait_input()
Model, DM, goal, imaginal, env = init()
# add_goal(goal, op, arg1, arg2)
- add_proc(goal, "proc6")
+ add_proc(goal, "proc3")
envs = model_env.get_env()
general_prod(Model)