#!/usr/bin/env python3 def procedures(Model): prods = [] proc_start = Model.productionstring( name="proc_start", string=""" =g> isa math_goal proc =proc op None nextop None ?retrieval> state free ?imaginal> state free ==> =g> isa math_goal op retr_task +retrieval> isa procedure proc =proc """, ) prods.append(proc_start) proc_start_task1 = Model.productionstring( name="proc_start_task1", string=""" =g> isa math_goal proc =proc op retr_task nextop None result1 None =retrieval> isa procedure proc =proc op1 =op arg1_1 =arg1 arg1_2 =arg2 ==> =g> isa math_goal proc =proc task 1 op =op arg1 =arg1 arg2 =arg2 result None expand_slot None hundreds1 None tens1 None ones1 None hundreds2 None tens2 None ones2 None hundreds_ans None tens_ans None ones_ans None mul_counter None ones_carry None tens_carry None """, ) prods.append(proc_start_task1) proc_harvest_task1 = Model.productionstring( name="proc_harvest_task1", string=""" =g> isa math_goal proc =proc task 1 op done nextop None =imaginal> isa math_op ?retrieval> state free ==> =g> isa math_goal op harvest1 +retrieval> isa procedure proc =proc """, ) proc_harvest_task1_done = Model.productionstring( name="proc_harvest_task1_done", string=""" =g> isa math_goal proc =proc task 1 op harvest1 nextop None result2 =result2 =imaginal> isa math_op result =result1 =retrieval> isa procedure proc =proc op1 =op1 arg1_1 =arg1_1 arg1_2 =arg1_2 op2 =op2 arg2_1 =arg2_1 arg2_2 =arg2_2 ==> =g> isa math_goal proc =proc op None nextop None result1 =result1 result2 =result2 ~retrieval> +manual> isa _manual cmd press_key key 1 """, ) proc_start_task2 = Model.productionstring( name="proc_start_task2", string=""" =g> isa math_goal proc =proc op retr_task nextop None result1 ~None result2 None =retrieval> isa procedure proc =proc op2 =op arg2_1 =arg1 arg2_2 =arg2 ==> =g> isa math_goal proc =proc task 2 op =op arg1 =arg1 arg2 =arg2 result None expand_slot None hundreds1 None tens1 None ones1 None hundreds2 None tens2 None ones2 None hundreds_ans None tens_ans None ones_ans None mul_counter None ones_carry None tens_carry None """, ) prods.append(proc_start_task2) proc_harvest_task2 = Model.productionstring( name="proc_harvest_task2", string=""" =g> isa math_goal proc =proc task 2 op done nextop None =imaginal> isa math_op ?retrieval> state free ==> =g> isa math_goal op harvest2 +retrieval> isa procedure proc =proc """, ) proc_harvest_task2_done = Model.productionstring( name="proc_harvest_task2_done", string=""" =g> isa math_goal proc =proc task 2 op harvest2 nextop None result1 =result1 =imaginal> isa math_op result =result2 =retrieval> isa procedure proc =proc op1 =op1 arg1_1 =arg1_1 arg1_2 =arg1_2 op2 =op2 arg2_1 =arg2_1 arg2_2 =arg2_2 ==> =g> isa math_goal proc =proc op type_ans nextop None result1 =result1 result2 =result2 ~retrieval> """, )