forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
a_puzzle.fzn
35 lines (35 loc) · 1.35 KB
/
a_puzzle.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var 0..9: INT____00001 :: is_defined_var :: var_is_introduced;
var 0..9: x :: output_var = INT____00001;
var 0..9: x0;
var 0..9: x1;
var 0..9: x2;
var 0..9: x3;
var 0..9: x4;
var 0..9: x5;
var 0..9: x6;
var 0..9: x7;
var 0..9: x8;
var 0..9: x9;
array [1..10] of var 0..9: all :: output_array([1..10]) = [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9];
constraint int_lin_eq([4], [x0], 4);
constraint int_lin_eq([4], [x1], 0);
constraint int_lin_eq([4], [x2], 0);
constraint int_lin_eq([4], [x3], 0);
constraint int_lin_eq([4], [x5], 0);
constraint int_lin_eq([4], [x6], 4);
constraint int_lin_eq([4], [x7], 0);
constraint int_lin_eq([4], [x9], 4);
constraint int_lin_eq([3, 1], [x1, x7], 0);
constraint int_lin_eq([1, 1, 2], [x1, x2, x3], 0);
constraint int_lin_eq([1, 1, 2], [x1, x3, x5], 0);
constraint int_lin_eq([1, 1, 2], [x5, x6, x7], 1);
constraint int_lin_eq([1, 2, 1], [x0, x8, x9], 6);
constraint int_lin_eq([1, 2, 1], [x1, x2, x7], 0);
constraint int_lin_eq([1, 2, 1], [x1, x8, x9], 5);
constraint int_lin_eq([1, 2, 1], [x2, x6, x7], 2);
constraint int_lin_eq([2, 1, 1], [x5, x6, x8], 3);
constraint int_lin_eq([1, 1, 1, 1], [x0, x6, x8, x9], 5);
constraint int_lin_eq([1, 1, 1, 1], [x1, x2, x3, x9], 1);
constraint int_lin_eq([1, 1, 1, 1], [x1, x3, x8, x9], 3);
constraint int_lin_eq([-1, 1, 1, 1, 1], [INT____00001, x1, x2, x5, x8], 0) :: defines_var(INT____00001);
solve satisfy;