forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alldifferent_soft.fzn
108 lines (108 loc) · 7.86 KB
/
alldifferent_soft.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
predicate fzn_all_different_int(array [int] of var int: x);
predicate count(array [int] of var int: x, var int: y, var int: c);
predicate fixed_fzn_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, int: b);
predicate global_cardinality(array [int] of var int: x, array [int] of int: cover, array [int] of var int: counts);
predicate maximum_int(var int: m, array [int] of var int: x);
predicate minimum_int(var int: m, array [int] of var int: x);
predicate sliding_sum(int: low, int: up, int: seq, array [int] of var int: vs);
predicate sort(array [int] of var int: x, array [int] of var int: y);
predicate table_bool(array [int] of var bool: x, array [int, int] of bool: t);
predicate table_int(array [int] of var int: x, array [int, int] of int: t);
predicate var_fzn_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, var int: b);
var bool: BOOL____00002 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00004 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00006 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00008 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00010 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00012 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00014 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00016 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00018 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00020 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00022 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00024 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00026 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00028 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00030 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00032 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00034 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00036 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00038 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00040 :: is_defined_var :: var_is_introduced;
var int: INT____00001 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00003 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00005 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00007 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00009 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00011 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00013 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00015 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00017 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00019 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00021 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00023 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00025 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00027 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00029 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00031 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00033 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00035 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00037 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00039 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00041 :: is_defined_var :: var_is_introduced;
var 0..5: INT____00042 :: is_defined_var :: var_is_introduced;
var 0..15: INT____00043 :: is_defined_var :: var_is_introduced;
var 0..5: a :: output_var = INT____00042;
var 0..15: b :: output_var = INT____00043;
var int: d :: output_var = INT____00001;
array [1..6] of var 1..9: x :: output_array([1..6]);
constraint bool2int(BOOL____00002, INT____00003) :: defines_var(INT____00003);
constraint bool2int(BOOL____00004, INT____00005) :: defines_var(INT____00005);
constraint bool2int(BOOL____00006, INT____00007) :: defines_var(INT____00007);
constraint bool2int(BOOL____00008, INT____00009) :: defines_var(INT____00009);
constraint bool2int(BOOL____00010, INT____00011) :: defines_var(INT____00011);
constraint bool2int(BOOL____00012, INT____00013) :: defines_var(INT____00013);
constraint bool2int(BOOL____00014, INT____00015) :: defines_var(INT____00015);
constraint bool2int(BOOL____00016, INT____00017) :: defines_var(INT____00017);
constraint bool2int(BOOL____00018, INT____00019) :: defines_var(INT____00019);
constraint bool2int(BOOL____00020, INT____00021) :: defines_var(INT____00021);
constraint bool2int(BOOL____00022, INT____00023) :: defines_var(INT____00023);
constraint bool2int(BOOL____00024, INT____00025) :: defines_var(INT____00025);
constraint bool2int(BOOL____00026, INT____00027) :: defines_var(INT____00027);
constraint bool2int(BOOL____00028, INT____00029) :: defines_var(INT____00029);
constraint bool2int(BOOL____00030, INT____00031) :: defines_var(INT____00031);
constraint bool2int(BOOL____00032, INT____00033) :: defines_var(INT____00033);
constraint bool2int(BOOL____00034, INT____00035) :: defines_var(INT____00035);
constraint bool2int(BOOL____00036, INT____00037) :: defines_var(INT____00037);
constraint bool2int(BOOL____00038, INT____00039) :: defines_var(INT____00039);
constraint bool2int(BOOL____00040, INT____00041) :: defines_var(INT____00041);
constraint int_eq(1, x[2]);
constraint int_eq(1, x[4]);
constraint int_eq(5, x[1]);
constraint int_eq(5, x[5]);
constraint int_eq(5, x[6]);
constraint int_eq(9, x[3]);
constraint int_eq_reif(x[2], x[1], BOOL____00002) :: defines_var(BOOL____00002);
constraint int_eq_reif(x[3], x[1], BOOL____00006) :: defines_var(BOOL____00006);
constraint int_eq_reif(x[3], x[2], BOOL____00008) :: defines_var(BOOL____00008);
constraint int_eq_reif(x[4], x[1], BOOL____00012) :: defines_var(BOOL____00012);
constraint int_eq_reif(x[4], x[2], BOOL____00014) :: defines_var(BOOL____00014);
constraint int_eq_reif(x[4], x[3], BOOL____00016) :: defines_var(BOOL____00016);
constraint int_eq_reif(x[5], x[1], BOOL____00020) :: defines_var(BOOL____00020);
constraint int_eq_reif(x[5], x[2], BOOL____00022) :: defines_var(BOOL____00022);
constraint int_eq_reif(x[5], x[3], BOOL____00024) :: defines_var(BOOL____00024);
constraint int_eq_reif(x[5], x[4], BOOL____00026) :: defines_var(BOOL____00026);
constraint int_eq_reif(x[6], x[1], BOOL____00030) :: defines_var(BOOL____00030);
constraint int_eq_reif(x[6], x[2], BOOL____00032) :: defines_var(BOOL____00032);
constraint int_eq_reif(x[6], x[3], BOOL____00034) :: defines_var(BOOL____00034);
constraint int_eq_reif(x[6], x[4], BOOL____00036) :: defines_var(BOOL____00036);
constraint int_eq_reif(x[6], x[5], BOOL____00038) :: defines_var(BOOL____00038);
constraint int_lin_eq([-1, -1, 1], [INT____00001, a, b], 0) :: defines_var(INT____00001);
constraint int_lin_eq([-1, 1, 1, 1, 1, 1], [INT____00042, INT____00005, INT____00011, INT____00019, INT____00029, INT____00041], 0) :: defines_var(INT____00042);
constraint int_lin_eq([-1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [INT____00043, INT____00003, INT____00007, INT____00009, INT____00013, INT____00015, INT____00017, INT____00021, INT____00023, INT____00025, INT____00027, INT____00031, INT____00033, INT____00035, INT____00037, INT____00039], 0) :: defines_var(INT____00043);
constraint int_lin_le_reif([-1], [INT____00003], -1, BOOL____00004) :: defines_var(BOOL____00004);
constraint int_lin_le_reif([-1, -1], [INT____00007, INT____00009], -1, BOOL____00010) :: defines_var(BOOL____00010);
constraint int_lin_le_reif([-1, -1, -1], [INT____00013, INT____00015, INT____00017], -1, BOOL____00018) :: defines_var(BOOL____00018);
constraint int_lin_le_reif([-1, -1, -1, -1], [INT____00021, INT____00023, INT____00025, INT____00027], -1, BOOL____00028) :: defines_var(BOOL____00028);
constraint int_lin_le_reif([-1, -1, -1, -1, -1], [INT____00031, INT____00033, INT____00035, INT____00037, INT____00039], -1, BOOL____00040) :: defines_var(BOOL____00040);
solve satisfy;