# disjunctive constraints, use of ~= ?

Date: Thu 24 Apr 2003 10:39:42 AM GMT
```Dear all,

so here is another question from me.  Sometime, I feel I'm asking the wrong

I would like to formulate disjunctive constraints with set variables
(fd_sets).  An example is

either X1 disjoint X1 or Y1 disjoint Y2

where X1 .. Y2 are interger sets.  Currently, I'm simulating this with ~=
(notinstance), eg

[X1, Y1] ~= [X2, Y2].

This works quite well.  It would work even better if

[Y1] ~= [Y2]  would invoke Y1 disjoint Y2.

Example:

:- lib(fd_sets), (import (subset)/2 from fd_sets).
:- lib(notinstance), (import (~=)/2 from notinstance).

test :-
X1 subset [1,2], #(X1,1),
Y1 subset [1,2], #(Y1,1),
X2 subset [1,2], #(X2,1),
Y2 subset [1,2], #(Y2,1),
[X1, Y1] ~= [X2, Y2],
X1 = X2.

Hs the delayed goal

sync_attributes(fd_sets([](_280, _281), 0, 0, 2, _331, _332, ['SUSP-_1082-susp', 'SUSP-_342-susp', 'SUSP-_748-susp'], ['SUSP-_1082-susp'], 1, _277, X1{([] .. [1, 2]) : 1}), e(_737, 'SUSP-_1082-susp'), e(_738, 'SUSP-_1082-susp'))
nu_wf([Y1{([] .. [1, 2]) : 1} ~= Y2{([] .. [1, 2]) : 1}])

Now my question: Is there a way to get the same behaviour in another way or to
"invoke" Y1 disjoint Y2 without reprogramming ~=?  My guess is: no

But then: How hard is it to rewrite/change ~=.  Do I have access to its code?

Thank you for all your help,

Uli

--
Ulrich Scholz