Hi,

Hello,

Is it possible to translate in Oz in term of propagators this "tuple-self-reference" constraint ?

Here it is :

%C is a tuple of M integers between 0 and N
{FD.tuple ProblemeDecoupage M 0#N C}

%All values are pairwise distinct in that tuple
{FD.distinct C}
C is supposed to be a list according to the docs, but it seems to work anyway :-)

%If a value is present in the tuple (for example C.1 = 1) then values 2, 3 and 7 are forbidden in the rest of the tuple
%I tried this but it doesn't worked :


Variable = (C.J =: I) %First
Contrainte = (C.J \=: {self getForbiddenValue(C.J)}) %Second
Doesn't this block? Why don't you use
  Contrainte = (C.J \=: {self getForbiddenValue(I)})

{FD.impl Variable Contrainte 1} % I wonder if this really "bind" the second constraint to the first, as it is implied by the documentation's "->" sign ... Therefore, the second constraint should be implied only if the first is verified ?

By the way, are there (undocumented ?) propagators able to work with an entire tuple at a time ? Being able to forbid a value IF another value is present in the tuple would be great.
Did you think of using set constraints (FS)?

Cheers,
Filip
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to