Hi, 2013/6/6 Pascal Francq (Mailing lists) <mailing-l...@francq.info>
> Hi, > I have a question regarding how to avoid some combinations of variables > to test. I give here a simple example: > 1. I have four IntVar a,b,c and d. > Gecode-matters aside I think that this > 2. I want to allow a=2*b=2*c only if a==1 and d==0. > If have try to encode this constraint with a code that looks like: > BoolVar tmp; > doesn't say the same as this: > tmp=expr(home,(a!=1)&&(a==2*b)&&(a==2*c)&&(d==0)); > rel(home,!tmp); > If I understand your 2. correctly it says: neg (a = 2*b /\ a = 2*c /\ (a != 1 \/ d != 0)) Hence I think tmp should be something like expr(home,(a==2*b)&&(a==2*c)&&((a!=1)||(d!=0)) HTH Conrad > But it seems that it does not try the only combination allowed. > Is this the correct way ? > Thanks. > -- > Dr. Pascal Francq > Belgium > > _______________________________________________ > Gecode users mailing list > users@gecode.org > https://www.gecode.org/mailman/listinfo/gecode-users >
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users