Kilian Sprotte wrote:

You'll find attached two mozart cp scripts - one finds a solution, the other doesn't. The only difference between the two scripts is A MERE CHANGE IN ORDER of posting the constraints. (I just double checked using the diff -u s1 s2 tool - but check again, if you like)

The problem is due to a bug in the "distinct" propagator. I did the following experiment: declare Root as a global variable, post all the domains and constraints, and browse Root. Then feed the constraints that lead to the solution found by the first script, i.e.,

Root.7=55
Root.8=73
Root.12=40
Root.13=88

In the second script, the last equality provokes the following failure:

%***************************** failure **************************
%**
%** In statement: {<P/0 INTERNAL.propagate>}
%** In statement: {fsp_distinct _{{}..{88 100}}#1 {88}#1}
%**
%** Call Stack:
%**--------------------------------------------------------------

The propagator is a simplification of the propagator posted by {FS.distinctN [ Root.9 Root.10 Root.11]}. The propagator fails to realize that its first variable (Root.9) can be constrained to {100}.

The bug does not appear in the first script probably because of a different scheduling of the propagators. My guess is that the propagator succeeds when all its variables are determined.

Something wrong happens in FSetDistinctPropagator::propagate(). I had a first look, and the rules there seem okay. I am wondering whether an operation on one of the sets is buggy...

I don't have time to look further on this, so anyone can feel free to jump in!

Cheers,
raph

_________________________________________________________________________________
mozart-users mailing list                               
mozart-users@ps.uni-sb.de
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to