12 lines
332 B
MiniZinc
12 lines
332 B
MiniZinc
function tuple(var bool, var int): int_plus(
|
|
tuple(var bool, var int): x,
|
|
tuple(var bool, var int): y
|
|
) =
|
|
let {
|
|
(x1, x2) = x;
|
|
(y1, y2) = y;
|
|
var int: x3 = if_then_else([x1, true], [x2, 0]);
|
|
var int: y3 = if_then_else([y1, true], [y2, 0]);
|
|
tuple(var bool, var int): res = (bool_and(x1, y1), int_plus(x3, y3));
|
|
} in res;
|