I am new to PDDL, i have been trying a blocksworld problem but i got the error:
Failed to parse the problem -- Not args must be a list with only one element, got [Primitive sobre (default_object ?obj, default_object ?obj2), Primitive libre (default_object ?obj3), Primitive en (default_object ?obj, default_object ?from)] /tmp/solver_planning_domains_tmp_4BmsZdP37zJXS/domain.pddl: syntax error in line 16, '(': domain definition expected
my files are these:
(define (domain blocly)
(:predicates (espacio ?e)
(ficha ?t)
(sobre ?t ?t)
(en ?t ?e)
(vacio ?e)
(libre ?t))
(:action movefichaficha
:parameters (?ficha ?ficha2 ?ficha3 ?from ?to)
:precondition (and (ficha ?ficha) (ficha ?ficha2) (ficha ?ficha3) (espacio ?from) (espacio ?to)
(sobre ?ficha ?ficha2) (libre ?ficha) (libre ?ficha3) (en ?ficha ?from) (en ?ficha2 ?from)
(en ?ficha3 ?to))
:effect (and (sobre ?ficha ?ficha3) (en ?ficha ?to) (libre ?ficha2)
(not (sobre ?ficha ?ficha2) (libre ?ficha3) (en ?ficha ?from))))
(:action movefichaesp
:parameters (?ficha ?ficha2 ?from ?to)
:precondition (and (ficha ?ficha) (ficha ?ficha2) (espacio ?from) (espacio ?to)
(sobre ?ficha ?ficha2) (vacio ?to) (en ?ficha ?from) (en ?ficha2 ?from))
:effect (and (libre ?ficha2) (en ?ficha ?to) (arriba ?ficha ?to)
(not (vacio ?to) (en ?ficha ?from) (sobre ?ficha ?ficha2))))
(:action moveoespficha
:parameters (?ficha ?ficha2 ?from ?to)
:precondition (and (ficha ?ficha) (ficha ?ficha2) (espacio ?from) (espacio ?to)
(libre ?ficha) (libre ?ficha2) (en ?ficha ?from) (en ?ficha ?to) ())
:effect (and (vacio ?from) (en ?ficha ?to) (sobre ?ficha ?ficha2)
(not (libre ?ficha2) (en ?ficha ?from) (en ?ficha ?from)))))
and these:
(define (problem blockly-world)
(:domain blocly)
(:objects t1 t2 t3 e1 e2 e3)
(:init (ficha t1)
(ficha t2)
(ficha t3)
(espacio e1)
(espacio e2)
(espacio e3)
(sobre t3 t2)
(sobre t2 t1)
(en t1 e1)
(en t2 e1)
(en t3 e1)
(libre t3)
(vacio e2)
(vacio e3))
(:goal (and (sobre t1 t2)
(sobre t2 t3)))
There are a number of problems in the source code.
The problem file lacks a final
)
The unary
not
logical operator is used improperly, e.g.should be rewritten as
The domain file uses an undeclared predicate,
arriba
. Since it has the same definition ofen
--and it is not mentioned in the(:init ...)
block--, I am unsure whether this is a typo due to renamingarriba
intoen
and forgetting to change one last occurrence of it, or not. Just in case it is not an error, you can fix it by addingto the list of predicates. You should check on you own whether you need to add something to the
(:init ...)
block in the problem file or not.Below, you can find a properly indented version of the source code with adequate fixes to the first two identified issues, and an attempt to solve the third issue:
blocky-prob.pddl:
block-domain.pddl:
The code is properly parsed by the PDDL solver fast-downward.py on my machine, which also finds a solution. Since I don't know what you are trying to model, I am unable to verify whether it matches what you want to model or not.
Notes: even if you are just learning for personal reasons, consider getting in the habit of using english names for your predicates, objects and variables. Moreover, consider that indenting the source code and properly describing the situation you are dealing with has the double benefit of attracting both upvotes and good answers to your questions.