forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3_coins.fzn
52 lines (52 loc) · 3.4 KB
/
3_coins.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
array [1..3] of int: init = [1, 0, 1];
var bool: BOOL____00001 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00003 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00005 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00007 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00009 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00011 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00013 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00015 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00017 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00002 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00004 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00006 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00008 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00010 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00012 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00014 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00016 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00018 :: is_defined_var :: var_is_introduced;
var 0..3: last_sum;
array [1..12] of var 0..1: x :: output_array([1..4, 1..3]);
constraint array_bool_or([BOOL____00020, BOOL____00021], true);
constraint bool2int(BOOL____00001, INT____00002) :: defines_var(INT____00002);
constraint bool2int(BOOL____00003, INT____00004) :: defines_var(INT____00004);
constraint bool2int(BOOL____00005, INT____00006) :: defines_var(INT____00006);
constraint bool2int(BOOL____00007, INT____00008) :: defines_var(INT____00008);
constraint bool2int(BOOL____00009, INT____00010) :: defines_var(INT____00010);
constraint bool2int(BOOL____00011, INT____00012) :: defines_var(INT____00012);
constraint bool2int(BOOL____00013, INT____00014) :: defines_var(INT____00014);
constraint bool2int(BOOL____00015, INT____00016) :: defines_var(INT____00016);
constraint bool2int(BOOL____00017, INT____00018) :: defines_var(INT____00018);
constraint int_eq(x[1], 1);
constraint int_eq(x[2], 0);
constraint int_eq(x[3], 1);
constraint int_eq_reif(last_sum, 0, BOOL____00020) :: defines_var(BOOL____00020);
constraint int_eq_reif(last_sum, 3, BOOL____00021) :: defines_var(BOOL____00021);
constraint int_lin_eq([1, 1, 1], [INT____00002, INT____00004, INT____00006], 1);
constraint int_lin_eq([1, 1, 1], [INT____00008, INT____00010, INT____00012], 1);
constraint int_lin_eq([1, 1, 1], [INT____00014, INT____00016, INT____00018], 1);
constraint int_lin_eq([-1, 1, 1, 1], [last_sum, x[10], x[11], x[12]], 0);
constraint int_ne_reif(x[1], x[4], BOOL____00001) :: defines_var(BOOL____00001);
constraint int_ne_reif(x[2], x[5], BOOL____00003) :: defines_var(BOOL____00003);
constraint int_ne_reif(x[3], x[6], BOOL____00005) :: defines_var(BOOL____00005);
constraint int_ne_reif(x[4], x[7], BOOL____00007) :: defines_var(BOOL____00007);
constraint int_ne_reif(x[5], x[8], BOOL____00009) :: defines_var(BOOL____00009);
constraint int_ne_reif(x[6], x[9], BOOL____00011) :: defines_var(BOOL____00011);
constraint int_ne_reif(x[7], x[10], BOOL____00013) :: defines_var(BOOL____00013);
constraint int_ne_reif(x[8], x[11], BOOL____00015) :: defines_var(BOOL____00015);
constraint int_ne_reif(x[9], x[12], BOOL____00017) :: defines_var(BOOL____00017);
solve satisfy;