You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
include "member.mzn";
int: N = 3;
array [1..N] of var bool: x;
var bool: y;
constraint member(x, y);
constraint x = array1d(1..3, [true, false, false]);
constraint y = true;
solve satisfy;
output ["x = ", show(x), "\n", "y = ", show(y)];
MiniZinc 2.8.0 (using Gecode as backend) reports the following:
Error: undefined identifier for type bool X_INTRODUCED_0_ in line no. 5
Error: undefined identifier for type bool X_INTRODUCED_1_ in line no. 5
Error: undefined identifier for type bool X_INTRODUCED_2_ in line no. 5
Error: undefined identifier x in line no. 6
=====ERROR=====
Using Chuffed results in similar error messages.
The result of flattening looks ok to me:
predicate fzn_member_bool(array [int] of var bool: x,var bool: y);
bool: X_INTRODUCED_0_ = true;
bool: X_INTRODUCED_1_ = false;
bool: X_INTRODUCED_2_ = false;
array [1..3] of var bool: x:: output_array([1..3]) = [X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_];
constraint fzn_member_bool(x,true);
solve satisfy;
MiniZinc 2.7.6 works fine on the above problem, but the FlatZinc output looks a bit different:
predicate fzn_member_bool(array [int] of var bool: x,var bool: y);
var bool: X_INTRODUCED_0_;
var bool: X_INTRODUCED_1_;
var bool: X_INTRODUCED_2_;
array [1..3] of var bool: x:: output_array([1..3]) = [X_INTRODUCED_0_,X_INTRODUCED_1_,X_INTRODUCED_2_];
constraint fzn_member_bool(x,true);
constraint bool_eq(X_INTRODUCED_0_,true);
constraint bool_eq(X_INTRODUCED_1_,false);
constraint bool_eq(X_INTRODUCED_2_,false);
solve satisfy;
The text was updated successfully, but these errors were encountered:
This is not allowed according to the spec (and probably ignored in the Gecode and Chuffed parsers). Normally this is correctly rewritten when finalising the FlatZinc, but something must be going wrong.
This is not allowed according to the spec (and probably ignored in the Gecode and Chuffed parsers). Normally this is correctly rewritten when finalising the FlatZinc, but something must be going wrong.
Is that not allowed in the spec? The example in the docs seems to have this exact thing in it
Yes, you are right. Looking at the grammar there is nothing preventing this. Maybe it is just an informal rule that we've generally held (that only par-arrays are put into FlatZinc) that those parsers have come to rely on.
Consider this problem:
MiniZinc 2.8.0 (using Gecode as backend) reports the following:
Using Chuffed results in similar error messages.
The result of flattening looks ok to me:
MiniZinc 2.7.6 works fine on the above problem, but the FlatZinc output looks a bit different:
The text was updated successfully, but these errors were encountered: