#| ******************************************************************************* PRODIGY Version 2.01 Copyright 1989 by Alicia Perez The PRODIGY System was designed and built by Steven Minton, Craig Knoblock, Dan Kuokka and Jaime Carbonell. Additional contributors include Henrik Nordin, Yolanda Gil, Manuela Veloso, Robert Joseph, Santiago Rementeria, Alicia Perez, Ellen Riloff, Michael Miller, and Dan Kahn. The PRODIGY system is experimental software for research purposes only. This software is made available under the following conditions: 1) PRODIGY will only be used for internal, noncommercial research purposes. 2) The code will not be distributed to other sites without the explicit permission of the designers. PRODIGY is available by request. 3) Any bugs, bug fixes, or extensions will be forwarded to the designers. Send comments or requests to: prodigy@cs.cmu.edu or The PRODIGY PROJECT, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213. *******************************************************************************|# ;;; ;;; This is an unstable version; new control rules are being tested and added, ;;; and the operators can also change. ;;; ;;; If you have any suggestion or question, please send mail to aperez@cs ;;; ;; Pushable means that the object can be pushed, independently of the number ;; of robots needed to push it ;; maximum weight that a robot alone can move: 100 (setq *OPERATORS* '( (GOTO-OBJECT (params ( )) (preconds (and (is-type robot) (or (is-type block) (is-type box) (is-type key)) (in-room ) (in-room ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (add (next-to ))))) (GOTO-DOOR (params ( )) (preconds (and (is-type robot) (is-type door) (connects ) (in-room ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (add (next-to ))))) (GOTO-LOC (params ( )) (preconds (and (is-type robot) (loc-in-room ) (in-room ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (add (at ))))) (PUSH-OBJECT ;just one robot (params ( )) (preconds (and (is-type robot) (or (is-type block) (is-type box)) (pushable ) (weight ) (less-than 100) (in-room ) (in-room ) (in-room ) (next-to ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (next-to )) (add (next-to )) (add (next-to )) (add (next-to ))))) (T-PUSH-OBJECT ;two robots (params ( )) (preconds (and (is-type robot) (is-type robot) (~ (equal-p )) (or (is-type block) (is-type box)) (pushable ) (in-room ) (in-room ) (in-room ) (in-room ) (next-to ) (next-to ) )) (effects ((if (at <11> <12>)(del (at <11> <12>))) (if (at <21> <22>)(del (at <21> <22>))) (if (next-to <13>)(del (next-to <13>))) (if (next-to <23>)(del (next-to <23>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (next-to )) (add (next-to )) (add (next-to )) (add (next-to )) (add (next-to )) (add (next-to ))))) (PUSH-TO-DOOR ;just one robot (params ( )) (preconds (and (is-type robot) (connects ) (pushable ) (weight ) (less-than 100) (is-type door) (in-room ) (in-room ) (next-to ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (next-to )) (add (next-to ))))) (T-PUSH-TO-DOOR ;two robots (params ( )) (preconds (and (is-type robot) (is-type robot) (~ (equal-p )) (connects ) (pushable ) (is-type door) (in-room ) (in-room ) (in-room ) (next-to ) (next-to ) )) (effects ((if (at <11> <12>)(del (at <11> <12>))) (if (at <21> <22>)(del (at <21> <22>))) (if (next-to <13>)(del (next-to <13>))) (if (next-to <23>)(del (next-to <23>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (next-to )) (add (next-to )) (add (next-to ))))) (PUSH-TO-LOC ;just one robot (params ( )) (preconds (and (is-type robot) (pushable ) (weight ) (less-than 100) (loc-in-room ) (in-room ) (in-room ) (next-to ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (at )) (add (next-to ))))) (T-PUSH-TO-LOC ;two robots (params ( )) (preconds (and (is-type robot) (is-type robot) (~ (equal-p )) (pushable ) (loc-in-room ) (in-room ) (in-room ) (in-room ) (next-to ) (next-to ) )) (effects ((if (at <11> <12>)(del (at <11> <12>))) (if (at <21> <22>)(del (at <21> <22>))) (if (next-to <13>)(del (next-to <13>))) (if (next-to <23>)(del (next-to <23>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (add (at )) (add (next-to )) (add (next-to ))))) (GO-THRU-DOOR (params ( )) (preconds (and (is-type robot) (is-type room) (is-type door) (connects ) (in-room ) (statis open) (next-to ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (if (in-room )(del (in-room ))) (add (in-room ))))) (PUSH-THRU-DOOR ;just one robot (params ( )) (preconds (and (is-type robot) (pushable ) (weight ) (less-than 100) (is-type door) (is-type room) (connects ) ;;CAMBIADO (in-room ) (in-room ) (statis open) (next-to ) (next-to ) )) (effects ((if (at <1> <2>)(del (at <1> <2>))) (if (next-to <3>)(del (next-to <3>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (if (in-room )(del (in-room ))) (if (in-room )(del (in-room ))) (add (in-room )) (add (in-room )) (add (next-to ))))) (T-PUSH-THRU-DOOR ;two robots (params ( )) (preconds (and (is-type robot) (is-type robot) (~ (equal-p )) (pushable ) (in-room ) (in-room ) (in-room ) (is-type door) (is-type room) (connects ) (statis open) (next-to ) (next-to ) (next-to ) )) (effects ((if (at <11> <12>)(del (at <11> <12>))) (if (at <21> <22>)(del (at <11> <22>))) (if (next-to <13>)(del (next-to <13>))) (if (next-to <23>)(del (next-to <23>))) (if (at <4> <5>)(del (at <4> <5>))) (if (next-to <6>)(del (next-to <6>))) (if (next-to <7> )(del (next-to <7> ))) (if (in-room )(del (in-room ))) (if (in-room )(del (in-room ))) (if (in-room )(del (in-room ))) (add (in-room )) (add (in-room )) (add (in-room )) (add (next-to )) (add (next-to ))))) (PUT-BLOCK-INTO-BOX ;just one robot (params ( )) (preconds (and (is-type robot) (is-type block) (is-type box) (pushable ) ; to avoid moving unmovable blocks (weight ) (less-than 100) (forall () (is-type box) (~ (in ))) (in-room ) (in-room ) (next-to ) (in-room ) (next-to ) (next-to ) ;maybe one of these could be ommited (weight ) (is-sum ) )) (effects ((if (at <4> <5>)(del (at <4> <5>))) (if (at <1> <2>)(add (at <1> <2>))) (add (in )) (del (weight )) (add (weight ))))) (T-PUT-BLOCK-INTO-BOX ;just one robot (params ( )) (preconds (and (is-type robot) (is-type robot) (is-type block) (~ (equal-p )) (is-type box) (pushable ); to avoid moving unmovable blocks (forall () (is-type box) (~ (in ))) (in-room ) (in-room ) (next-to ) (in-room ) (in-room ) (next-to ) (next-to ) (next-to ) (next-to ) (weight ) (weight ) (is-sum ) )) (effects ((if (at <4> <5>)(del (at <4> <5>))) (if (at <1> <2>)(add (at <1> <2>))) (add (in )) (del (weight )) (add (weight ))))) (TAKE-BLOCK-OUT-OF-BOX ;just one robot (params ( )) (preconds (and (is-type robot) (is-type block) (is-type box) (pushable ) ; to avoid moving unmovable blocks (weight ) (less-than 100) (in ) (in-room ) (in-room ) (next-to ) (weight ) (is-sum ) )) (effects ((if (at <4> <5>)(del (at <4> <5>))) (add (next-to )) (add (next-to )) (add (next-to )) (del (in )) (del (weight )) (add (weight ))))) (T-TAKE-BLOCK-OUT-OF-BOX ;two robots (params ( )) (preconds (and (is-type robot) (is-type robot) (is-type block) (~ (equal-p )) (is-type box) (pushable ) ; to avoid moving unmovable blocks (in ) (in-room ) (in-room ) (in-room ) (in-room ) (next-to ) (next-to ) (weight ) (weight ) (is-sum ) )) (effects ((if (at <4> <5>)(del (at <4> <5>))) (add (next-to )) (add (next-to )) (add (next-to )) (add (next-to )) (del (in )) (del (weight )) (add (weight ))))) (OPEN-DOOR (params ( )) (preconds (and (is-type door) (statis closed) (is-type robot) (next-to ) )) (effects ((del (statis closed)) (add (statis open))))) (CLOSE-DOOR (params ( )) (preconds (and (is-type door) (statis open) (is-type robot) (next-to ))) (effects ((del (statis open)) (add (statis closed))))) (UNLOCK-DOOR (params ( )) (preconds (and (is-type robot) (is-type door) (statis locked) (is-type key) ;if the robot could carry other objects (is-key ) (holding ) (next-to ) )) (effects ((del (statis locked)) (add (statis closed))))) (LOCK-DOOR (params ( )) (preconds (and (is-type robot) (is-type door) (is-type key) ;if the robot could carry other objects (is-key ) (holding ) (next-to ) (statis closed) )) (effects ((del (statis closed)) (add (statis locked))))) (PICK-UP-KEY (params ( )) (preconds (and (is-type robot) (is-type key) (next-to ) )) (effects ((add (holding ))))) ))) (setq *INFERENCE-RULES* '( (CONNECTS1 (params ( )) (preconds ; (or (connect ) ; (connect ) ; ) ) (effects ((add (connects )) (add (connects ))))) ))