Blame view

fz/examples/CostasArray.fzn 6.5 KB
2bac8a70   Salvador Abreu   added some examples
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
array [1..2] of int: X_INTRODUCED_42 = [1,-1];
array [1..3] of int: X_INTRODUCED_45 = [1,-1,1];
array [1..4] of int: X_INTRODUCED_70 = [1,1,-1,-1];
var 1..6: X_INTRODUCED_0;
var 1..6: X_INTRODUCED_1;
var 1..6: X_INTRODUCED_2;
var 1..6: X_INTRODUCED_3;
var 1..6: X_INTRODUCED_4;
var 1..6: X_INTRODUCED_5;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_7:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_8:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_9:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_10:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_11:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_14:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_15:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_16:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_17:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_21:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_22:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_23:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_28:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_29:: is_defined_var;
var {-5,-4,-3,-2,-1,1,2,3,4,5}: X_INTRODUCED_35:: is_defined_var;
array [1..6] of var 1..6: costas:: output_array([1..6]) = [X_INTRODUCED_0,X_INTRODUCED_1,X_INTRODUCED_2,X_INTRODUCED_3,X_INTRODUCED_4,X_INTRODUCED_5];
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_1],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_2],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_3],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_4],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_5],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_1,X_INTRODUCED_2],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_1,X_INTRODUCED_3],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_1,X_INTRODUCED_4],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_1,X_INTRODUCED_5],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_2,X_INTRODUCED_3],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_2,X_INTRODUCED_4],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_2,X_INTRODUCED_5],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_3,X_INTRODUCED_4],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_3,X_INTRODUCED_5],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_4,X_INTRODUCED_5],0);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_7,X_INTRODUCED_1,X_INTRODUCED_0],0):: defines_var(X_INTRODUCED_7);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_8,X_INTRODUCED_2,X_INTRODUCED_1],0):: defines_var(X_INTRODUCED_8);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_9,X_INTRODUCED_3,X_INTRODUCED_2],0):: defines_var(X_INTRODUCED_9);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_10,X_INTRODUCED_4,X_INTRODUCED_3],0):: defines_var(X_INTRODUCED_10);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_11,X_INTRODUCED_5,X_INTRODUCED_4],0):: defines_var(X_INTRODUCED_11);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_14,X_INTRODUCED_2,X_INTRODUCED_0],0):: defines_var(X_INTRODUCED_14);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_15,X_INTRODUCED_3,X_INTRODUCED_1],0):: defines_var(X_INTRODUCED_15);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_16,X_INTRODUCED_4,X_INTRODUCED_2],0):: defines_var(X_INTRODUCED_16);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_17,X_INTRODUCED_5,X_INTRODUCED_3],0):: defines_var(X_INTRODUCED_17);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_21,X_INTRODUCED_3,X_INTRODUCED_0],0):: defines_var(X_INTRODUCED_21);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_22,X_INTRODUCED_4,X_INTRODUCED_1],0):: defines_var(X_INTRODUCED_22);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_23,X_INTRODUCED_5,X_INTRODUCED_2],0):: defines_var(X_INTRODUCED_23);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_28,X_INTRODUCED_4,X_INTRODUCED_0],0):: defines_var(X_INTRODUCED_28);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_29,X_INTRODUCED_5,X_INTRODUCED_1],0):: defines_var(X_INTRODUCED_29);
constraint int_lin_eq(X_INTRODUCED_45,[X_INTRODUCED_35,X_INTRODUCED_5,X_INTRODUCED_0],0):: defines_var(X_INTRODUCED_35);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_7,X_INTRODUCED_8],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_7,X_INTRODUCED_9],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_7,X_INTRODUCED_10],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_7,X_INTRODUCED_11],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_8,X_INTRODUCED_9],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_8,X_INTRODUCED_10],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_8,X_INTRODUCED_11],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_9,X_INTRODUCED_10],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_9,X_INTRODUCED_11],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_10,X_INTRODUCED_11],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_14,X_INTRODUCED_15],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_14,X_INTRODUCED_16],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_14,X_INTRODUCED_17],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_15,X_INTRODUCED_16],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_15,X_INTRODUCED_17],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_16,X_INTRODUCED_17],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_21,X_INTRODUCED_22],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_21,X_INTRODUCED_23],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_22,X_INTRODUCED_23],0);
constraint int_lin_ne(X_INTRODUCED_42,[X_INTRODUCED_28,X_INTRODUCED_29],0);
constraint int_lin_le(X_INTRODUCED_42,[X_INTRODUCED_0,X_INTRODUCED_5],-1);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_8,X_INTRODUCED_21,X_INTRODUCED_14,X_INTRODUCED_15],0);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_9,X_INTRODUCED_22,X_INTRODUCED_15,X_INTRODUCED_16],0);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_10,X_INTRODUCED_23,X_INTRODUCED_16,X_INTRODUCED_17],0);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_15,X_INTRODUCED_28,X_INTRODUCED_21,X_INTRODUCED_22],0);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_16,X_INTRODUCED_29,X_INTRODUCED_22,X_INTRODUCED_23],0);
constraint int_lin_eq(X_INTRODUCED_70,[X_INTRODUCED_22,X_INTRODUCED_35,X_INTRODUCED_28,X_INTRODUCED_29],0);
solve :: int_search(costas,input_order,indomain_min,complete) satisfy;