Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Only the first iteration of a forall-constraint is applied if it contains a let-statement with a par array indexed by a var-array indexed by the forall's range. #166
This is a somewhat convoluted corner-case issue that seems to have been introduced in MiniZinc v2.1.3:
If you have a forall-constraint with a let-statement, where the let statement accesses an array that is indexed by a nother var array that is itself indexed by the variable introduced by the forall-statement,
Since that's a sentence that was rather confusing to write, I'll refer to the following example code, which attempts to make v_arr_1's elements equal v_arr_2's elements:
MiniZinc up to and including version 2.1.2 errors out on this as an inconsistent model (complaining about the != constraint, while 2.1.3 and up seems to only apply the constraint in the forall to index 1, yielding the FlatZinc result showed in the above example.
Interestingly, if we move foo's declaration down to after both v_arr_1_value and v_arr_2_value, this issue no longer pops up.
Similarly, the array lookup must be indexed by var array indexed by the forall-variable, although the outer array can be either var or par.