Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No plan found with HDDL although it exists #113

Open
AlexDmr opened this issue Dec 8, 2023 · 0 comments
Open

No plan found with HDDL although it exists #113

AlexDmr opened this issue Dec 8, 2023 · 0 comments

Comments

@AlexDmr
Copy link

AlexDmr commented Dec 8, 2023

The fr.uga.pddl4j.planners.htn.stn.TFD does not always find plan when there is an obvious one
Here are data for a minimal test reproduction (sorry, there is only a linter for PDDL, not HDDL).
I used the jar from the website, I also cloned PDDL4J and compiled the code on the devel branch.

Plan is searched with :

java -cp ./pddl4j-4.0.0.jar fr.uga.pddl4j.planners.htn.stn.TFD ./domain.hddl ./problem.pddl

and

java -cp ./pddl4j-4.0.0.jar fr.uga.pddl4j.planners.htn.stn.PFD ./domain.hddl ./problem.pddl

A problem where the planner find a plan :

 (define (problem todolist)
    (:domain todolist)
    (:objects
        a b c d - object
        L - list
    )

    (:htn
        :parameters ()
        :ordered-subtasks (doManageListOneOp L)
    )
    (:init
        ;todo: put the initial state's facts and numeric values here
        (listSeq L listStart listEnd)
        (listElement L listStart)
        (listElement L listEnd)
    )

)

A problem where the planner fail to find a plan, although it should :
TFD says that the problem is not totally ordered.
PFD find no plan.

 (define (problem todolist)
    (:domain todolist)
    (:objects
        a b c d - object
        L - list
    )
    (:htn
        :parameters ()
        :ordered-subtasks (doManageList L)
    )
    (:init
        ;todo: put the initial state's facts and numeric values here
        (listSeq L listStart listEnd)
        (listElement L listStart)
        (listElement L listEnd)
    )
)

The HDDL domain :

(define (domain todolist)
    (:requirements :strips :equality :typing :conditional-effects :negative-preconditions :universal-preconditions :existential-preconditions :hierarchy)

    (:types
        list - object
    )

    (:constants
        listStart listEnd - object
    )

    (:predicates
        (listElement ?L - list ?e - object)
        (listSeq ?listId - list ?a - object ?b - object)
    )


    (:task doManageList
        :parameters (?L - list)
    )

    (:task doManageListOneOp
        :parameters (?L - list)
    )

    (:method doManageListMtdRec
        :parameters (?L - list)
        :task (doManageList ?L)
        :ordered-subtasks (and
            (task0 (doManageListOneOp ?L))
            (task1 (doManageListOneOp ?L))
        )
    )


    (:method mtdManageListAppend
        :parameters (?L - list ?e - object ?last - object)
        :task (doManageListOneOp ?L)
        :ordered-subtasks (and
            (task0 (append ?L ?e ?last))
        )
    )

    (:action append
        :parameters (?L - list ?e - object ?last - object)
        :precondition (and
            (not (listElement ?L ?e))
            (listSeq ?L ?last listEnd)
        )
        :effect (and
            (listElement ?L ?e)
            ; insert at the end
            (not (listSeq ?L ?last listEnd))
            (listSeq ?L ?last ?e)
            (listSeq ?L ?e listEnd)
        )
    )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant