Closed
Description
The following happens in all versions that I have tried.
If it's not a bug, it's certainly non-intuitive.
$ cat bug1.mzn
array[1..3] of set of int: C = [{1},{2},{3}];
array[int] of set of int: F(int: t) =
if t = 3 then [] else [C[t+1] | _ in 1..2] ++ F(t+1) endif;
output ["F = \(F(0));\n"];
$ minizinc bug1.mzn
Error: type error: type mismatch in branches of conditional. `then' branch has type `array[int] of bot', but `else' branch has type `array[int] of set of int'
/home/matsc/Coursera/Ass8/models/bug1.mzn:3.17-18
$ cat bug2.mzn
array[1..3] of set of int: C = [{1},{2},{3}];
array[int] of set of int: F(int: t) =
if t = 3 then [{}] else [C[t+1] | _ in 1..2] ++ F(t+1) endif;
output ["F = \(F(0));\n"];
$ minizinc bug2.mzn
F = [1..1, 1..1, 2..2, 2..2, 3..3, 3..3, {}];
----------