dodaro / cnl2asp

A tool for converting CNL sentences to ASP rules.
https://dodaro.github.io/cnl2asp/
Apache License 2.0
1 stars 0 forks source link

Possible Error in the Parser? #4

Closed GregGelfond closed 2 weeks ago

GregGelfond commented 1 month ago

cnl2asp fails to compile the following example:

Aircraft goes from 1 to 5.
Pilot is one of Raptor, Eagle, Bullet, Falcon, Cowboy.
Every aircraft must be assigned to exactly 1 pilot.
It is prohibited that there is an aircraft A where the number of pilots assigned to A is greater than 1.

the error appears to be:

Parser error at line 4, col 84. Unexpected char "i":
A where the number of pilots assigned A is greater than 1.
                                        ^
Expected one of:
 * WHERE
 * COMMA
 * OF
 * COMPARISON_OPERATOR
 * PARAMETER_PREPOSITION
 * THAT

I'm not quite sure what is going on here really since the example is almost a verbatim copy/paste from another working example with the exception of the nouns pilots and aircraft.

dodaro commented 1 month ago

Thank you for your feedback! You have to add "that are" after "number of pilots". The following sentence is expected to work:

"It is prohibited that there is an aircraft A where the number of pilots that are assigned to A is greater than 1."

P.S. you might be interested in using our new online tool: link.

GregGelfond commented 2 weeks ago

Thanks - that fixed the issue. Sometimes it's hard to interpret the error messages, and something like this is somehow easy to miss.