-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
all_differ_from_at_least_k_pos.fzn
66 lines (66 loc) · 4.25 KB
/
all_differ_from_at_least_k_pos.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
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____00019 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00021 :: is_defined_var :: var_is_introduced;
var bool: BOOL____00023 :: 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..1: INT____00020 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00022 :: is_defined_var :: var_is_introduced;
var 0..1: INT____00024 :: is_defined_var :: var_is_introduced;
var 2..2: c :: output_var = 2;
array [1..12] of var 0..6: x :: output_array([1..3, 1..4]);
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 bool2int(BOOL____00019, INT____00020) :: defines_var(INT____00020);
constraint bool2int(BOOL____00021, INT____00022) :: defines_var(INT____00022);
constraint bool2int(BOOL____00023, INT____00024) :: defines_var(INT____00024);
constraint int_eq(x[1], 2);
constraint int_eq(x[2], 5);
constraint int_eq(x[3], 2);
constraint int_eq(x[4], 0);
constraint int_eq(x[5], 3);
constraint int_eq(x[6], 6);
constraint int_eq(x[7], 2);
constraint int_eq(x[8], 1);
constraint int_eq(x[9], 3);
constraint int_eq(x[10], 6);
constraint int_eq(x[11], 1);
constraint int_eq(x[12], 0);
constraint int_lin_le([-1, -1, -1, -1, 1], [INT____00002, INT____00004, INT____00006, INT____00008, c], 0);
constraint int_lin_le([-1, -1, -1, -1, 1], [INT____00010, INT____00012, INT____00014, INT____00016, c], 0);
constraint int_lin_le([-1, -1, -1, -1, 1], [INT____00018, INT____00020, INT____00022, INT____00024, c], 0);
constraint int_ne_reif(x[1], x[5], BOOL____00001) :: defines_var(BOOL____00001);
constraint int_ne_reif(x[1], x[9], BOOL____00009) :: defines_var(BOOL____00009);
constraint int_ne_reif(x[2], x[6], BOOL____00003) :: defines_var(BOOL____00003);
constraint int_ne_reif(x[2], x[10], BOOL____00011) :: defines_var(BOOL____00011);
constraint int_ne_reif(x[3], x[7], BOOL____00005) :: defines_var(BOOL____00005);
constraint int_ne_reif(x[3], x[11], BOOL____00013) :: defines_var(BOOL____00013);
constraint int_ne_reif(x[4], x[8], BOOL____00007) :: defines_var(BOOL____00007);
constraint int_ne_reif(x[4], x[12], BOOL____00015) :: defines_var(BOOL____00015);
constraint int_ne_reif(x[5], x[9], BOOL____00017) :: defines_var(BOOL____00017);
constraint int_ne_reif(x[6], x[10], BOOL____00019) :: defines_var(BOOL____00019);
constraint int_ne_reif(x[7], x[11], BOOL____00021) :: defines_var(BOOL____00021);
constraint int_ne_reif(x[8], x[12], BOOL____00023) :: defines_var(BOOL____00023);
solve :: int_search([x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12]], first_fail, indomain_min, complete) satisfy;