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

Parser expects objects block in non-fluents block. #13

Open
lchamp87x opened this issue Mar 10, 2021 · 1 comment
Open

Parser expects objects block in non-fluents block. #13

lchamp87x opened this issue Mar 10, 2021 · 1 comment

Comments

@lchamp87x
Copy link

So I created my own rddl domain, which the parser finds no issues with. However, when I created a rddl instance file with non-fluents block and instance block and ran this through the parser, it kept getting a syntax error right at the start of the inner non-fluents block within the main non-fluents block. Here is the rddl instance file I am referring to,

Screen Shot 2021-03-10 at 9 48 34 AM

and here is me calling the rddl parser and the resulting error,

Screen Shot 2021-03-10 at 9 56 13 AM

So as I said, it wasn't liking the '{' proceeding the non-fluents header and gave me no clue why. Although, I noticed that almost every example of a non-fluents block that I have seen has a objects block preceding the inner non-fluents block. So on a hunch I tried adding this,

Screen Shot 2021-03-10 at 1 11 28 PM

And this seems to pass through the parser fine with no errors giving,

Screen Shot 2021-03-10 at 1 13 35 PM

I'll note, that I did try it with just an empty objects block,

objects {}; or,

objects {
};

and that didn't work.

Thus my conclusion is that for a non-fluents block, your parser specifically looks for a populated objects block inside of the non-fluents block just before the inner non-fluents block. I am assuming this is not by design because not all domains would need an objects block.

@thomaskeller79
Copy link
Collaborator

This is a general issue with the flex/bison specification of rddlsim (in src/rddl/parser/parser.{lex,cup}), which handles all of those optional elements by listing possible legal combinations. The simplest solution for this issue is to update the parser.cup file with an entry where the object section of the instance is omitted, but this would not help the general problem.

I would rather like to find a general solution that explicitly let's us define entries as optional and allows us to get away with a single specification instead of explicitly listing all possible combinations, but I don't know if I find the time to look into this (and I don't know enough about flex bison to judge how much work this is). Is there anyone else with the necessary flex/bison background who has the time to look into this?

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

2 participants