X is X{1..5}
and
the domain of Y is Y{3..7}
, we would like the domains to be updated such
that the upper bound of Y gets reduced to 5, and the lower bound of X
gets increased to 3. The following code achieves this:
ge(X, Y) :- get_bounds(X, _, XH), get_bounds(Y, YL, _), ( var(X),var(Y) -> suspend(ge(X,Y), 0, [X->ic:max, Y->ic:min]) ; true ), X #>= YL, % impose new bounds Y #=< XH. |