Dear Jeffery,

Torsten's solution will do the job. But here is a way to improve it a bit. Since the elements are increasing in the list, constraining the first 10 elements to be distant from at least 2 is equivalent to constraining a bit more the order between the first 10 elements.

Here is how I would code it (so you can compare our respective coding styles ;-) Note that this solution uses less propagators than Thorsten's.


%% Your set
Xs={FD.list 52 0#FD.sup}

%% elements in Xs are increasing: the loop iterates on
%% all consecutive elements (X,Y)
for X in Xs  Y in Xs.2 do
   X <: Y
end

%% the first 10 elements are distant from at least 2
Xs10={List.take Xs 10}
for X in Xs10  Y in Xs10.2 do
   Y >=: X + 2
end


Hope this helps,
raph
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to