;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- File: planning/domains/spare-tire.lisp

;;;; The Spare Tire Problem

(defun make-spare-tire-problem ()
  "Change a flat tire with the spare one from the trunk [Fig. 11.2].
  One solution is ((Remove Flat Axle) (Remove Spare Trunk) (PutOn Spare Axle))."
  (make-planning-problem
   :initial '((Tire Flat) (Tire Spare) (At Flat Axle) (At Spare Trunk))
   :goal '((At Spare Axle))
   :schemas
   (list (make-action-schema
	  :name '(Remove $obj $loc)
	  :precond '((At $obj $loc))
	  :effect '((not (At $obj $loc)) (At $obj Ground)))
	 (make-action-schema
	  :name '(PutOn $t Axle)
	  :precond '((Tire $t) (At $t Ground)
		     (not (At Flat Axle)) (not (At Spare Axle)))
	  :effect '((not (At $t Ground)) (At $t Axle)))
	 (make-action-schema
	  :name '(LeaveOvernight)
	  :precond '()
	  :effect '((not (At Spare Ground)) (not (At Spare Axle))
		    (not (At Spare Trunk)) (not (At Flat Ground))
		    (not (At Flat Axle)) (not (At Flat Trunk)))))))
