potassco / clingcon

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

minimize ignored without --translate-opt=max #64

Closed mbalduccini closed 3 years ago

mbalduccini commented 3 years ago

Hi, I was testing the new release 5.0.0 and noticed that minimization doesn't occur for some programs unless I use --translate-opt=max. For example, the program:

&dom { -5..0 } = a.
&sum { a } >= -3.
&minimize { a }.
&show { a }.

produces a=0 while the correct result is a=-3. With --translate-opt=max, the correct result is produced. I verified that the same behavior is present in master (clingcon reports version 5.0.1). I am not sure if this is the intended behavior.

MaxOstrowski commented 3 years ago

If the minimize statement is not translated you currently need to set the number of models you want to enumerate to 0(all). So, rule of thumb for now is to call 'clingcon 0' if your program has an optimization statement.

Sorry for the hazzle, the API would need to be extended to properly handle this case.

See #33.

mbalduccini commented 3 years ago

Noted, thanks!!

MaxOstrowski commented 3 years ago

Fixed in wip branch. conda releases pending.