Skip to content

UnexpectedExpressionException when an HDDL action has only a single numeric‐fluent effect #127

@joselopes02

Description

@joselopes02

Description

When grounding an HDDL domain that uses :numeric-fluents, any action whose :effect block contains only a single numeric update (e.g. (increase (capacity-of ?v) 1)) fails during finalization with an UnexpectedExpressionException. As soon as you add any other effect the grounding completes successfully.

Reproduction

Domain (domain.hddl):
... rest of the domain ... ;; drop — frees capacity slot (:action drop :parameters (?v - vehicle ?l - location ?p - package) :precondition (and (at ?v ?l) (in ?p ?v) ) :effect (and (increase (capacity-of ?v) 1) ) )

Observe:

Exception in thread "main" fr.uga.pddl4j.parser.UnexpectedExpressionException: (capacity-of truck1) at fr.uga.pddl4j.problem.FinalizedProblem.finalizeAction(FinalizedProblem.java:982) at fr.uga.pddl4j.problem.FinalizedProblem.finalizeActions(FinalizedProblem.java:605) at fr.uga.pddl4j.problem.DefaultProblem.finalization(DefaultProblem.java:330) at fr.uga.pddl4j.problem.AbstractProblem.instantiate(AbstractProblem.java:448) at fr.uga.pddl4j.examples.GroundProblemExample.main(GroundProblemExample.java:38)

Workaround
Adding any additional effect prevents the crash:
:effect (and (not (in ?p ?v)) (at ?p ?l) (increase (capacity-of ?v) 1) )

Expected behavior
An action with a single (increase|decrease|assign) effect should ground and finalize without error.

In the atteched file is the domain and a problem, The removel of the line 188 of the problem whould make the grounder to crash.

domain_problem.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions