PDDL predicate variable with multiple types

1.1k Views Asked by At

I am trying to write a PDDL domain. I have 4 types. My issues is that when specifiying one of the predicates:

At(?x - type ?l - location)

I want x to be able to take on three of the types, but it only allows me to do one. What should I do?

2

There are 2 best solutions below

1
On

Okay so essentially what I did was I created a type called entity and then specififed that my robot, agent and object types are entities:

        (:types
    entity
    agent - entity
    object - entity
    robot - entity
    location
    )

(:predicates
At(?x - entity, ?l - location)
)
1
On

The syntax of PDDL expects your predicate declaration to look as follows:

(at ?x - entity ?l - location)

Check closely the use of parentheses.

Otherwise, you are doing it right. By expecting an entity that is a supertype of agent, object and robot, you will accept any of these subtypes.

However note that in many planners, the type object is already implicitly defined as the root type. I recommend you rename it into physical_object.