I'm new to MiniZinc, so please let me know if I'm doing something stupid.
This is my model:
int: n = 10;
array[1..n] of var 1..n: a;
That's it. Now I want to print a solution:
output [join(" ", [show_int(2, x) | x in a])];
This is fine (it prints "1 1 1 1 1 ..."). But now I want to "refactor" this output line by using an intermediate variable while preserving the same behavior:
array[1..n] of string: A = [show_int(2, x) | x in a];
output [join(" ", A)];
This causes MiniZinc to break in various ways, depending on the way I'm running it and the value of n:
- In the IDE with n = 10 I get this output:
X_INTRODUCED_0_ X_INTRODUCED_1_ X_INTRODUCED_2_ X_INTRODUCED_3_ X_INTRODUCED_4_ X_INTRODUCED_5_ X_INTRODUCED_6_ X_INTRODUCED_7_ X_INTRODUCED_8_ X_INTRODUCED_9_
- In the IDE with n = 50 I get this error message:
MiniZinc: type error: undefined identifier X_INTRODUCED_50_' ` (sadly, the temporary files are not saved, so I can't see what's going on exactly).
- In the command-line tool I get a printing similar to the n=10 case in the IDE, even when n = 50. When I look into the fzn file, it just has
solve satisfy; in it and nothing else.
I'm using MiniZinc 2.3.2 on Windows.
I'm new to MiniZinc, so please let me know if I'm doing something stupid.
This is my model:
That's it. Now I want to print a solution:
output [join(" ", [show_int(2, x) | x in a])];This is fine (it prints "1 1 1 1 1 ..."). But now I want to "refactor" this output line by using an intermediate variable while preserving the same behavior:
This causes MiniZinc to break in various ways, depending on the way I'm running it and the value of n:
X_INTRODUCED_0_ X_INTRODUCED_1_ X_INTRODUCED_2_ X_INTRODUCED_3_ X_INTRODUCED_4_ X_INTRODUCED_5_ X_INTRODUCED_6_ X_INTRODUCED_7_ X_INTRODUCED_8_ X_INTRODUCED_9_MiniZinc: type error: undefined identifierX_INTRODUCED_50_' ` (sadly, the temporary files are not saved, so I can't see what's going on exactly).solve satisfy;in it and nothing else.I'm using MiniZinc 2.3.2 on Windows.