21 Sep 2007 10:43
Re: 2 questions on constraints (x=a or b, FD.gcc arguments)
Guido Tack <tack <at> ps.uni-sb.de>
2007-09-21 08:43:15 GMT
2007-09-21 08:43:15 GMT
gabriele renzi wrote: > 1) is it possible to express a constraint so that an FD.intvar is > bound to > be one of two choices which are themselves FD.intvar's ? > I believe this should be done with FD.gcc4 but I'm not sure if this > is the > right thing. Do you mean a constraint like (x = y) or (x = z)? That's not what gcc is used for, but you can use reified constraints to achieve this: val b1 = FD.boolvar space val b2 = FD.boolvar space val b3 = FD.intvar2boolvar(space, FD.intvar(space, #[(1,1)])) (* b3 = true *) val _ = FD.disj(space, b1, b2, b3) (* b1 or b2 = b3 *) val _ = FD.Reified.rel(space, x, FD.eq, y, b1) (* x == y <=> b1 *) val _ = FD.Reified.rel(space, x, FD.eq, z, b2) (* x == z <=> b2 *) > 2) about gcc*: what is the meaning of all the paramaters in the > various FD.gcc ? > [s,x,min,max,level] are clear from the description, but > [v,c,m,ulow,uup,all] are not so obvious, in my humble opinion. You're right, they are not obvious at all, and the documentation for gcc practically doesn't exist. In fact, we realized that this interface doesn't work as expected for some cases, and -(Continue reading)
RSS Feed