Online Appendix 1 ----------------- This section gives the complete definition of the process planning domain used in the empirical evaluation. This definition consists of the concrete problem solving domain, the abstract problem solving domain, and the generic abstraction theory. Each problem solving domain is described by a set of essential sentences, a set of operator descriptions, and a set of static Horn rules. All descriptions follow the PROLOG conventions for describing predicates (prefix notation for most predicates, infix notation for some binary built-in predicates), variables (starting with an upper-case letter), constants (starting with a lower-case letter), and rules (using :- as implication symbol). The underscore symbol (_) denotes an anonymous variable, i.e., a variable which is only used once and which is not given a name. All anonymous variables are different. The predicates: =, \=, <, =<, >, and => are used as built-in predicates provided by PROLOG and are therefore not defined here. These predicates have the obvious semantics. Furthermore, the "is" predicate is used to compute a mathematical expression and to assign the result to a variable. This predicate is also provided as a standard built-in predicate by PROLOG. Concrete and abstract operators are described by the 4-ary predicate "operator". The first argument specifies the name and the parameters of the operator, the second argument is a list of predicates interpreted as the precondition of the operator. The third argument is the delete list and the fourth argument specifies the add list. 1. Concrete Essential Sentences ------------------------------- grid_xpos(Xgrid, Xstart, Xsize) grid_ypos(Ygrid, Ystart, Xsize) mat(Xgrid, Ygrid, Status) xpos_max(Xgrid) ypos_max(Ygrid) chuck_pos(Side) covered(Xmin,Xmax) cut_direction(Dir) cut_tool(Id) control_flag(Flag) 2. Concrete Operators --------------------- operator( chuck(Pos), % Operator name ( % Precondition chuck_pos(none), k_chuck_pos_par(Pos), covered_range(Pos,Min,Max), plain(Min,Max,_)), (chuck_pos(none)), % Delete list ( % Add list chuck_pos(Pos), covered(Min,Max), cut_direction(none), cut_tool(none), control_flag(set))). operator( unchuck, % Operator name ( % Precondition chuck_pos(P), P \= none, covered(Min,Max), control_flag(cut), cut_direction(OldDir), cut_direction(OldTool)), ( % Delete list chuck_pos(P), covered(Min,Max), cut_direction(OldDir), cut_tool(OldTool)), ( % Add list chuck_pos(none), control_flag(cut))). operator( use_tool(Dir,ToolId), % Operator name ( % Precondition control_flag(set), chuck_pos(ChuckPos), ChuckPos \= none, k_set_tool_dir(Dir), k_pos_compatible(ChuckPos,Dir), k_tool_db(ToolId,Dir,MaxDeep,_), cut_direction(OldDir), cut_tool(OldTool)), ( % Delete list cut_direction(OldDir), cut_tool(OldTool), control_flag(set)), ( % Add list cut_direction(Dir), cut_tool(ToolId))). operator( cut(Xpos,Ypos), % Operator name ( % Precondition cut_direction(D), cut_tool(ToolId), mat(Xpos,Ypos,raw), block_free(Xpos,Ypos,D), check_geometry(Xpos,Ypos,ToolId)), ( % Delete list mat(Xpos,Ypos,raw), control_flag(cut), control_flag(set)), ( % Add list mat(Xpos,Ypos,none), control_flag(cut), control_flag(set))). 3. Concrete Static Rules ------------------------ covered_range(left,1,Max1) :- len_wp(Len), ChuckLen is Len / 10, grid_xpos(Max,Xstart,Xlen), Xstart > ChuckLen, Max1 is Max - 1, grid_xpos(Max1,Xstart1,_), Xstart1 =< ChuckLen. covered_range(right,Min1,Ngrid) :- xpos_max(Ngrid), len_wp(Len), ChuckLen is Len / 10, grid_xpos(Min,Xstart,Xlen), Xdiss is Len - (Xstart + Xlen), Xdiss > ChuckLen, Min1 is Min + 1, grid_xpos(Min1,Xstart1,Xlen1), Xdiss1 is Len - (Xstart1 + Xlen1), Xdiss1 =< ChuckLen. len_wp(Len) :- xpos_max(M), grid_xpos(M,XStart,XLen), Len is XStart + XLen. not_covered(P) :- covered(Min,Max), P < Min. not_covered(P) :- covered(Min,Max), P > Max. check_geometry(XPos,YPos,ToolId) :- k_tool_db(ToolId,Dir,MaxDeep,Width), grid_ypos(YPos,_,Deepness), grid_xpos(XPos,_,Widthness), Deepness =< MaxDeep, Widthness >= Width. block_free(X,Y,right) :- k_arround(X,Y,XM1,YM1,XP1,YP1), mat(X,YP1,none), mat(XP1,Y,none), not_covered(X). block_free(X,Y,left) :- k_arround(X,Y,XM1,YM1,XP1,YP1), mat(X,YP1,none), mat(XM1,Y,none), not_covered(X). block_free(X,Y,center) :- k_arround(X,Y,XM1,YM1,XP1,YP1), mat(X,YP1,none), not_covered(X). k_arround(X,Y,XM1,YM1,XP1,YP1) :- XM1 is X - 1, XP1 is X + 1, YM1 is Y - 1, YP1 is Y + 1. surface(XPos,YSurface) :- mat(XPos,YSurface,Mat), k_is_mat(Mat), Y1 is YSurface + 1, mat(XPos,Y1,none). surface(XPos,YSurface) :- mat(XPos,YSurface,Mat), k_is_mat(Mat), ypos_max(YSurface). plain(Min,Max,YSurface) :- Min > Max. plain(Min,Max,YSurface) :- Min =< Max, surface(Min,YSurface), Min1 is Min + 1, plain(Min1,Max,YSurface). k_chuck_pos_par(left). k_chuck_pos_par(right). k_set_tool_dir(left). k_set_tool_dir(right). k_set_tool_dir(center). k_is_mat(raw). k_is_mat(workpiece). k_pos_compatible(left,right). k_pos_compatible(left,center). k_pos_compatible(right,left). k_pos_compatible(right,center). k_tool_db(t1,left,12,1). k_tool_db(t2,right,12,1). k_tool_db(t3,center7,2). 4. Abstract Essential Sentences ------------------------------- abs_area_state(Area,Status) abs_small_parts(Area) abs_chuck_pos(side) abs_chuckable_wp(side) 5. Abstract Operators --------------------- operator( set_fixation(Pos), % Operator name ( % Precondition abs_avail_pos(Pos), abs_chuck_pos(Old), Old \= Pos, abs_chuckable(Pos)), (abs_chuck_pos(Old)), % Delete list (abs_chuck_pos(Pos))). % Add list operator( process_ready(Area), % Operator name ( % Precondition abs_area_state(Area,todo), abs_chuck_pos(P), chuck_comp(P,Area), abs_access(Area)), (abs_area_state(Area,todo)), % Delete list (abs_area_state(Area,ready))). % Add list operator( process_rough(Area), % Operator name ( % Precondition abs_area_state(Area,todo), abs_chuck_pos(P), chuck_comp(P,Area), abs_access(Area)), (abs_area_state(Area,todo)), % Delete list (abs_area_state(Area,rough))). % Add list operator( process_fine(Area), % Operator name ( % Precondition abs_area_state(Area,rough), abs_small_parts(Area), abs_chuck_pos(P), chuck_comp(P,Area)), ( % Delete list abs_area_state(Area,rough), abs_small_parts(Area)), (abs_area_state(Area,ready))). % Add list 6. Abstract Static Rules ------------------------ abs_access(middle) :- abs_chuck_pos(P), abs_area_state(A,ready), abs_oposite(A,P). abs_access(middle) :- abs_chuck_pos(P), abs_area_state(A,rough), abs_oposite(A,P). abs_access(A) :- outer_area(A). abs_oposite(left,right). abs_oposite(right,left). outer_area(left). outer_area(right). abs_chuckable(none). abs_chuckable(Area) :- Area \= none, abs_area_state(Area,todo). abs_chuckable(Area) :- Area \= none, abs_area_state(Area,rough). abs_chuckable(Area) :- Area \= none, abs_area_state(Area,ready), abs_chuckable_wp(Area). abs_avail_pos(left). abs_avail_pos(right). abs_avail_pos(none). chuck_comp(left,right). chuck_comp(right,left). chuck_comp(left,middle). chuck_comp(right,middle). 7. Generic Abstraction Theory ----------------------------- abs_area_state(left,State) :- covered_range(left,Min,Max), state_of(Min,Max,State). abs_area_state(right,State) :- covered_range(right,Min,Max), state_of(Min,Max,State). abs_area_state(middle,State) :- covered_range(left,Minl,Maxl), covered_range(right,Minr,Maxr), Min is Maxl + 1, Max is Minr - 1, state_of(Min,Max,State). state_of(Min,Max,todo) :- mat(Xpos,_,raw), Xpos =< Max, Xpos >= Min, grid_xpos(Xpos,_,Size), Size > 3. state_of(Min,Max,rough) :- not_state_of(Min,Max,todo), mat(Xpos,_,raw), Xpos =< Max, Xpos >= Min, grid_xpos(Xpos,_,Size), Size =< 3. state_of(Min,Min,ready) :- ypos_max(Ymax), for_all_ypos_ready(Min,Ymax). state_of(Min,Max,ready) :- Min < Max, state_of(Max,Max,ready), Max1 is Max - 1, state_of(Min,Max1,ready). not_state_of(Min,Min,todo) :- ypos_max(MaxYPos), for_all_ypos_not_todo(Min,MaxYPos). not_state_of(Min,Max,todo) :- Min \= Max, not_state_of(Max,Max,todo), Max1 is Max - 1, not_state_of(Min,Max1,todo). for_all_ypos_not_todo(Min,0) :- mat(Min,0,none). for_all_ypos_not_todo(Min,0) :- mat(Min,0,workpiece). for_all_ypos_not_todo(Min,0) :- mat(Min,0,raw), grid_xpos(Min,_,Size), Size =< 3. for_all_ypos_not_todo(Min,YPos) :- YPos > 0, mat(Min,YPos,none), NewYPos is YPos - 1, for_all_ypos_not_todo(Min,NewYPos). for_all_ypos_not_todo(Min,YPos) :- YPos > 0, mat(Min,YPos,workpiece), NewYPos is YPos - 1, for_all_ypos_not_todo(Min,NewYPos). for_all_ypos_not_todo(Min,YPos) :- YPos > 0, mat(Min,YPos,raw), grid_xpos(Min,_,Size), Size =< 3, NewYPos is YPos - 1, for_all_ypos_not_todo(Min,NewYPos). for_all_ypos_ready(Min,0) :- mat(Min,0,none). for_all_ypos_ready(Min,0) :- mat(Min,0,workpiece). for_all_ypos_ready(Min,Y) :- mat(Min,Y,none), Y1 is Y - 1, for_all_ypos_ready(Min,Y1). for_all_ypos_ready(Min,Y) :- mat(Min,Y,workpiece), Y1 is Y - 1, for_all_ypos_ready(Min,Y1). abs_chuck_pos(P) :- chuck_pos(P). abs_small_parts(left) :- covered_range(left,Min,Max), mat(XPos,_,raw), XPos =< Max, XPos >= Min, grid_xpos(XPos,_,Size), Size =< 3. abs_small_parts(right) :- covered_range(right,Min,Max), mat(XPos,_,raw), XPos =< Max, XPos >= Min, grid_xpos(XPos,_,Size), Size =< 3. abs_small_parts(middle) :- covered_range(left,Minl,Maxl), covered_range(right,Minr,Maxr), Min is Maxl + 1, Max is Minr - 1, mat(XPos,_,raw), XPos =< Max, XPos >= Min, grid_xpos(XPos,_,Size), Size =< 3. wp_plain(Min,Max,YSurface) :- Min > Max. wp_plain(Min,Max,YSurface) :- Min =< Max, wp_surface(Min,YSurface), Min1 is Min + 1, wp_plain(Min1,Max,YSurface). abs_chuckable_wp(right) :- covered_range(right,Min,Max), wp_plain(Min,Max,_). abs_chuckable_wp(left) :- covered_range(left,Min,Max), wp_plain(Min,Max,_). wp_surface(XPos,YSurface) :- mat(XPos,YSurface,workpiece), Y1 is YSurface + 1, mat(XPos,Y1,MAT), MAT \= workpiece.