this repo has no description
1/***
2--- !Test
3solvers: [gecode, chuffed]
4expected: !Result
5 solution: !Solution
6 q: [1, 5, 8, 6, 3, 7, 2, 4]
7***/
8
9int: n = 8;
10
11array [1..n] of var 1..n: q;
12
13predicate
14 noattack(int: i, int: j, var int: qi, var int: qj) =
15 qi != qj /\
16 qi + i != qj + j /\
17 qi - i != qj - j;
18
19constraint
20 forall (i in 1..n, j in i+1..n) (
21 noattack(i, j, q[i], q[j])
22 );
23
24solve ::
25 int_search(
26 q,
27 first_fail,
28 indomain,
29 complete
30 )
31 satisfy;
32
33output [ show(q) ++ "\n" ];