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

2.8.0: Issues with compiling counting constraints #749

Closed
informarte opened this issue Nov 18, 2023 · 0 comments
Closed

2.8.0: Issues with compiling counting constraints #749

informarte opened this issue Nov 18, 2023 · 0 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@informarte
Copy link

Consider this problem:

include "count_eq.mzn";

int: N = 3;

array [1..N] of var bool: x;
var 0..N: c;

constraint c > 0;
constraint c = count(x, false);

solve satisfy;

MiniZinc 2.7.6 solves it but MiniZinc 2.8.0 reports this compilation error:

Error: evaluation error: arithmetic operation on infinite value
/home/informarte/Workspaces/yuck/count_fn_bool_test.mzn:9.12-30
  in binary '=' operator expression
  in call 'count'
/home/informarte/Software/lib/MiniZincIDE-2.8.0-bundle-linux-x86_64/share/minizinc/std/count_fn.mzn:6.68-81
  in call 'count_eq'
/home/informarte/Software/lib/MiniZincIDE-2.8.0-bundle-linux-x86_64/share/minizinc/std/count_eq.mzn:33.3-99
  in let expression
  in call 'count_eq'
/home/informarte/Software/lib/MiniZincIDE-2.8.0-bundle-linux-x86_64/share/minizinc/std/count_eq.mzn:15.74-18.47
  in let expression
/home/informarte/Software/lib/MiniZincIDE-2.8.0-bundle-linux-x86_64/share/minizinc/std/count_eq.mzn:17.5-55
  in variable declaration for 'def'
  in if-then-else expression

Next consider this variant of the first problem:

include "count_eq.mzn";

int: N = 3;

array [1..N] of var bool: x;
var bool: y;
var 0..N: c;

constraint c > 0;
constraint c = count(x, y);

solve satisfy;

MiniZinc 2.7.6 solves it but MiniZinc 2.8.0 crashes:

MiniZinc error: Memory violation detected (segmentation fault).
This is a bug. Please file a bug report using the MiniZinc bug tracker.
Aborted (core dumped)
@cyderize cyderize added the bug label Nov 19, 2023
@Dekker1 Dekker1 added the resolved Issue is resolved and the feature or fix will be part of next release label Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release
Projects
None yet
Development

No branches or pull requests

3 participants