fmrico / fmrico/popf

negative-preconditions not working

Open
#7 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
25
Forks
12
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the behavior with test_domain.pddl and test_problem.pddl using the documented ros2 run popf command, comparing the working and negative-precondition cases. Then inspect POPF's handling of the :negative-preconditions requirement and the pruning message; done means supported conditions plan correctly or unsupported input produces an explicit error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
ai
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.