From 3cb857f94b964d7107eda03efc0c6454748a5716 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Fri, 19 Jul 2024 11:32:36 +0200 Subject: fix overall procedure --- modeling/prod_vis.py | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 347 insertions(+) (limited to 'modeling/prod_vis.py') diff --git a/modeling/prod_vis.py b/modeling/prod_vis.py index e70a4c7..3360b33 100644 --- a/modeling/prod_vis.py +++ b/modeling/prod_vis.py @@ -1052,6 +1052,7 @@ def procedures(Model): =g> isa math_goal op max_arg2_attend + arg2 ~Answers arg2_idx max vis_counter 1 =visual_location> @@ -1613,4 +1614,350 @@ def procedures(Model): ~retrieval> """, ) + + vis_max_arg2_answers_step1_attend = Model.productionstring( + name="vis_max_arg2_answers_step1_attend", + string=""" + =g> + isa math_goal + arg2 Answers + 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_answers + +visual> + isa _visual + cmd move_attention + screen_pos =visual_location + """, + ) + vis_max_arg2_answers_step1_encode = Model.productionstring( + name="vis_max_arg2_answers_step1_encode", + string=""" + =g> + isa math_goal + op max_arg2_encode_answers + 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_answers + vis_counter 2 + arg2 =value + +visual_location> + isa _visuallocation + screen_x =screen_x + screen_y 300 + """, + ) + + vis_max_arg2_answer_step2_attend = Model.productionstring( + name="vis_max_arg2_answers_step2_attend", + string=""" + =g> + isa math_goal + op max_arg2_attend_answers + 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_answers + +visual> + isa _visual + cmd move_attention + screen_pos =visual_location + """, + ) + vis_max_arg2_answers_step2_check = Model.productionstring( + name="vis_max_arg2_answers_step2_check", + string=""" + =g> + isa math_goal + op max_arg2_check_answers + arg2 =arg2 + arg2_idx max + vis_counter 2 + =visual> + isa _visual + value =value + ==> + =g> + isa math_goal + op max_arg2_encode_answers + +retrieval> + isa math_op + op greater + arg1 =arg2 + arg2 =value + """, + ) + vis_max_arg2_answers_step2_encode = Model.productionstring( + name="vis_max_arg2_answers_step2_encode", + string=""" + =g> + isa math_goal + op max_arg2_encode_answers + 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_answers + vis_counter 3 + arg2 =result + +visual_location> + isa _visuallocation + screen_x =screen_x + screen_y 400 + ~retrieval> + """, + ) + vis_max_arg2_answers_step3_attend = Model.productionstring( + name="vis_max_arg2_answers_step3_attend", + string=""" + =g> + isa math_goal + op max_arg2_attend_answers + 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_answers + +visual> + isa _visual + cmd move_attention + screen_pos =visual_location + """, + ) + vis_max_arg2_answers_step3_check = Model.productionstring( + name="vis_max_arg2_answers_step3_check", + string=""" + =g> + isa math_goal + op max_arg2_check_answers + arg2 =arg2 + arg2_idx max + vis_counter 3 + =visual> + isa _visual + value =value + ==> + =g> + isa math_goal + op max_arg2_encode_answers + +retrieval> + isa math_op + op greater + arg1 =arg2 + arg2 =value + """, + ) + vis_max_arg2_answers_step3_encode = Model.productionstring( + name="vis_max_arg2_answers_step3_encode", + string=""" + =g> + isa math_goal + op max_arg2_encode_answers + 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_answers + vis_counter 4 + arg2 =result + +visual_location> + isa _visuallocation + screen_x =screen_x + screen_y 500 + ~retrieval> + """, + ) + vis_max_arg2_answers_step4_attend = Model.productionstring( + name="vis_max_arg2_answers_step4_attend", + string=""" + =g> + isa math_goal + op max_arg2_attend_answers + 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_answers + +visual> + isa _visual + cmd move_attention + screen_pos =visual_location + """, + ) + vis_max_arg2_answers_step4_check = Model.productionstring( + name="vis_max_arg2_answers_step4_check", + string=""" + =g> + isa math_goal + op max_arg2_check_answers + arg2 =arg2 + arg2_idx max + vis_counter 4 + =visual> + isa _visual + value =value + ==> + =g> + isa math_goal + op max_arg2_encode_answers + +retrieval> + isa math_op + op greater + arg1 =arg2 + arg2 =value + """, + ) + vis_max_arg2_answers_step4_encode = Model.productionstring( + name="vis_max_arg2_answers_step4_encode", + string=""" + =g> + isa math_goal + op max_arg2_encode_answers + arg2_idx max + vis_counter 4 + =visual_location> + isa _visuallocation + screen_x =screen_x + =retrieval> + isa math_op + op greater + result =result + ==> + =g> + isa math_goal + op max_arg2_attend_answers + vis_counter 5 + arg2 =result + +visual_location> + isa _visuallocation + screen_x =screen_x + screen_y 600 + ~retrieval> + """, + ) + vis_max_arg2_answers_step5_attend = Model.productionstring( + name="vis_max_arg2_answers_step5_attend", + string=""" + =g> + isa math_goal + op max_arg2_attend_answers + arg2_idx max + vis_counter 5 + =visual_location> + isa _visuallocation + screen_x =screen_x + screen_y =screen_y + ?visual> + state free + ==> + =g> + isa math_goal + op max_arg2_check_answers + +visual> + isa _visual + cmd move_attention + screen_pos =visual_location + """, + ) + vis_max_arg2_answers_step5_check = Model.productionstring( + name="vis_max_arg2_answers_step5_check", + string=""" + =g> + isa math_goal + op max_arg2_check_answers + arg2 =arg2 + arg2_idx max + vis_counter 5 + =visual> + isa _visual + value =value + ==> + =g> + isa math_goal + op max_arg2_encode_answers + +retrieval> + isa math_op + op greater + arg1 =arg2 + arg2 =value + """, + ) + vis_max_arg2_answers_step5_encode = Model.productionstring( + name="vis_max_arg2_answers_step5_encode", + string=""" + =g> + isa math_goal + op max_arg2_encode_answers + arg2_idx max + vis_counter 5 + =retrieval> + isa math_op + op greater + result =result + ==> + =g> + isa math_goal + op done + arg2 =result + vis_counter None + expand_slot None + ~visual> + ~retrieval> + """, + ) return prods -- cgit v1.2.3