Dear all, I need to enforce a constraint so that the domain of some of its variables are not reduced during (domain) propagation. So far I've been using the get_bounds/3 predicate to achieve this, as you can see in the following example. %+++ Example [eclipse 1] lib(ic). [eclipse 2] X #:: 0..1, get_bounds(X,B,T), (Y #:: 0..3, X + Y #< 4, indomain(Y), get_bounds(X,B1,T1), B1#=B, T1#=T). Y = 0 X = X{[0, 1]} B1 = 0 B = 0 T1 = 1 T = 1 Yes (0.00s cpu, solution 1, maybe more) ? ; [eclipse 3]: X #:: 0..3, get_bounds(X,B,T), (Y #:: 0..1, X #= Y, get_bounds(X,B1,T1), B1 #= B, T1 #= T). No (0.00s cpu) %+++ However, this is more of a trick than a general approach... Something better could be achieved by having in ic/fd a version of #::(?Var,++Domain, ?Bool) that returns Bool = 1 if and only if Domain is unchanged. Any thought on this? Thanks, PieroReceived on Tue Jan 18 10:22:04 2005
This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:33 PM GMT GMT