forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
added_corner.fzn
29 lines (29 loc) · 1.73 KB
/
added_corner.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
predicate 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_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_cumulative(array [int] of var int: s, array [int] of int: d, array [int] of int: r, var int: b);
var 1..8: A :: output_var;
var 1..8: C :: output_var;
var 1..8: F :: output_var;
var 1..8: H :: output_var;
var 2..8: INT____00001 :: is_defined_var :: var_is_introduced;
var 2..8: B :: output_var = INT____00001;
var 2..8: INT____00002 :: is_defined_var :: var_is_introduced;
var 2..8: D :: output_var = INT____00002;
var 2..8: INT____00003 :: is_defined_var :: var_is_introduced;
var 2..8: E :: output_var = INT____00003;
var 2..8: INT____00004 :: is_defined_var :: var_is_introduced;
var 2..8: G :: output_var = INT____00004;
constraint all_different_int([A, B, C, D, E, F, G, H]);
constraint int_plus(A, C, INT____00001) :: defines_var(INT____00001);
constraint int_plus(A, F, INT____00002) :: defines_var(INT____00002);
constraint int_plus(C, H, INT____00003) :: defines_var(INT____00003);
constraint int_plus(F, H, INT____00004) :: defines_var(INT____00004);
solve satisfy;