aiplan4eu / unified-planning

The AIPlan4EU Unified Planning Library
Apache License 2.0
185 stars 39 forks source link

Aries seems to ignore timed effects #545

Closed nicola-gigante closed 9 months ago

nicola-gigante commented 9 months ago

Describe the bug After #536 has been closed I continued trying using timed effects with the aries engine. However, the engine seems to disregard them.

To Reproduce Save the following as issue.hddl:

(define (domain test)

(:requirements :hierarchy)

(:predicates 
    (deadline)
    (goal)
)

(:task main :parameters ())

(:method main-m 
    :parameters ()
    :task (main)
    :subtasks (and
        (main-a)
    )
)

(:durative-action main-a
    :parameters ()
    :duration (= ?duration 40)
    :condition (at end (not deadline))
    :effect (at end (goal))
)

)

Then, save the following as issue-instance.hddl:

(define (problem test) (:domain test)

(:htn
    :tasks (and
        (main)
    )
)

(:init (and 
    (not deadline) (not goal)
    (at 15 (deadline))
))
)

Then run the following:

from unified_planning.shortcuts import *
import unified_planning.io as io

reader = io.PDDLReader()

p = reader.parse_problem('issue.hddl', 'issue-instance.hddl')

with OneshotPlanner(name = 'aries') as planner:
    print(planner.solve(p))

I get the following output:

status: SOLVED_SATISFICING
engine: aries
plan: Hierarchical TimeTriggeredPlan:
    0.0: main-a [40.0]

Expected behavior The problem should be unsatisfiable, because the action requires (not deadline) at the end and its duration is 40 but the timed effect sets deadline at time 15.

If one makes print(p) the output correctly shows the timed effect, so the parser is not at fault here.

arbimo commented 9 months ago

Hi @nicola-gigante support for timed initial literals was added to aries when it appeared in the protobuf export.

If you update aries to version 0.3.2 it should work as expected. (Note that there is still a minor discrepancy of semantics with PDDL2.1 discussed in PR #393 )

nicola-gigante commented 9 months ago

Yes, it works now, thank you!