Skip to content

Support subtraction in preconditions in domains. #100

@MichaelJFishman

Description

@MichaelJFishman

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).

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions