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.7.4] Reified element constraint #695

Closed
IgnaceBleukx opened this issue May 24, 2023 · 5 comments
Closed

[2.7.4] Reified element constraint #695

IgnaceBleukx opened this issue May 24, 2023 · 5 comments
Assignees
Labels
bug resolved Issue is resolved and the feature or fix will be part of next release

Comments

@IgnaceBleukx
Copy link

Since the update to v2.7.4 I get an invalid solution to the following model:

% Generated by CPMpy
include "globals.mzn";

var -3..5: x;
var -3..5: y;
var -3..5: z;
var 0..10: idx;
var -3..5: val;
var bool: p;
constraint ((
    let { array[int] of var int: arr=array1d(0..2,[x,y,z]) } in
      arr[idx]) == (val)) -> (p);

Which is a model generated by our CPMpy library. We use the alternative array to circumvent the differnece between 1-indexed Minizinc arrays vs 0-indexed Python arrays.

The solution retured on version 2.7.4 by Gecode is:

x = -3;
y = -3;
z = -3;
idx = 0;
val = -3;
p = false;

While v2.7.3 returns

x = -2;
y = -3;
z = -3;
idx = 0;
val = -3;
p = false;
@Dekker1
Copy link
Member

Dekker1 commented May 24, 2023

It looks like the result for MiniZinc 2.7.3 would also have been incorrect since the value -2 should not have been allowed according to the domain of x.

@Dekker1 Dekker1 self-assigned this May 24, 2023
@cyderize
Copy link
Member

It looks like the result for MiniZinc 2.7.3 would also have been incorrect since the value -2 should not have been allowed according to the domain of x.

-2 is in the range -3..5, so I think the old solution was valid - just the new one is wrong since p should be true

@Dekker1
Copy link
Member

Dekker1 commented May 24, 2023

Ah, of course. My brain must still be half asleep.

I was indeed investigating the issue with p for the current solution

@Dekker1 Dekker1 added bug resolved Issue is resolved and the feature or fix will be part of next release labels May 25, 2023
@PerMildner
Copy link

I was about to report another reification-related bug in 2.7.4 (not present in 2.7.2). Do you have nightly builds or some such where the latest fixes can be tried out to see if my problem is gone?

@Dekker1
Copy link
Member

Dekker1 commented May 25, 2023

We don't create the full packages (at least not signed and available), but you can try using the Docker edge tag: https://hub.docker.com/r/minizinc/minizinc/tags or the edge channel when using snap: https://snapcraft.io/minizinc

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

4 participants