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