Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constants support #568

Open
fmrico opened this issue Feb 15, 2024 · 3 comments
Open

Constants support #568

fmrico opened this issue Feb 15, 2024 · 3 comments

Comments

@fmrico
Copy link

fmrico commented Feb 15, 2024

Hi,

I have found that UP fails to read a problem from a pddl file in the line that contains a constant:

(:constants Table)

I also don't find a way to define constants directly using the UP API in Python.

Are constants supported in UP? How can I do it?

My use case is the traditional blocks world [domain, problem]

Thanks!!

@mikand
Copy link
Member

mikand commented Feb 15, 2024

@Framba-Luca can you check if this is supported in our parser?

The UP does not distinguish between domain and problem, so a constant is just another object for us. But indeed I am not sure if this is currently supported by our parser.

@Framba-Luca
Copy link
Contributor

Hi @fmrico , so I tested and the problem is not that it's a constant, but that in the grammar that we chose to support constants must be defined before predicates. So, I changed the domain like this:

(:constants Table - object)

(:predicates
  (on ?x ?y)
  (clear ?x)
  (block ?b)
)

and it correctly works.

Let me know if this solves your issue

@mikand
Copy link
Member

mikand commented Feb 15, 2024

Ah OK, so it is a manifestation of #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants