AI-Planning / AI-Planning/pddl

Support subtraction in preconditions in domains.

Open
#100 11 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
177
Forks
43
Avg merge
49m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**

The DomainParser cannot seem to handle `(- (function_name object_name) 1)` as part of a precondition.

Here is an example domain showing this issue. (In this domain, the arithmetic in the precondition isn't needed since we compare to a constant `1`, but in my actual domain of interest we compare to another numeric function).

```pddl
(define (domain cant-subtract-in-precondition)
(:requirements :equality :typing :fluents :negative-preconditions :universal-preconditions :existential-preconditions)

(:types
agent - object
)

(:functions
(x ?l - agent)
)

(:action move-south
:parameters (?ag - agent)
:precondition (= (- (x ?ag) 1) 1)

:effect (and (decrease (x ?ag) 1))
)

)
```

**Describe the solution you'd like**
Parse the subtraction correctly.

**Describe alternatives you've considered**
As a workaround, I can do `(+ (function_name object_name) (- 1))`

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.