Reputation: 11
I am trying to solve a simple pddl problem using Fast Downward Planner. Whenever I am using numeric expressions such as >
, <
, >=
, decrease
and the like, the following error occurs:
Undeclared predicate: <
problem file:
(define (problem prob-gift)
(:domain gift)
(:objects
chocolate hairband hairclip gift
)
(:init
(=(amount_c chocolate)5)
(=(amount_hb hairband)5)
(=(amount_hr hairclip)5)
(=(made gift)0)
)
(:goal
(and
(=(made gift)5)
)
)
)
domain file:
(define (domain gift)
(:types chocolate hairband hairclip gift )
(:predicates
)
(:functions
(made ?x )
(amount_hb ?y )
(amount_hr ?z )
(amount_c ?a )
)
(:action make
:parameters (?x ?y ?z ?a)
:precondition (and
(<(made ?x)5)
(>=(amount_hb ?y)1)
(>=(amount_hr ?z)1)
(>=(amount_c ?a)1)
)
:effect (and
(increase(made ?x)1)
(decrease(amount_hb ?y)1)
(decrease(amount_hr ?z)1)
(decrease(amount_c ?a)1)
))
)
Output:
Parsing...
Undeclared predicate: <
translate exit code: 30
Driver aborting after translate
Upvotes: 1
Views: 2997
Reputation: 21
Unfortunately, the version of popf that I containerized at https://gitlab.com/graphs4IB/ai-planning is not so ADL-savvy and chokes with the typical
Constructing lookup tables:
Post filtering unreachable actions:
A problem has been encountered, and the planner has to terminate.
-----------------------------------------------------------------
Unfortunately, at present, the planner does not fully support ADL
unless in the rules for derived predicates. Only two aspects of
ADL can be used in action definitions:
- forall conditions, containing a simple conjunct of propositional and
numeric facts;
- Conditional (when... ) effects, and then only with numeric conditions
and numeric consequences on values which do not appear in the
preconditions of actions.
To use this planner with your problem, you will have to reformulate it to
avoid ADL. Alternatively, if you have a particularly compelling case
for them, please contact the authors to discuss it with them, who may be able to
extend the planner to meet your needs.
I am getting this version of popf from https://github.com/LCAS/popf.git, as opposed to the one posted on Sourceforge that has significant code differences.
You can test this quickly on Jan's session by setting this Custom Planner URL: https://young-spire-39208.herokuapp.com
Alternatively, you can also run the Docker image locally, assuming that your domain.pddl
and problem.pddl
are in the current directory:
docker run --rm -v $PWD:/tmp registry.gitlab.com/graphs4ib/ai-planning:latest popf /tmp/domain.pddl /tmp/problem.pddl
What this does is compile popf in a Debian Stretch Docker container. If you have a Debian 9 (Stretch) or 10 (Buster) environment handy, you can compile popf manually:
sudo apt-get -qy install git g++ cmake coinor-libcbc-dev coinor-libcgl-dev coinor-libclp-dev coinor-libcoinutils-dev bison flex \
&& git clone https://github.com/LCAS/popf.git \
&& cd popf \
&& mkdir build \
&& cd build \
&& cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE \
&& make -j \
&& make install
Upvotes: 2
Reputation: 1528
Jonaki, I believe there is an issue with the usage of types in your PDDL model. Also, generally, when the planner of your choice is not accepting your model (or is unable to solve your problem), you should cut it back and re-build it from the simplest version, while testing it continuously against the planner. That way, you would see exactly what is offending it. Sometimes the message printed is not representative.
You are using numeric fluents and therefore you should include (:requirements :fluents)
into your domain
. A planner that does not support :fluents
would choke on the <
, =
or decrease
operations.
By the way: you do not need to use types in this model. You declared your functions as grounded to the various gift objects. Therefore you could remove the types and see if the model works. A version of that model with types removed is available here: http://editor.planning.domains/#read_session=jugsVFKksh You can test it by clicking on the Solve > Plan buttons. The planner fails with a segmentation fault. It does not provide any specific error. However, I tried to solve it with the POPF planner and it works. As you can see in this screenshot.
I do not have Fast-downward handy, but I thought it is the engine behind the http://solver.planning.domains/solve service, although your error messages do not correspond to those that I can see. Are you using a recent version of Fast-downward?
Also, if you could describe what are you trying to model, perhaps we could help you finding a mode suitable approach to model it in PDDL.
Upvotes: 1