forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
artificial_intelligence.fzn
25 lines (25 loc) · 1.36 KB
/
artificial_intelligence.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
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 0..9: A;
var 0..9: C;
var 0..9: E;
var 0..9: F;
var 0..9: G;
var 0..9: I;
var 0..9: L;
var 0..9: N;
var 0..9: R;
var 0..9: T;
array [1..10] of var 0..9: x :: output_array([1..10]) = [A, N, C, E, L, R, T, I, G, F];
constraint all_different_int(x);
constraint int_lin_eq([-99000010211, -11000098990, -10011229122, -99900100, -100000002, 89991109700, 998990, 7998990069, 98897990, 1009995988], [A, C, E, F, G, I, L, N, R, T], 0);
solve :: int_search(x, first_fail, indomain_min, complete) satisfy;