fmrico / popf

The POPF planner from KCL planning group with some modifications to make it work with "modern" compilers...
GNU General Public License v2.0
17 stars 9 forks source link

negative-preconditions not working #7

Open sarcasticnature opened 2 years ago

sarcasticnature commented 2 years ago

I have been trying to get negative-preconditions to work with my domain file(s), but popf never seems to find a solution when there is a not in the condition of an action. Here is an example domain file (test_domain.pddl):

(define                                                                         
    (domain test_domain)                                                        
    (:requirements :strips :typing :durative-actions :negative-preconditions)   

    (:types                                                                     
        robot - object                                                          
    )                                                                           

    (:predicates                                                                
        (charged ?r - robot)                                                    
    )                                                                           

    (:durative-action charge                                                    
        :parameters (?r - robot)                                                
        :duration (= ?duration 10)                                              
        :condition (and                                                         
;            (at start (not (charged ?r)))                                      
        )                                                                       
        :effect (and                                                            
            (at end (charged ?r))                                               
        )                                                                       
    )                                                                           
)

and corresponding problem file (test_problem.pddl):

(define                                                                         
    (problem test_problem)                                                      
    (:domain test_domain)                                                       

    (:objects                                                                   
        wall-e - robot                                                          
    )                                                                           

    (:init                                                                      
    )                                                                           

    (:goal (and                                                                 
        (charged wall-e)                                                        
    ))                                                                          
)

If I run ros2 run popf popf test_domain.pddl test_problem.pddl, popf will output

Constructing lookup tables:
Post filtering unreachable actions: 
All the ground actions in this problem are compression-safe
;;;; Solution Found
; Time 0.00
0.000: (charge wall-e)  [10.000]

If I uncomment line 17 of the domain file, however, popf outputs:

Constructing lookup tables:
Post filtering unreachable actions: 
Pruning (charge wall-e) - never appeared in initial RPG
;; Problem unsolvable!
; Time 0.00

Why is this happening? Are negative-preconditions not supported? I have looked through the test code for the various plansys2 packages and found domain files which list negative-preconditions as a requirement so I am hoping they are supported, but none of them actually use negative-preconditions in their actions so I'm not sure.

If they are not supported it would be nice to throw an error instead of failing without one

xydesa commented 1 year ago

on the KCL website (who are the original developers of popf) they state that negative preconditions are not supported: https://nms.kcl.ac.uk/planning/software/popf.html#:~:text=it%20cannot%20handle%20negative%20preconditions