[gecode-users] Reified Constraints do not propagate
Max Ostrowski
ostrowsk at cs.uni-potsdam.de
Tue Apr 10 11:20:37 CEST 2012
I have a small example where i do not understand why no propagation
takes place.
test is a pointer to the space instance
x_ is an array of 10 IntVars(0,10)
b_ is an array of 2 BoolVars(0,1)
LinRel rel1(test->x_[0],IRT_EQ,5);
rel1.post(*test,true,ICL_DEF);
Gecode::distinct(*test,test->x_,ICL_DEF);
LinRel rel2(test->x_[1],IRT_EQ,5);
Gecode::rel(*test, rel2 == test->b_[1],ICL_DEF);
test->status();
if (test->failed())
std::cout << "Failed" << std::endl;
std::cout << test->x_ << std::endl;
std::cout << test->b_ << std::endl;
So i post das one of my elements x_[0] is 5, and all elements are distinct.
Now i have a reified constraint that x_[1] == 5.
The distinct constraint removes 5 from he domain of x_[1],
but the propagator does not fire.
The result is:
{5, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10},
{0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}, {0..4,6..10}}
{[0..1], [0..1]}
Even with ICL_DOM the boolean variable is not touched if values are
removed from the domain.
Also i think this could be easily done with "Advisors" ?
I have no experience with this, so my question:
Is this behavior the desired one?
Can this be changed if i have reifications like mine where i compare to
constants?
Thanks a lot,
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20120410/72a459f4/attachment.htm>
More information about the users
mailing list