pddl

How to specify empty preconditions in PDDL?


In my PDDL domain file, there are some actions which do not require preconditions, for example

(:action doSomthing
    :parameters (?t - t1)
    :precondition
    :effect (donesomething ?t)
)

When I run this in both PDDL Editor and VSCode (with PDDL Extension) I get an error.

I have tried the alternative styles, e.g.,

(:action doSomthing
    :parameters (?t - t1)
    :precondition()
    :effect (donesomething ?t)
)

or

(:action doSomthing
    :parameters (?t - t1)
    :precondition True
    :effect (donesomething ?t)
)

But the problem continues. For example, in VScode the following error is shown:

domain: syntax error in line 18, ')': domain definition expected


Solution

  • You can try :precondition (and)