我试图用 MiniZinc 中的字符串连接运算符定义一个约束,求解变量a
和b
:
include "disjunctive.mzn";
var string:a;
var string:b;
constraint("var1/var2" = (a ++ "/" ++ b));
solve satisfy;
output ["\nx=", show(a)];
尽管如此,这似乎是一个语法错误:
MiniZinc: type error: type error in operator application for `++'. No matching operator found with left-hand side type `string' and right-hand side type `var string'
是否仍然可以使用字符串或数组作为变量来解决 MiniZinc 中的约束?