// begin of capabilities.pl code file. // begin of unit capabilities code. final class capabilities_capabilities_3 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: capabilities(_G436, _G437, _G438) case 0: m.allocate (5); //m.success = m.get_y_value (4,1); /* Queue */ m.get_y_value (2,2); /* ActionQueue */ m.get_y_value (1,3); /* BeliefBase */ m.cut_level (0); m.end_head (); break; case 1: // goal: repeat m.call (dlplib.repeat_0); /*6*/ break; case 2: // goal: get_queue(_G436, _G450) m.put_y_value (4,1); /* 'Queue' */ m.put_y_value (3,2); /* 'Event' */ m.call (dlplib.get_queue_2); /*6*/ break; case 3: // goal: proces_event(_G450, _G437, _G438) m.put_y_value (3,1); /* 'Event' */ m.put_y_value (2,2); /* 'ActionQueue' */ m.put_y_value (1,3); /* 'BeliefBase' */ m.call (1) /*2*/; /* proces_event_3 */ break; case 4: // goal: fail m.call (dlplib.fail_0); /*6*/ break; case 5: // goal: ! m.cut_tail (0); m.deallocate (); break; case 6: m.end_rule (); break; } // switch return m.success; } // capabilities:capabilities/3 exec() // capabilities:capabilities/3 decls. // end of capabilities:capabilities/3 decls. public boolean init (DLP m) { return true; } // capabilities:capabilities/3 init() } // capabilities:capabilities/3 final class capabilities_proces_event_3 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: proces_event(walk, _G437, _G438) case 0: m.try_me_else (3); //m.success = m.get_atom (walk__0,1); m.get_x_varia (11,2); /* ActionQueue */ m.get_x_varia (12,3); /* BeliefBase */ m.cut_neck (); m.end_head (); break; case 1: // goal: move(_G437, _G438) m.put_x_value (11,1); /* 'ActionQueue' */ m.put_x_value (12,2); /* 'BeliefBase' */ m.exec (2); /* move_2 */ break; case 2: m.end_rule (); break; // head: proces_event(grab(_G1996), _G1990, _G1991) case 3: m.trust_or_fail (); //m.success = m.get_struct (grab__1,1); m.uni_x_varia (11); /* Object */ m.get_x_varia (12,2); /* ActionQueue */ m.get_x_varia (13,3); /* BeliefBase */ m.cut_neck (); m.end_head (); break; case 4: // goal: grab(_G1996, _G1990, _G1991) m.put_x_value (11,1); /* 'Object' */ m.put_x_value (12,2); /* 'ActionQueue' */ m.put_x_value (13,3); /* 'BeliefBase' */ m.exec (3); /* grab_3 */ break; case 5: m.end_rule (); break; } // switch return m.success; } // capabilities:proces_event/3 exec() // capabilities:proces_event/3 decls. public SymbolDescriptor walk__0; public SymbolDescriptor grab__1; // end of capabilities:proces_event/3 decls. public boolean init (DLP m) { walk__0 = m.define_symbol ("walk".intern(), 0); grab__1 = m.define_symbol ("grab".intern(), 1); return true; } // capabilities:proces_event/3 init() } // capabilities:proces_event/3 final class capabilities_move_2 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: move(_G436, _G437) case 0: m.allocate (20); //m.success = m.get_y_value (1,1); /* ActionQueue */ m.get_y_value (4,2); /* BeliefBase */ m.cut_level (0); m.end_head (); break; case 1: // goal: <-(this, _G437, lookup_attr(belief, position(_G451, _G452, _G453))) m.put_struct (position__3,10); m.set_y_value (18); /* 'X' */ m.set_v_varia (); /* 'Unknown' */ m.set_y_value (17); /* 'Z' */ m.put_this (1); m.put_y_value (4,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_atom (belief__0); m.set_x_value (10); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 2: // goal: <-(this, _G437, lookup_attr(belief, rotation(_G464))) m.put_struct (rotation__1,12); m.set_y_value (19); /* 'R' */ m.put_this (1); m.put_y_value (4,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_atom (belief__0); m.set_x_value (12); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 3: // goal: <-(this, _G437, lookup_attr(belief, destination(_G475, _G476))) m.put_struct (destination__2,13); m.set_y_value (3); /* 'Xdest' */ m.set_y_value (2); /* 'Zdest' */ m.put_this (1); m.put_y_value (4,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_atom (belief__0); m.set_x_value (13); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 4: // goal: get_direction(_G451, _G453, _G464, _G475, _G476, _G486) m.put_y_value (18,1); /* 'X' */ m.put_y_value (17,2); /* 'Z' */ m.put_y_value (19,3); /* 'R' */ m.put_y_value (3,4); /* 'Xdest' */ m.put_y_value (2,5); /* 'Zdest' */ m.put_y_value (16,6); /* 'R1' */ m.call (4) /*2*/; /* get_direction_6 */ break; case 5: // goal: set_queue(_G436, rot(_G486)) m.put_y_value (1,1); /* 'ActionQueue' */ m.put_struct (rot__1,2); m.set_y_value (16); /* 'R1' */ m.call (dlplib.set_queue_2); /*6*/ break; case 6: // goal: assign_nlv_term(this, nreg, 0, _G451) m.put_this (1); m.put_nreg (2); m.put_int (0,3); m.put_y_value (18,4); /* 'X' */ m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 7: // goal: assign_nlv_term(this, nreg, 1, _G453) m.put_this (1); m.put_nreg (2); m.put_int (1,3); m.put_y_value (17,4); /* 'Z' */ m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 8: // goal: assign_nlv_term(this, nreg, 2, _G486) m.put_this (1); m.put_nreg (2); m.put_int (2,3); m.put_y_value (16,4); /* 'R1' */ m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 9: // goal: repeat m.call (dlplib.repeat_0); /*6*/ break; case 10: // goal: is_eval(_G475, _G2778) m.put_y_value (3,1); /* 'Xdest' */ m.put_y_value (15,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 11: // goal: is_eval(x, _G2781) m.put_z_value (0,1); /* x */ m.put_y_value (14,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 12: // goal: is_if_sub_if(_G2778, _G2781, _G520) m.put_y_value (15,1); /* 'Unknown' */ m.put_y_value (14,2); /* 'Unknown' */ m.put_y_value (11,3); /* 'Xdif' */ m.call (dlplib.is_if_sub_if_3); /*6*/ break; case 13: // goal: is_eval(_G476, _G3026) m.put_y_value (2,1); /* 'Zdest' */ m.put_y_value (13,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 14: // goal: is_eval(z, _G3029) m.put_z_value (1,1); /* z */ m.put_y_value (12,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 15: // goal: is_if_sub_if(_G3026, _G3029, _G529) m.put_y_value (13,1); /* 'Unknown' */ m.put_y_value (12,2); /* 'Unknown' */ m.put_y_value (10,3); /* 'Zdif' */ m.call (dlplib.is_if_sub_if_3); /*6*/ break; case 16: // goal: is_eval(sqrt(_G520*_G520+_G529*_G529), _G538) m.put_struct (op__mul__2,14); m.set_y_value (11); /* 'Xdif' */ m.set_y_value (11); /* 'Xdif' */ m.put_struct (op__mul__2,15); m.set_y_value (10); /* 'Zdif' */ m.set_y_value (10); /* 'Zdif' */ m.put_struct (op__add__2,16); m.set_x_value (14); /* 'Xtmp' */ m.set_x_value (15); /* 'Xtmp' */ m.put_struct (sqrt__1,1); m.set_x_value (16); /* 'Xtmp' */ m.put_y_value (9,2); /* 'Distance' */ m.call (dlplib.is_eval_2); /*6*/ break; case 17: // goal: destination(_G538, _G556, _G557) m.put_y_value (9,1); /* 'Distance' */ m.put_y_value (8,2); /* 'StepLength' */ m.put_y_value (5,3); /* 'Destination' */ m.call (5) /*2*/; /* destination_3 */ break; case 18: // goal: is_eval(sin(r)*_G556/2, _G562) m.put_struct (sin__1,17); m.set_z_value (2); /* r */ m.put_struct (op__mul__2,18); m.set_x_value (17); /* 'Xtmp' */ m.set_y_value (8); /* 'StepLength' */ m.put_struct (op__div__2,1); m.set_x_value (18); /* 'Xtmp' */ m.set_int (2); m.put_y_value (7,2); /* 'Xstep' */ m.call (dlplib.is_eval_2); /*6*/ break; case 19: // goal: is_eval(cos(r)*_G556/2, _G576) m.put_struct (cos__1,19); m.set_z_value (2); /* r */ m.put_struct (op__mul__2,20); m.set_x_value (19); /* 'Xtmp' */ m.set_y_value (8); /* 'StepLength' */ m.put_struct (op__div__2,1); m.set_x_value (20); /* 'Xtmp' */ m.set_int (2); m.put_y_value (6,2); /* 'Zstep' */ m.call (dlplib.is_eval_2); /*6*/ break; case 20: // goal: set_queue(_G436, walk(_G562, 0, _G576)) m.put_y_value (1,1); /* 'ActionQueue' */ m.put_struct (walk__3,2); m.set_y_value (7); /* 'Xstep' */ m.set_float (0f); m.set_y_value (6); /* 'Zstep' */ m.call (dlplib.set_queue_2); /*6*/ break; case 21: // goal: assign_nlv_expr(this, nreg, 0, x+_G562*2) m.put_struct (op__mul__2,21); m.set_y_value (7); /* 'Xstep' */ m.set_int (2); m.put_this (1); m.put_nreg (2); m.put_int (0,3); m.put_struct (op__add__2,4); m.set_z_value (0); /* x */ m.set_x_value (21); /* 'Xtmp' */ m.call (dlplib.assign_nlv_expr_4); /*6*/ break; case 22: // goal: assign_nlv_expr(this, nreg, 1, z+_G576*2) m.put_struct (op__mul__2,22); m.set_y_value (6); /* 'Zstep' */ m.set_int (2); m.put_this (1); m.put_nreg (2); m.put_int (1,3); m.put_struct (op__add__2,4); m.set_z_value (1); /* z */ m.set_x_value (22); /* 'Xtmp' */ m.call (dlplib.assign_nlv_expr_4); /*6*/ break; case 23: // goal: format('x is ~w, z is ~w~n', [x, z]) m.put_list (23); m.set_z_value (1); /* z */ m.set_nil (); m.put_atom (data__1__0,1); m.put_list (2); m.set_z_value (0); /* x */ m.set_x_value (23); /* 'Xtmp' */ m.call (dlplib.format_2); /*6*/ break; case 24: // goal: call(this, _G557) m.put_this (1); m.put_y_value (5,2); /* 'Destination' */ m.call (dlplib.call_2); /*6*/ break; case 25: // goal: <-(this, _G437, delete_attr(belief, destination(_G475, _G476))) m.put_struct (destination__2,24); m.set_y_value (3); /* 'Xdest' */ m.set_y_value (2); /* 'Zdest' */ m.put_this (1); m.put_y_value (4,2); /* 'BeliefBase' */ m.put_struct (delete_attr__2,3); m.set_atom (belief__0); m.set_x_value (24); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 26: // goal: set_queue(_G436, stand) m.put_y_value (1,1); /* 'ActionQueue' */ m.put_atom (stand__0,2); m.call (dlplib.set_queue_2); /*6*/ break; case 27: // goal: ! m.cut_tail (0); m.deallocate (); break; case 28: m.end_rule (); break; } // switch return m.success; } // capabilities:move/2 exec() // capabilities:move/2 decls. public SymbolDescriptor this__0; public SymbolDescriptor lookup_attr__2; public SymbolDescriptor belief__0; public SymbolDescriptor position__3; public SymbolDescriptor rotation__1; public SymbolDescriptor destination__2; public SymbolDescriptor rot__1; public SymbolDescriptor sqrt__1; public SymbolDescriptor op__add__2; public SymbolDescriptor op__mul__2; public SymbolDescriptor op__div__2; public SymbolDescriptor sin__1; public SymbolDescriptor cos__1; public SymbolDescriptor walk__3; public SymbolDescriptor data__1__0; public SymbolDescriptor op__dot__2; public SymbolDescriptor sl_sr__0; public SymbolDescriptor delete_attr__2; public SymbolDescriptor stand__0; // end of capabilities:move/2 decls. public boolean init (DLP m) { this__0 = m.define_symbol ("this".intern(), 0); lookup_attr__2 = m.define_symbol ("lookup_attr".intern(), 2); belief__0 = m.define_symbol ("belief".intern(), 0); position__3 = m.define_symbol ("position".intern(), 3); rotation__1 = m.define_symbol ("rotation".intern(), 1); destination__2 = m.define_symbol ("destination".intern(), 2); rot__1 = m.define_symbol ("rot".intern(), 1); sqrt__1 = m.define_symbol ("sqrt".intern(), 1); op__add__2 = m.define_symbol ("+".intern(), 2); op__mul__2 = m.define_symbol ("*".intern(), 2); op__div__2 = m.define_symbol ("/".intern(), 2); sin__1 = m.define_symbol ("sin".intern(), 1); cos__1 = m.define_symbol ("cos".intern(), 1); walk__3 = m.define_symbol ("walk".intern(), 3); data__1__0 = m.define_symbol ("x is ~w, z is ~w~n".intern(), 0); op__dot__2 = m.define_symbol (".".intern(), 2); sl_sr__0 = m.define_symbol ("[]".intern(), 0); delete_attr__2 = m.define_symbol ("delete_attr".intern(), 2); stand__0 = m.define_symbol ("stand".intern(), 0); return true; } // capabilities:move/2 init() } // capabilities:move/2 final class capabilities_grab_3 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: grab(_G436, _G437, _G438) case 0: m.allocate (25); //m.success = m.get_y_value (22,1); /* Object */ m.get_y_value (1,2); /* ActionQueue */ m.get_y_value (0,3); /* BeliefBase */ m.end_head (); break; case 1: // goal: <-(this, _G438, lookup_attr(belief, position(_G452, _G453, _G454))) m.put_struct (position__3,11); m.set_y_value (15); /* 'X' */ m.set_y_value (24); /* 'Y' */ m.set_y_value (10); /* 'Z' */ m.put_this (1); m.put_y_value (0,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_atom (belief__0); m.set_x_value (11); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 2: // goal: <-(this, _G438, lookup_attr(belief, rotation(_G465))) m.put_struct (rotation__1,12); m.set_y_value (21); /* 'R' */ m.put_this (1); m.put_y_value (0,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_atom (belief__0); m.set_x_value (12); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 3: // goal: <-(this, _G438, lookup_attr(_G436, position(_G476, _G477, _G478))) m.put_struct (position__3,13); m.set_y_value (20); /* 'X1' */ m.set_y_value (23); /* 'Y1' */ m.set_y_value (19); /* 'Z1' */ m.put_this (1); m.put_y_value (0,2); /* 'BeliefBase' */ m.put_struct (lookup_attr__2,3); m.set_y_value (22); /* 'Object' */ m.set_x_value (13); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 4: // goal: distance(_G452, _G453, _G454, _G476, _G477, _G478, _G489, _G436) m.put_y_value (15,1); /* 'X' */ m.put_y_value (24,2); /* 'Y' */ m.put_y_value (10,3); /* 'Z' */ m.put_y_value (20,4); /* 'X1' */ m.put_y_value (23,5); /* 'Y1' */ m.put_y_value (19,6); /* 'Z1' */ m.put_y_value (18,7); /* 'Dist' */ m.put_y_value (22,8); /* 'Object' */ m.call (6) /*2*/; /* distance_8 */ break; case 5: // goal: get_direction(_G452, _G454, _G465, _G476, _G478, _G500) m.put_y_value (15,1); /* 'X' */ m.put_y_value (10,2); /* 'Z' */ m.put_y_value (21,3); /* 'R' */ m.put_y_value (20,4); /* 'X1' */ m.put_y_value (19,5); /* 'Z1' */ m.put_y_value (9,6); /* 'R2' */ m.call (4) /*2*/; /* get_direction_6 */ break; case 6: // goal: is_eval(_G489, _G2601) m.put_y_value (18,1); /* 'Dist' */ m.put_y_value (17,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 7: // goal: is_eval(reach, _G2604) m.put_z_value (3,1); /* reach */ m.put_y_value (16,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 8: // goal: is_if_sub_if(_G2601, _G2604, _G505) m.put_y_value (17,1); /* 'Unknown' */ m.put_y_value (16,2); /* 'Unknown' */ m.put_y_value (8,3); /* 'Dist2dest' */ m.call (dlplib.is_if_sub_if_3); /*6*/ break; case 9: // goal: is_eval(_G452, _G2886) m.put_y_value (15,1); /* 'X' */ m.put_y_value (12,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 10: // goal: is_eval(sin(_G500), _G2889) m.put_struct (sin__1,1); m.set_y_value (9); /* 'R2' */ m.put_y_value (14,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 11: // goal: is_eval(_G505, _G2892) m.put_y_value (8,1); /* 'Dist2dest' */ m.put_y_value (13,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 12: // goal: is_if_mul_if(_G2889, _G2892, _G2902) m.put_y_value (14,1); /* 'Unknown' */ m.put_y_value (13,2); /* 'Unknown' */ m.put_y_value (11,3); /* 'Unknown' */ m.call (dlplib.is_if_mul_if_3); /*6*/ break; case 13: // goal: is_if_add_if(_G2886, _G2902, _G514) m.put_y_value (12,1); /* 'Unknown' */ m.put_y_value (11,2); /* 'Unknown' */ m.put_y_value (3,3); /* 'Xdest' */ m.call (dlplib.is_if_add_if_3); /*6*/ break; case 14: // goal: is_eval(_G454, _G3579) m.put_y_value (10,1); /* 'Z' */ m.put_y_value (5,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 15: // goal: is_eval(cos(_G500), _G3582) m.put_struct (cos__1,1); m.set_y_value (9); /* 'R2' */ m.put_y_value (7,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 16: // goal: is_eval(_G505, _G3585) m.put_y_value (8,1); /* 'Dist2dest' */ m.put_y_value (6,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 17: // goal: is_if_mul_if(_G3582, _G3585, _G3595) m.put_y_value (7,1); /* 'Unknown' */ m.put_y_value (6,2); /* 'Unknown' */ m.put_y_value (4,3); /* 'Unknown' */ m.call (dlplib.is_if_mul_if_3); /*6*/ break; case 18: // goal: is_if_add_if(_G3579, _G3595, _G528) m.put_y_value (5,1); /* 'Unknown' */ m.put_y_value (4,2); /* 'Unknown' */ m.put_y_value (2,3); /* 'Zdest' */ m.call (dlplib.is_if_add_if_3); /*6*/ break; case 19: // goal: <-(this, _G438, add_attr(belief, destination(_G514, _G528))) m.put_struct (destination__2,14); m.set_y_value (3); /* 'Xdest' */ m.set_y_value (2); /* 'Zdest' */ m.put_this (1); m.put_y_value (0,2); /* 'BeliefBase' */ m.put_struct (add_attr__2,3); m.set_atom (belief__0); m.set_x_value (14); /* 'Xtmp' */ m.call (dlplib.op_call_3); /*6*/ break; case 20: // goal: move(_G437, _G438) m.put_y_value (1,1); /* 'ActionQueue' */ m.put_y_value (0,2); /* 'BeliefBase' */ m.deallocate (); m.exec (2); /* move_2 */ break; case 21: m.end_rule (); break; } // switch return m.success; } // capabilities:grab/3 exec() // capabilities:grab/3 decls. public SymbolDescriptor this__0; public SymbolDescriptor lookup_attr__2; public SymbolDescriptor belief__0; public SymbolDescriptor position__3; public SymbolDescriptor rotation__1; public SymbolDescriptor sin__1; public SymbolDescriptor cos__1; public SymbolDescriptor add_attr__2; public SymbolDescriptor destination__2; // end of capabilities:grab/3 decls. public boolean init (DLP m) { this__0 = m.define_symbol ("this".intern(), 0); lookup_attr__2 = m.define_symbol ("lookup_attr".intern(), 2); belief__0 = m.define_symbol ("belief".intern(), 0); position__3 = m.define_symbol ("position".intern(), 3); rotation__1 = m.define_symbol ("rotation".intern(), 1); sin__1 = m.define_symbol ("sin".intern(), 1); cos__1 = m.define_symbol ("cos".intern(), 1); add_attr__2 = m.define_symbol ("add_attr".intern(), 2); destination__2 = m.define_symbol ("destination".intern(), 2); return true; } // capabilities:grab/3 init() } // capabilities:grab/3 final class capabilities_init_vars_0 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: init_vars case 0: m.allocate (0); //m.success = m.end_head (); break; case 1: // goal: assign_nlv_term(this, nreg, 0, no_init) m.put_this (1); m.put_nreg (2); m.put_int (0,3); m.put_atom (no_init__0,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 2: // goal: assign_nlv_term(this, nreg, 1, no_init) m.put_this (1); m.put_nreg (2); m.put_int (1,3); m.put_atom (no_init__0,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 3: // goal: assign_nlv_term(this, nreg, 2, no_init) m.put_this (1); m.put_nreg (2); m.put_int (2,3); m.put_atom (no_init__0,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 4: // goal: assign_nlv_term(this, nreg, 3, 0.6) m.put_this (1); m.put_nreg (2); m.put_int (3,3); m.put_float (0.6f,4); m.deallocate (); m.exec (dlplib.assign_nlv_term_4); break; case 5: m.end_rule (); break; } // switch return m.success; } // capabilities:init_vars/0 exec() // capabilities:init_vars/0 decls. public SymbolDescriptor no_init__0; // end of capabilities:init_vars/0 decls. public boolean init (DLP m) { no_init__0 = m.define_symbol ("no_init".intern(), 0); return true; } // capabilities:init_vars/0 init() } // capabilities:init_vars/0 class capabilities extends Code { public static ObjectDescriptor object; public static ObjectDescriptor _bcilib; public static ObjectDescriptor _positioning; public static MethodDescriptor capabilities_3; public static MethodDescriptor proces_event_3; public static MethodDescriptor move_2; public static MethodDescriptor grab_3; public static MethodDescriptor get_direction_6; public static MethodDescriptor destination_3; public static MethodDescriptor distance_8; public boolean init (DLP m) { object = m.define_object ("capabilities".intern(), 2, 7, 4); _bcilib = m.header_object (object, "bcilib".intern(), 0); _positioning = m.header_object (object, "positioning".intern(), 1); capabilities_3 = m.define_method (object, 0, "capabilities".intern(), 3); proces_event_3 = m.define_method (object, 1, "proces_event".intern(), 3); move_2 = m.define_method (object, 2, "move".intern(), 2); grab_3 = m.define_method (object, 3, "grab".intern(), 3); get_direction_6 = m.extern_method (object, 4, "get_direction".intern(), 6); destination_3 = m.extern_method (object, 5, "destination".intern(), 3); distance_8 = m.extern_method (object, 6, "distance".intern(), 8); m.define_nonlog (object, "x".intern(), 0); m.define_nonlog (object, "z".intern(), 1); m.define_nonlog (object, "r".intern(), 2); m.define_nonlog (object, "reach".intern(), 3); return true; } // capabilities init() } // class capabilities // end of unit capabilities code. // begin of unit positioning code. final class positioning_get_direction_6 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: get_direction(_G433, _G434, _G435, _G436, _G437, _G438) case 0: m.try_me_else (9); m.allocate (11); //m.success = m.get_y_value (10,1); /* X */ m.get_y_value (6,2); /* Z */ m.get_y_value (1,3); /* R */ m.get_x_varia (12,4); /* Xdest */ m.get_y_value (7,5); /* Zdest */ m.get_y_value (0,6); /* R1 */ m.end_head (); break; case 1: // goal: is_eval(_G436, _G635) m.put_x_value (12,1); /* 'Xdest' */ m.put_y_value (9,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 2: // goal: is_eval(_G433, _G638) m.put_y_value (10,1); /* 'X' */ m.put_y_value (8,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 3: // goal: is_if_sub_if(_G635, _G638, _G446) m.put_y_value (9,1); /* 'Unknown' */ m.put_y_value (8,2); /* 'Unknown' */ m.put_y_value (3,3); /* 'Xdif' */ m.call (dlplib.is_if_sub_if_3); /*6*/ break; case 4: // goal: is_eval(_G437, _G886) m.put_y_value (7,1); /* 'Zdest' */ m.put_y_value (5,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 5: // goal: is_eval(_G434, _G889) m.put_y_value (6,1); /* 'Z' */ m.put_y_value (4,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 6: // goal: is_if_sub_if(_G886, _G889, _G455) m.put_y_value (5,1); /* 'Unknown' */ m.put_y_value (4,2); /* 'Unknown' */ m.put_y_value (2,3); /* 'Zdif' */ m.call (dlplib.is_if_sub_if_3); /*6*/ break; case 7: // goal: rotation(_G446, _G455, _G435, _G438) m.put_y_value (3,1); /* 'Xdif' */ m.put_y_value (2,2); /* 'Zdif' */ m.put_y_value (1,3); /* 'R' */ m.put_y_value (0,4); /* 'R1' */ m.deallocate (); m.exec (1); /* rotation_4 */ break; case 8: m.end_rule (); break; // head: get_direction(_G5789, _G5790, _G5791, false, false, _G5791) case 9: m.trust_or_fail (); //m.success = m.get_v_varia (1); /* Unknown */ m.get_v_varia (2); /* Unknown */ m.get_x_varia (14,3); /* R */ m.get_atom (false__0,4); m.get_atom (false__0,5); m.get_x_value (14,6); /* R */ m.cut_neck (); m.end_head (); break; case 10: m.end_fact (); break; } // switch return m.success; } // positioning:get_direction/6 exec() // positioning:get_direction/6 decls. public SymbolDescriptor false__0; // end of positioning:get_direction/6 decls. public boolean init (DLP m) { false__0 = m.define_symbol ("false".intern(), 0); return true; } // positioning:get_direction/6 init() } // positioning:get_direction/6 final class positioning_rotation_4 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: rotation(0, 0, _G435, _G435) case 0: m.try_me_else (2); //m.success = m.get_float (0f,1); m.get_float (0f,2); m.get_x_varia (11,3); /* R */ m.get_x_value (11,4); /* R */ m.cut_neck (); m.end_head (); break; case 1: m.end_fact (); break; // head: rotation(0, _G1567, _G1568, _G1569) case 2: m.retry_me_else (7); m.allocate (3); //m.success = m.get_float (0f,1); m.get_y_value (1,2); /* Zdif */ m.get_v_varia (3); /* Unknown */ m.get_y_value (0,4); /* R */ m.cut_level (2); m.end_head (); break; case 3: // goal: _G1567\==0 m.put_y_value (1,1); /* 'Zdif' */ m.put_float (0f,2); m.call (dlplib.op_at_cmp_ne_2); /*6*/ break; case 4: // goal: ! m.cut_body (2); break; case 5: // goal: is_eval(acos(sign(_G1567)), _G1569) m.put_struct (sign__1,12); m.set_y_value (1); /* 'Zdif' */ m.put_struct (acos__1,1); m.set_x_value (12); /* 'Xtmp' */ m.put_y_value (0,2); /* 'R' */ m.deallocate (); m.exec (dlplib.is_eval_2); break; case 6: m.end_rule (); break; // head: rotation(_G4026, 0, _G4028, _G4029) case 7: m.retry_me_else (14); m.allocate (5); //m.success = m.get_y_value (3,1); /* Xdif */ m.get_float (0f,2); m.get_v_varia (3); /* Unknown */ m.get_y_value (0,4); /* R */ m.cut_level (4); m.end_head (); break; case 8: // goal: _G4026\==0 m.put_y_value (3,1); /* 'Xdif' */ m.put_float (0f,2); m.call (dlplib.op_at_cmp_ne_2); /*6*/ break; case 9: // goal: ! m.cut_body (4); break; case 10: // goal: is_eval(asin(1), _G4179) m.put_struct (asin__1,1); m.set_int (1); m.put_y_value (2,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 11: // goal: is_eval(sign(_G4026), _G4182) m.put_struct (sign__1,1); m.set_y_value (3); /* 'Xdif' */ m.put_y_value (1,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 12: // goal: is_if_mul_if(_G4179, _G4182, _G4029) m.put_y_value (2,1); /* 'Unknown' */ m.put_y_value (1,2); /* 'Unknown' */ m.put_y_value (0,3); /* 'R' */ m.deallocate (); m.exec (dlplib.is_if_mul_if_3); break; case 13: m.end_rule (); break; // head: rotation(_G7210, _G7211, _G7212, _G7213) case 14: m.retry_me_else (20); m.allocate (4); //m.success = m.get_y_value (2,1); /* Xdif */ m.get_y_value (1,2); /* Zdif */ m.get_v_varia (3); /* Unknown */ m.get_y_value (0,4); /* R */ m.cut_level (3); m.end_head (); break; case 15: // goal: _G7210\==0 m.put_y_value (2,1); /* 'Xdif' */ m.put_float (0f,2); m.call (dlplib.op_at_cmp_ne_2); /*6*/ break; case 16: // goal: _G7211>0 m.put_y_value (1,1); /* 'Zdif' */ m.put_float (0f,2); m.call (dlplib.op_cmp_gt_2); /*6*/ break; case 17: // goal: ! m.cut_body (3); break; case 18: // goal: is_eval(atan(_G7210/_G7211), _G7213) m.put_struct (op__div__2,12); m.set_y_value (2); /* 'Xdif' */ m.set_y_value (1); /* 'Zdif' */ m.put_struct (atan__1,1); m.set_x_value (12); /* 'Xtmp' */ m.put_y_value (0,2); /* 'R' */ m.deallocate (); m.exec (dlplib.is_eval_2); break; case 19: m.end_rule (); break; // head: rotation(_G10219, _G10220, _G10221, _G10222) case 20: m.trust_or_fail (); m.allocate (6); //m.success = m.get_y_value (4,1); /* Xdif */ m.get_y_value (3,2); /* Zdif */ m.get_v_varia (3); /* Unknown */ m.get_y_value (0,4); /* R */ m.cut_level (5); m.end_head (); break; case 21: // goal: _G10219\==0 m.put_y_value (4,1); /* 'Xdif' */ m.put_float (0f,2); m.call (dlplib.op_at_cmp_ne_2); /*6*/ break; case 22: // goal: _G10220<0 m.put_y_value (3,1); /* 'Zdif' */ m.put_float (0f,2); m.call (dlplib.op_cmp_lt_2); /*6*/ break; case 23: // goal: ! m.cut_body (5); break; case 24: // goal: is_eval(acos(-1), _G10447) m.put_struct (acos__1,1); m.set_int (-1); m.put_y_value (2,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 25: // goal: is_eval(atan(_G10219/_G10220), _G10450) m.put_struct (op__div__2,12); m.set_y_value (4); /* 'Xdif' */ m.set_y_value (3); /* 'Zdif' */ m.put_struct (atan__1,1); m.set_x_value (12); /* 'Xtmp' */ m.put_y_value (1,2); /* 'Unknown' */ m.call (dlplib.is_eval_2); /*6*/ break; case 26: // goal: is_if_add_if(_G10447, _G10450, _G10222) m.put_y_value (2,1); /* 'Unknown' */ m.put_y_value (1,2); /* 'Unknown' */ m.put_y_value (0,3); /* 'R' */ m.deallocate (); m.exec (dlplib.is_if_add_if_3); break; case 27: m.end_rule (); break; } // switch return m.success; } // positioning:rotation/4 exec() // positioning:rotation/4 decls. public SymbolDescriptor acos__1; public SymbolDescriptor sign__1; public SymbolDescriptor asin__1; public SymbolDescriptor atan__1; public SymbolDescriptor op__div__2; // end of positioning:rotation/4 decls. public boolean init (DLP m) { acos__1 = m.define_symbol ("acos".intern(), 1); sign__1 = m.define_symbol ("sign".intern(), 1); asin__1 = m.define_symbol ("asin".intern(), 1); atan__1 = m.define_symbol ("atan".intern(), 1); op__div__2 = m.define_symbol ("/".intern(), 2); return true; } // positioning:rotation/4 init() } // positioning:rotation/4 final class positioning_avoid_obstacle_8 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: avoid_obstacle(_G433, _G434, _G435, _G436, _G437, _G435, _G436, _G437) case 0: //m.success = m.get_v_varia (1); /* Unknown */ m.get_v_varia (2); /* Unknown */ m.get_x_varia (15,3); /* Xdest */ m.get_x_varia (16,4); /* Zdest */ m.get_x_varia (17,5); /* R */ m.get_x_value (15,6); /* Xdest */ m.get_x_value (16,7); /* Zdest */ m.get_x_value (17,8); /* R */ m.end_head (); break; case 1: m.end_fact (); break; } // switch return m.success; } // positioning:avoid_obstacle/8 exec() // positioning:avoid_obstacle/8 decls. // end of positioning:avoid_obstacle/8 decls. public boolean init (DLP m) { return true; } // positioning:avoid_obstacle/8 init() } // positioning:avoid_obstacle/8 final class positioning_destination_3 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: destination(_G433, maxStepLength, fail) case 0: m.try_me_else (4); m.allocate (1); //m.success = m.get_x_varia (11,1); /* Distance */ m.get_z_value (0,2); /* maxStepLength */ m.get_atom (fail__0,3); m.cut_level (0); m.end_head (); break; case 1: // goal: _G433>maxStepLength m.put_x_value (11,1); /* 'Distance' */ m.put_z_value (0,2); /* maxStepLength */ m.call (dlplib.op_cmp_gt_2); /*6*/ break; case 2: // goal: ! m.cut_tail (0); m.deallocate (); break; case 3: m.end_rule (); break; // head: destination(_G2049, _G2049, true) case 4: m.trust_or_fail (); m.allocate (1); //m.success = m.get_x_varia (11,1); /* Distance */ m.get_x_value (11,2); /* Distance */ m.get_atom (true__0,3); m.cut_level (0); m.end_head (); break; case 5: // goal: _G2049=_G434 m.put_y_value (2,1); /* 'X' */ m.put_x_value (11,2); /* 'X1' */ m.call (dlplib.op_cmp_gt_2); /*6*/ break; case 2: // goal: _G433<_G435 m.put_y_value (2,1); /* 'X' */ m.put_y_value (1,2); /* 'X2' */ m.call (dlplib.op_cmp_lt_2); /*6*/ break; case 3: // goal: ! m.cut_tail (0); m.deallocate (); break; case 4: m.end_rule (); break; // head: between1(_G2582, _G2583, _G2584) case 5: m.trust_or_fail (); m.allocate (3); //m.success = m.get_y_value (2,1); /* X */ m.get_y_value (1,2); /* X1 */ m.get_x_varia (11,3); /* X2 */ m.cut_level (0); m.end_head (); break; case 6: // goal: _G2582>_G2584 m.put_y_value (2,1); /* 'X' */ m.put_x_value (11,2); /* 'X2' */ m.call (dlplib.op_cmp_gt_2); /*6*/ break; case 7: // goal: _G2582<_G2583 m.put_y_value (2,1); /* 'X' */ m.put_y_value (1,2); /* 'X1' */ m.call (dlplib.op_cmp_lt_2); /*6*/ break; case 8: // goal: ! m.cut_tail (0); m.deallocate (); break; case 9: m.end_rule (); break; } // switch return m.success; } // positioning:between1/3 exec() // positioning:between1/3 decls. // end of positioning:between1/3 decls. public boolean init (DLP m) { return true; } // positioning:between1/3 init() } // positioning:between1/3 final class positioning_init_vars_0 extends Code { public boolean exec (DLP m) { switch (m.PSreg) { // head: init_vars case 0: m.allocate (0); //m.success = m.end_head (); break; case 1: // goal: assign_nlv_term(this, nreg, 0, 0.6) m.put_this (1); m.put_nreg (2); m.put_int (0,3); m.put_float (0.6f,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 2: // goal: assign_nlv_term(this, nreg, 1, 1.2) m.put_this (1); m.put_nreg (2); m.put_int (1,3); m.put_float (1.2f,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 3: // goal: assign_nlv_term(this, nreg, 2, 0.6) m.put_this (1); m.put_nreg (2); m.put_int (2,3); m.put_float (0.6f,4); m.call (dlplib.assign_nlv_term_4); /*6*/ break; case 4: // goal: assign_nlv_term(this, nreg, 3, 0.6) m.put_this (1); m.put_nreg (2); m.put_int (3,3); m.put_float (0.6f,4); m.deallocate (); m.exec (dlplib.assign_nlv_term_4); break; case 5: m.end_rule (); break; } // switch return m.success; } // positioning:init_vars/0 exec() // positioning:init_vars/0 decls. // end of positioning:init_vars/0 decls. public boolean init (DLP m) { return true; } // positioning:init_vars/0 init() } // positioning:init_vars/0 class positioning extends Code { public static ObjectDescriptor object; public static ObjectDescriptor _bcilib; public static MethodDescriptor get_direction_6; public static MethodDescriptor rotation_4; public static MethodDescriptor avoid_obstacle_8; public static MethodDescriptor destination_3; public static MethodDescriptor distance_8; public static MethodDescriptor between1_3; public boolean init (DLP m) { object = m.define_object ("positioning".intern(), 1, 6, 4); _bcilib = m.header_object (object, "bcilib".intern(), 0); get_direction_6 = m.define_method (object, 0, "get_direction".intern(), 6); rotation_4 = m.define_method (object, 1, "rotation".intern(), 4); avoid_obstacle_8 = m.define_method (object, 2, "avoid_obstacle".intern(), 8); destination_3 = m.define_method (object, 3, "destination".intern(), 3); distance_8 = m.define_method (object, 4, "distance".intern(), 8); between1_3 = m.define_method (object, 5, "between1".intern(), 3); m.define_nonlog (object, "maxStepLength".intern(), 0); m.define_nonlog (object, "maxHeight".intern(), 1); m.define_nonlog (object, "minHeight".intern(), 2); m.define_nonlog (object, "reach".intern(), 3); return true; } // positioning init() } // class positioning // end of unit positioning code. // end of capabilities.pl code file.