forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
between_min_max.fzn
22 lines (22 loc) · 1.23 KB
/
between_min_max.fzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 3..8: max_val____00002;
var 1..3: min_val____00001;
var 3..3: nvar :: output_var = 3;
array [1..4] of var 1..8: x :: output_array([1..4]);
constraint int_eq(1, x[1]);
constraint int_eq(1, x[2]);
constraint int_eq(4, x[3]);
constraint int_eq(8, x[4]);
constraint maximum_int(max_val____00002, x);
constraint minimum_int(min_val____00001, x);
solve satisfy;