[gecode-users] Why are my variables not constrained

Max chaosangel at gmx.de
Sat Oct 4 14:18:49 CEST 2008


At first, thank you for the answers to my other questions.
As reified constraints seem to be en vogue, i tried them myself:

post(this, x[0] > x[1] + 30);
post(this, x[2] - x[0] == 45);

This constraints my variables to the following
x = {[31..1455], [0..1424], [76..1500], [0..1500]}

Now i want to make the first constraint reified

post(this, eqv((x[0] > x[1] + 30), y));
post(this, x[2] - x[0] == 45);

This constraints my variables to
{[0..1455], [0..1500], [45..1500], [0..1500]} und y= [0..1]
So x[0] and x[1] are less constrained, because y is not decided.
But, if i now post

post(this, eqv((x[0] > x[1] + 30), y));
post(this, x[2] - x[0] == 45);
post(this, y == 1);

I do get the same constraints, so why are x[0-1] not constrained
{[0..1455], [0..1500], [45..1500], [0..1500]} and y= 1



By the way, is there a smarter way to set y (variables in general) ?

Tank you in advance

Max




More information about the gecode-users mailing list