this repo has no description
1% 2% Main authors: 3% Guido Tack <tack@gecode.org> 4% 5% Copyright: 6% Guido Tack, 2007 7% 8% This file is part of Gecode, the generic constraint 9% development environment: 10% http://www.gecode.org 11% 12% Permission is hereby granted, free of charge, to any person obtaining 13% a copy of this software and associated documentation files (the 14% "Software"), to deal in the Software without restriction, including 15% without limitation the rights to use, copy, modify, merge, publish, 16% distribute, sublicense, and/or sell copies of the Software, and to 17% permit persons to whom the Software is furnished to do so, subject to 18% the following conditions: 19% 20% The above copyright notice and this permission notice shall be 21% included in all copies or substantial portions of the Software. 22% 23% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24% EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26% NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28% OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30% 31% 32 33% This file contains predicate definitions for additional constraints available 34% in the Gecode FlatZinc interpreter. 35 36% Additional search annotations 37annotation afc_min; 38annotation afc_size_min; 39annotation afc_max; 40annotation afc_size_max; 41annotation activity_min; 42annotation activity_size_min; 43annotation activity_max; 44annotation activity_size_max; 45annotation random; 46annotation int_assign(array[int] of var int: x, ann:a); 47 48annotation int_default_search(ann: varsel, ann: valsel); 49annotation bool_default_search(ann: varsel, ann: valsel); 50annotation set_default_search(ann: varsel, ann: valsel); 51annotation float_default_search(ann: varsel, ann: valsel); 52 53% Simple LNS: upon restart, for each variable the probability of it being 54% fixed to the previous solution is 'percentage' (out of 100). 55annotation relax_and_reconstruct(array[int] of var int: x, int: percentage); 56 57% Simple LNS: upon restart, for each variable the probability of it being 58% fixed to the previous solution is 'percentage' (out of 100). Start from 59% an initial solution y. 60annotation relax_and_reconstruct(array[int] of var int: x, int: percentage, array[int] of int: y); 61 62% i in z <-> forall (j in x) (i in y[j]) 63predicate gecode_array_set_element_intersect(var set of int: x, 64 array[int] of var set of int: y, var set of int: z); 65 66% (i in z <-> exists (j in x) (i in y[j])) /\ (i in x /\ j in x /\ i!=j -> disjoint(y[i],y[j])) 67predicate gecode_array_set_element_partition(var set of int: x, 68 array[int] of var set of int: y, var set of int: z); 69 70% z subset u /\ ( i in z <-> forall (j in x) (i in y[j]) ) 71predicate gecode_array_set_element_intersect_in(var set of int: x, 72 array[int] of var set of int: y, 73 var set of int: z, set of int: u); 74 75% Every subsequence of x of length l has at least m and at most occurrences 76% of the values in S 77predicate gecode_among_seq_int(array[int] of var int: x, set of int: S, 78 int: l, int: m, int: n); 79 80% Every subsequence of x of length l has at least m and at most occurrences 81% of the value b 82predicate gecode_among_seq_bool(array[int] of var bool: x, bool: b, 83 int: l, int: m, int: n); 84 85% Overloading for among_seq 86predicate among_seq(array[int] of var int: x, set of int: S, 87 int: l, int: m, int: n) = gecode_among_seq_int(x,S,l,m,n); 88predicate among_seq(array[int] of var bool: x, bool: b, 89 int: l, int: m, int: n) = gecode_among_seq_bool(x,b,l,m,n); 90 91% Circuit constraints 92predicate gecode_circuit_cost_array(array[int] of int: c, 93 array[int] of var int: x, array[int] of var int: y, var int: z); 94predicate gecode_circuit_cost(array[int] of int: c, array[int] of var int: x, 95 var int: z); 96 97predicate circuit_cost_array(array[int] of int: c, 98 array[int] of var int: x, array[int] of var int: y, var int: z) = 99 gecode_circuit_cost_array(c,[x[i]-min(index_set(x)) | i in index_set(x)], 100 y,z); 101predicate circuit_cost(array[int] of int: c, array[int] of var int: x, 102 var int: z) = 103 gecode_circuit_cost(c, [x[i]-min(index_set(x)) | i in index_set(x)], z); 104 105% Scheduling constraints 106predicate gecode_schedule_unary(array[int] of var int: x, array[int] of int: p); 107predicate gecode_schedule_unary_optional(array[int] of var int: x, 108 array[int] of int: p, array[int] of var bool: m); 109 110predicate gecode_schedule_cumulative_optional(array[int] of var int: start, 111 array[int] of int: duration, array[int] of int: usage, 112 array[int] of var bool: m, int: capacity);