Here is one way to check that [1,2,3]
is in t
:
array[1..3,1..3] of var 1..3: t;
var bool: check;
constraint
exists(i in 1..3) (
t[i,..] == [1,2,3]
) <-> check
;
Some solutions:
...
t =
[| 3, 2, 3
| 3, 3, 3
| 3, 3, 3
|];
check = false;
----------
t =
[| 1, 2, 3
| 3, 3, 3
| 3, 3, 3
|];
check = true;
----------
t =
[| 2, 1, 2
| 3, 3, 3
| 3, 3, 3
|];
check = false;
----------
...
If you want to ensure that [1,2,3]
is in t
, you can skip the check
variable:
array[1..3,1..3] of var 1..3: t;
constraint
exists(i in 1..3) (
t[i,..] == [1,2,3]
)
;
Some solutions:
t =
[| 1, 2, 3
| 3, 3, 3
| 3, 3, 3
|];
----------
t =
[| 1, 2, 3
| 2, 3, 3
| 3, 3, 3
|];
----------
t =
[| 1, 2, 3
| 1, 3, 3
| 3, 3, 3
|];
----------
...