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);
array [1..10] of int: duration = [7, 3, 1, 8, 2, 1, 1, 3, 2, 1];
array [1..10] of int: height = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
array [1..26] of int: precedences = [1, 2, 2, 3, 1, 4, 3, 5, 4, 5, 3, 6, 4, 6, 3, 7, 4, 7, 1, 8, 6, 9, 8, 9, 9, 10];
array [1..10] of var 1..29: end;
var 1..3: limitx;
var 1..29: makespan :: output_var;
array [1..10] of var 1..29: start :: output_array([1..10]);
constraint int_lin_eq([1, -1], [end[1], start[1]], 7);
constraint int_lin_eq([1, -1], [end[2], start[2]], 3);
constraint int_lin_eq([1, -1], [end[3], start[3]], 1);
constraint int_lin_eq([1, -1], [end[4], start[4]], 8);
constraint int_lin_eq([1, -1], [end[5], start[5]], 2);
constraint int_lin_eq([1, -1], [end[6], start[6]], 1);
constraint int_lin_eq([1, -1], [end[7], start[7]], 1);
constraint int_lin_eq([1, -1], [end[8], start[8]], 3);
constraint int_lin_eq([1, -1], [end[9], start[9]], 2);
constraint int_lin_eq([1, -1], [end[10], start[10]], 1);
constraint int_lin_le([1, -1], [start[1], start[2]], -7);
constraint int_lin_le([1, -1], [start[1], start[4]], -7);
constraint int_lin_le([1, -1], [start[1], start[8]], -7);
constraint int_lin_le([1, -1], [start[2], start[3]], -3);
constraint int_lin_le([1, -1], [start[3], start[5]], -1);
constraint int_lin_le([1, -1], [start[3], start[6]], -1);
constraint int_lin_le([1, -1], [start[3], start[7]], -1);
constraint int_lin_le([1, -1], [start[4], start[5]], -8);
constraint int_lin_le([1, -1], [start[4], start[6]], -8);
constraint int_lin_le([1, -1], [start[4], start[7]], -8);
constraint int_lin_le([1, -1], [start[6], start[9]], -1);
constraint int_lin_le([1, -1], [start[8], start[9]], -3);
constraint int_lin_le([1, -1], [start[9], start[10]], -2);
constraint maximum_int(makespan, end);
constraint var_cumulative(start, duration, height, limitx);
solve  :: int_search([start[1], start[2], start[3], start[4], start[5], start[6], start[7], start[8], start[9], start[10], makespan, limitx], first_fail, indomain_min, complete) minimize makespan;
