simon-stahlberg / mimir

GNU General Public License v3.0
13 stars 7 forks source link

Negated literals in init of problem #16

Open maichmueller opened 1 month ago

maichmueller commented 1 month ago

A parsed problem can be queried for static/fluent/derived initial literals, e.g. problem.get_static_initial_literals(). This suggests that I should be able to use negated literals in the init statement of a problem, such as:

(define (problem blocks-2-0)
    (:domain blocks)

    (:objects a b )

    (:init (clear a)
           (clear b)
           (ontable a)
           (ontable b)
           (not (on a b))  <-----
           (handempty))

    (:goal (AND (on a b) (not (on b a))))
    )

but this leads to an error:

E       RuntimeError: 
E       In file test/pddl_instances/blocks/small_with_negation.pddl, line 11:
E       Error! Expecting: ')' here:
E                  (not (on a b))
E       ________________^_

Is this not yet supported or the function name get_static_initial_literals simply a misnomer (literal --> atom)?

simon-stahlberg commented 1 month ago

Negative literals in the initial state only make sense if you use the open world assumption, otherwise all omitted ground atoms are false by default. Currently we have no plans to support the open world assumption, although the interface allows it.

maichmueller commented 1 month ago

If you don't plan to support the open world assumption, wouldn't it make more sense to refer to the init conditions as atoms and rename accordingly + return respective Atom types?

simon-stahlberg commented 1 month ago

You are correct that returning atoms instead of literals makes more sense with this restriction in mind. We'll probably make this change at some point.