(define (domain tea-2)
(:requirements :typing)
(:types room - loc ) /* room is a subtype of loc */
(:static (connected ?l1 ?l2 - loc)
(cupstack ?r - room)
(teamachine ?r - room)
(allowed ?p - robot ?l -loc))
(:predicates (at ?r - robot ?l - loc)
(free ?r -robot)
(emptycuploaded ?r - robot)
(fullcuploaded ?r - robot)
(ordered ?r - room))
(:constants (hallway - loc))
(:theory (forall (?r -room) (connected ?r hallway))
(forall (?p -robot) (allowed ?p hallway))
/* a robot can never be in a room where he's not
allowed - in this general form, it generates
a very slow encoding
(forall (?p -robot ?r -room)
(implies (at ?p ?r) (allowed ?p ?r))) */
)
(:action getcup
:parameters (?p - robot ?r - room)
:precondition (at ?p ?r) (cupstack ?r) (free ?p)
:effect (emptycuploaded ?p) (not (free ?p))
:asap (forsome (?x - room) (ordered ?x))
)
(:action fillcup
:parameters (?p - robot ?r - room )
:precondition (at ?p ?r) (teamachine ?r) (emptycuploaded ?p)
:effect (fullcuploaded ?p) (not (emptycuploaded ?p))
:s-asap
)
(:action deliver
:parameters (?p - robot ?r - room)
:precondition (at ?p ?r) (ordered ?r) (fullcuploaded ?p)
:effect (free ?p)
(not (ordered ?r)) (not (fullcuploaded ?p))
:s-asap
)
(:action exchangecup
:parameters (?from ?to - robot ?where -loc)
:precondition (at ?from ?where)(at ?to ?where)
(or (emptycuploaded ?from)(fullcuploaded ?from))
(free ?to)
:effect (free ?from) (not (emptycuploaded ?from))
(not (fullcuploaded ?from)) (not(free ?to))
(when (emptycuploaded ?from)(emptycuploaded ?to))
(when (fullcuploaded ?from)(fullcuploaded ?to)) )
(:action go
:parameters (?r -robot ?from ?to - loc)
:precondition (or (connected ?from ?to) (connected ?to ?from) )
(at ?r ?from)
:effect (at ?r ?to) (not (at ?r ?from))
:only-if (or (= ?to hallway)
(and(ordered ?to)(fullcuploaded ?r))
(and(emptycuploaded ?r)(teamachine ?to))
(and(free ?r)(cupstack ?to)))
:next (or (= ?to hallway)
(deliver ?r ?to)
(fillcup ?r ?to)
(getcup ?r ?to))
)
; ----------------------------------------------------------
/* representation of exchangecup with no conditional effects:
(:action exchange_emptycup
:parameters (?from ?to - robot ?where -loc)
:precondition (at ?from ?where)(at ?to ?where)
(emptycuploaded ?from)
(free ?to)
:effect (free ?from) (not (emptycuploaded ?from))
(not(free ?to))
(emptycuploaded ?to)
:next (not(exchange_emptycup ?to ?from ?where)) )
(:action exchange_fullcup
:parameters (?from ?to - robot ?where -loc)
:precondition (at ?from ?where)(at ?to ?where)
(fullcuploaded ?from)
(free ?to)
:effect (free ?from) (not (fullcuploaded ?from))
(not(free ?to))
(fullcuploaded ?to)
:next (not(exchange_fullcup ?to ?from ?where)))
*/
)