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

Boolean operators on integers crash some solvers #198

Closed
Wout4 opened this issue Dec 20, 2022 · 2 comments
Closed

Boolean operators on integers crash some solvers #198

Wout4 opened this issue Dec 20, 2022 · 2 comments
Assignees

Comments

@Wout4
Copy link
Collaborator

Wout4 commented Dec 20, 2022

Giving an integer as an argument for and, or and implies operators crash most solvers (gurobi, z3, minizinc, pysat)

example
Model( (bv[0] | 0)).solve("gurobi")

@IgnaceBleukx
Copy link
Collaborator

I don't think we want to support this, right? We should just throw a CPMpy exception when encountering this.
Actually, this is another example where we want to introduce some typed-ness on the modelling side of the library.
We could then simply raise an exception when a user tries to construct this type of expression by checking in the constructor of "OR" wether both sides .is_bool()

@Wout4
Copy link
Collaborator Author

Wout4 commented May 19, 2023

pr #297 fixes this by throwing a cpmpy exception

@Wout4 Wout4 closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants