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

Bound evaluation error with -O2 optimisation but not -O1 #802

Closed
Mommessc opened this issue Apr 4, 2024 · 0 comments
Closed

Bound evaluation error with -O2 optimisation but not -O1 #802

Mommessc opened this issue Apr 4, 2024 · 0 comments
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@Mommessc
Copy link

Mommessc commented Apr 4, 2024

I've encountered a strange behaviour of Minizinc when changing optimisation levels.
The MWE code below works fine with -O1 optimisation level, but gives an evaluation error: cannot determine bounds with higher optimisation levels.
I am using Minizinc 2.8.3, and I tried with Chuffed and Gecode so the issue seems independent of the solver used.

The model:

array[int] of record(0..100: a, 0..100: b): array1 = [(a: 16, b: 2), (a:8, b: 1)];

int: n = 1;

var 0..200: foo;
var 1..2: bar;

array[int] of var 0..200: sol = [ foo - (10 div array1[bar].b) | t in 1..n];

solve satisfy;

and here is the full error output (personal paths to files were truncated):

test_error_bound:9.1-29
  in variable declaration for 'sol'
  in array comprehension expression
    with t = 1
  in binary '-' operator expression
  in array literal
  in binary 'div' operator expression
stdlib_math:176-3.178-53
  in if-then-else expression
  in call 'div_t'
stdlib_internal:1985-3.1988-54
  in let expression
stdlib_internal:1986.5-53
  in variable declaration for 'z'
  in call 'compute_div_bounds'
MiniZinc: evaluation error: cannot determine bounds

Also, I noticed that if I remove the a part of the array1 record then everything works fine.

@cyderize cyderize added the bug label Apr 18, 2024
@cyderize cyderize added the resolved Issue is resolved and the feature or fix will be part of next release label Apr 18, 2024
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

2 participants