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

Empty sum problem #4

Open
msakai opened this issue May 8, 2021 · 0 comments
Open

Empty sum problem #4

msakai opened this issue May 8, 2021 · 0 comments

Comments

@msakai
Copy link
Owner

msakai commented May 8, 2021

It is possible to generate OPB files that contain empty <sum>.

> putStr $ toOPBString $ Formula{ pbObjectiveFunction = Just [], pbConstraints = [], pbNumVars = 0, pbNumConstraints = 0 }
* #variable= 0 #constraint= 0
min: ;
> putStr $ toOPBString $ Formula{ pbObjectiveFunction = Nothing, pbConstraints = [([], Ge, 0)], pbNumVars = 0, pbNumConstraints = 1 }
* #variable= 0 #constraint= 1
>= 0;

But empty <sum> is not allowed in the grammar:

<sum>::= <weightedterm> | <weightedterm> <sum>

and our parser based on this grammar rejects it.

This causes parsing errors.
e.g. msakai/toysolver#60 (comment)

This was referenced May 8, 2021
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

1 participant