In a model that I've written in MiniZincIDE 0.9.9, the following constraint throws a "cannot determine bounds" error during array comprehension:
constraint forall(i in Layers)(
layDists[i] == sum(
[Dists[find(a,b,c,d)] | a in Coords, c in Layers, b in Coords, d in Layers
where coordSolLays[a,c] == i ]));
where
array[Coords,Layers] of var Layers: coordSolLays;
array[Layers] of var 0..10000000: layDists;
function var 1..length(Dists): find(var int: a, var int: b, var int: c, var int: d) =
adjIndex[a] + (d-1) + (c-1)*numLays + (b-1)*numLays2;
and adjIndex and Dists are parameter arrays.
The error itself reads:
MiniZinc: evaluation error:
.../model.mzn:206:
in call 'forall'
in array comprehension expression
with i = 1
.../model.mzn:207:
in binary '=' operator expression
in call 'sum'
.../model.mzn:208:
in array comprehension expression
with a = 1
with c = 1
with b = 1
with d = 1
cannot determine bounds
I'm aware that the error is generally thrown when variable bounds can't be determined (MiniZinc "cannot determine bounds"), however, all of the constraint variables are bound.
I suspect the issue is with find(a,b,c,d), coordSolLays[a,b], and/or their interaction, since replacing one or both of them with integers or simple variables (i.e. a,b,i) yields a solution.
Any ideas of what might be happening? Thanks in advance!