| 1 |
/*** |
| 2 |
!Test |
| 3 |
expected: !Result |
| 4 |
solution: !Solution |
| 5 |
x: [1, 0, 1] |
| 6 |
***/ |
| 7 |
|
| 8 |
array[1..3] of var 0..1: x; % 0 = Knight, 1 = Knave |
| 9 |
|
| 10 |
constraint (x[1] = 1) xor (sum(x) = 1); |
| 11 |
constraint (x[2] = 1) xor (sum(x) = 2); |
| 12 |
constraint (x[3] = 1) xor (sum(x) = 3); |
| 13 |
|
| 14 |
solve satisfy; |