pddl4j icon indicating copy to clipboard operation
pddl4j copied to clipboard

Bug in precondition checking

Open mostafamohajeri opened this issue 5 years ago • 3 comments

Hi, Thanks for the great lib.

I am using the library with the default planner.

The two (supposed to be the same) preconditions have different results. first one works ok and the is a plan but second one can not find any plan

(:action WALK
   :parameters    (?r ?prev ?loc)
   :precondition
    (and
           (exists (?b) (and (at ?r ?b))) (and  (at ?r ?prev) (walkingdistance ?prev ?loc))  )

   :effect

                    (and
                      (not (at ?r ?prev))
                       (at ?r ?loc)
                    )
)

(:action WALK
   :parameters    (?r ?prev ?loc)
   :precondition
    (and
            (and  (at ?r ?prev) (walkingdistance ?prev ?loc)) (exists (?b) (and (at ?r ?b))) )

   :effect

                    (and
                      (not (at ?r ?prev))
                       (at ?r ?loc)
                    )
)

I will attach the full domain and problem but i do not think they should matter

mostafamohajeri avatar May 22 '19 08:05 mostafamohajeri

We will investigate the bug as soon as possible based on your domain and problem.

pellierd avatar May 22 '19 09:05 pellierd

Actually I traced the problem, i think the issue is in toDnf function. I'll report debug output as soon as possible.

On Wed, May 22, 2019, 11:10 AM Damien Pellier [email protected] wrote:

We will investigate the bug as soon as possible based on your domain and problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pellierd/pddl4j/issues/62?email_source=notifications&email_token=ALWBX6I5MIHO34G25G4MCSTPWUEZ3A5CNFSM4HOR7VZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV6NNSY#issuecomment-494720715, or mute the thread https://github.com/notifications/unsubscribe-auth/ALWBX6MLRPNDRR4H5W43A5DPWUEZ3ANCNFSM4HOR7VZA .

mostafamohajeri avatar May 22 '19 22:05 mostafamohajeri

domain:


(define (domain traveller)
  (:requirements :strips :adl :typing)
  (:types bike - vehicle
            busstation
            location - place
            traveller
            place
            vehicle - object)

  (:predicates
        (at ?r - traveller ?in - place)
        (has ?r - traveller ?b - vehicle)
		(walkingdistance ?from - place ?loc - place )
		(busroute ?from - busstation ?loc  - busstation))



(:action WALK
   :parameters    (?r - traveller ?prev - place ?loc - place)
   :precondition
    (and
            (and  (at ?r ?prev) (walkingdistance ?prev ?loc)) (exists (?b - place) (and (at ?r ?b))) )

   :effect

                    (and
                      (not (at ?r  ?prev))
                       (at ?r  ?loc)
                    )
)


(:action TAKE-BUS
   :parameters    (?r - traveller  ?prev - busstation ?loc - busstation)
   :precondition
    (and
            (and (at ?r ?prev ) (busroute ?prev ?loc)))

   :effect

                    (and
                      (not (at ?r ?prev))
                       (at ?r ?loc)
                    )
)




)



the problem:

(define (problem travellerproblem)
(:domain traveller)
(:objects
 home work park1 park2 park3 park4 park5 - location
 station1 station2 - busstation
 b1 b2 - vehicle
 robot - traveller )

(:init
    (at robot home)
    (walkingdistance home park1)
    (walkingdistance park1 park2)
    (walkingdistance park2 work)
    (walkingdistance home station1)
    (walkingdistance station2 work)
    (busroute station1 station2)
    (has robot b1)
)

(:goal (and (at robot work) )  )

)

mostafamohajeri avatar May 31 '19 08:05 mostafamohajeri

There was a bug in the method that converts an expression into its normal conjunctive form. The bug was normally fixed in the devel branch.

pellierd avatar Dec 06 '22 19:12 pellierd