#!/usr/bin/env python3 def procedures(Model): prods = [] vis_find_arg1_header = Model.productionstring( name="vis_find_arg1_header", string=""" =g> isa math_goal op vis_find_arg1 arg1 =var ==> =g> isa math_goal op find_arg1_header expand_slot busy +visual_location> isa _visuallocation value =var """, ) # start value index search vis_find_arg1_header_done = Model.productionstring( 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 =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free ==> =g> isa math_goal op search_arg1_idx vis_counter 1 +visual_location> isa _visuallocation screen_x =screen_x screen_y 200 +retrieval> isa number number 1 """, ) vis_find_arg1_search_step1 = Model.productionstring( name="vis_find_arg1_search_step1", string=""" =g> isa math_goal op search_arg1_idx arg1 =var arg1_idx =idx vis_counter 1 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg1_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 300 +retrieval> isa number number =next """, ) vis_find_arg1_search_step2 = Model.productionstring( name="vis_find_arg1_search_step2", string=""" =g> isa math_goal op search_arg1_idx arg1 =var arg1_idx =idx vis_counter 2 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg1_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 400 +retrieval> isa number number =next """, ) vis_find_arg1_search_step3 = Model.productionstring( name="vis_find_arg1_search_step3", string=""" =g> isa math_goal op search_arg1_idx arg1 =var arg1_idx =idx vis_counter 3 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg1_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 500 +retrieval> isa number number =next """, ) vis_find_arg1_search_done = Model.productionstring( name="vis_find_arg1_search_done", string=""" =g> isa math_goal op search_arg1_idx arg1_idx =idx vis_counter =idx =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free ==> =g> isa math_goal op search_arg1_done +visual> isa _visual cmd move_attention screen_pos =visual_location ~visual_location> """, ) vis_find_arg1_replace = Model.productionstring( name="vis_find_arg1_replace", string=""" =g> isa math_goal op search_arg1_done arg1_idx =idx vis_counter =idx =visual> isa _visual value =arg1 ==> =g> isa math_goal op check_if_number_arg2_start arg1 =arg1 vis_counter None expand_slot 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 200 ~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 expand_slot 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 200 ~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 expand_slot None ~visual> ~retrieval> """, ) vis_find_arg2_header = Model.productionstring( name="vis_find_arg2_header", string=""" =g> isa math_goal op vis_find_arg2 arg2 =var ==> =g> isa math_goal op find_arg2_header expand_slot busy +visual_location> isa _visuallocation value =var """, ) # start value index search vis_find_arg2_header_done = Model.productionstring( 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> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free ==> =g> isa math_goal op search_arg2_idx vis_counter 1 +visual_location> isa _visuallocation screen_x =screen_x screen_y ~=screen_y screen_y 200 +retrieval> isa number number 1 """, ) vis_find_arg2_search_step1 = Model.productionstring( name="vis_find_arg2_search_step1", string=""" =g> isa math_goal op search_arg2_idx arg2 =var arg2_idx =idx vis_counter 1 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg2_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 300 +retrieval> isa number number =next """, ) vis_find_arg2_search_step2 = Model.productionstring( name="vis_find_arg2_search_step2", string=""" =g> isa math_goal op search_arg2_idx arg2 =var arg2_idx =idx vis_counter 2 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg2_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 400 +retrieval> isa number number =next """, ) vis_find_arg2_search_step3 = Model.productionstring( name="vis_find_arg2_search_step3", string=""" =g> isa math_goal op search_arg2_idx arg2 =var arg2_idx =idx vis_counter 3 vis_counter ~=idx vis_counter =vis_counter =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free =retrieval> isa number number =vis_counter next =next ==> =g> isa math_goal op search_arg2_idx vis_counter =next +visual_location> isa _visuallocation screen_x =screen_x screen_y 500 +retrieval> isa number number =next """, ) vis_find_arg2_search_done = Model.productionstring( name="vis_find_arg2_search_done", string=""" =g> isa math_goal op search_arg2_idx arg2_idx =idx vis_counter =idx =visual_location> isa _visuallocation screen_x =screen_x screen_y =screen_y ?visual> state free ==> =g> isa math_goal op search_arg2_done +visual> isa _visual cmd move_attention screen_pos =visual_location ~visual_location> """, ) vis_find_arg2_replace = Model.productionstring( name="vis_find_arg2_replace", string=""" =g> isa math_goal op search_arg2_done arg2_idx =idx vis_counter =idx =visual> isa _visual value =arg2 ==> =g> isa math_goal op done arg2 =arg2 vis_counter None expand_slot 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 200 ~retrieval> """, ) 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 ~Answers 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 expand_slot 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 200 ~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 expand_slot None ~visual> ~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