potassco / clingcon

⛓️ Extension of clingo to handle constraints over integers
https://potassco.org/
MIT License
25 stars 4 forks source link

Optimization statement causes hang in v3.3.0 #47

Closed rallentan closed 3 years ago

rallentan commented 3 years ago

The following code hangs and eventually fails with an unknown error:

#include <csp>.

&dom { 0..10 } = a.
&dom { 0..10 } = b.

a / b = x.

&minimize { 0 - x }.

However, if you remove the optimization statement, it completes immediately as SATISFIABLE.

I don't fully understand the language and modeling, but I imagine this isn't supposed to fail, or if it is, should fail immediately with a specific error message.

MaxOstrowski commented 3 years ago

a / b = x. This is not a clingcon statement but a gringo atom. As x never occurs in any other clingcon constraints its domain is the complete range of integers (30bit). The minimize statement forces clingcon-3.3.0 to introduce all order literals (2^31) resulting in a memor out error.

Please update to clingcon 5, as clingcon 3 is no longer supported.