I'm new in PDDL, I tried to replicate a basic example of my error
I did a basic domain to manage the activation/deactivation of a led, I declared a type for that
Domain:
(define (domain led_domain)
(:requirements :strips :typing :negative-preconditions)
(:types
led - object
)
(:predicates
(activated ?led - led)
)
(:action activate_led
:parameters
(?led - led)
:precondition
(not (activated ?led))
:effect
(activated ?led)
)
(:action deactivate_led
:parameters
(?led - led)
:precondition
(activated ?led)
:effect
(not (activated ?led))
)
)
Problem:
(define (problem led_problem)
(:domain led_domain)
(:objects
led1 - led
)
(:init
(not (activated led1))
)
(:goal
(and
(activated led1)
)
)
)
Error:
/app/plan: line 3: 19581 Segmentation fault timeout 10 "$(dirname "$0")"/siw-then-bfsf --domain $1 --problem $2 --output $3
I expect an output like:
(activate_led led1)
But if I change the problem to:
(define (problem led_problem)
(:domain led_domain)
(:objects
led1 - led
)
(:init
(activated led1)
)
(:goal
(and
(not (activated led1))
)
)
)
I get the correct plan:
(deactivate_led led1)
Is there any step or any predicate wrong?
Solution:
I read that we can't set something false, so I can write (deactivated ?led - led) predicate (like in this github comment)
Domain:
(define (domain led_domain)
(:requirements :strips :typing :negative-preconditions)
(:types
led - object
)
(:predicates
(activated ?led - led)
(deactivated ?led - led)
)
(:action activate_led
:parameters
(?led - led)
:precondition
(deactivated ?led)
:effect
(and
(activated ?led)
(not (deactivated ?led))
)
)
(:action deactivate_led
:parameters
(?led - led)
:precondition
(activated ?led)
:effect
(and
(not (activated ?led))
(deactivated ?led)
)
)
)
Problem1:
(define (problem led_problem)
(:domain led_domain)
(:objects
led1 - led
)
(:init
(deactivated led1)
)
(:goal
(and
(activated led1)
)
)
)
Problem2:
(define (problem led_problem)
(:domain led_domain)
(:objects
led1 - led
)
(:init
(activated led1)
)
(:goal
(and
(deactivated led1)
)
)
)
Hope this could help someone!!