(define (domain driverlog)
  (:requirements :strips)
  (:types location locatable - object
  	  truck driver package - locatable)

  (:predicates 	(at ?lt - locatable ?loc - location)
		(isin ?p - package ?t - truck)
		(driving ?d - driver ?v - truck)
		(link ?x - location ?y - location) (path ?x - location ?y - location)
		(empty ?v - truck))


(:action loadtruck
  :parameters (?o1 - package ?o2 - truck ?o3 - location)
  :precondition (and (at ?o2 ?o3) (at ?o1 ?o3))
  :effect (and (not (at ?o1 ?o3)) (isin ?o1 ?o2)))

(:action unloadtruck
  :parameters (?o1 - package ?o2 - truck ?o3 - location)
  :precondition (and (at ?o2 ?o3) (isin ?o1 ?o2))
  :effect (and (not (isin ?o1 ?o2)) (at ?o1 ?o3)))


(:action boardtruck
  :parameters (?o1 - driver ?o2 - truck ?o3 - location)
  :precondition (and (at ?o2 ?o3) (at ?o1 ?o3) (empty ?o2))
  :effect (and (not (at ?o1 ?o3)) (driving ?o1 ?o2) (not (empty ?o2))))


(:action disembarktruck
  :parameters (?o1 - driver ?o2 - truck ?o3 - location)
  :precondition (and (at ?o2 ?o3) (driving ?o1 ?o2))
  :effect (and (not (driving ?o1 ?o2)) (at ?o1 ?o3) (empty ?o2)))


(:action drivetruck
  :parameters (?o1 - truck ?o2 - location ?o3 - location ?o4 - driver)
  :precondition (and (at ?o1 ?o2) (driving ?o4 ?o1) (link ?o2 ?o3))
  :effect (and (not (at ?o1 ?o2)) (at ?o1 ?o3)))

(:action walk
  :parameters (?o1 - location ?o2 - location ?o3 - driver)
  :precondition (and (at ?o3 ?o1) (path ?o1 ?o2))
  :effect (and (not (at ?o3 ?o1)) (at ?o3 ?o2)))

)
