On Fri, 21 Sep 2007 10:43:15 +0200, Guido Tack wrote:
> 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 *) one more thing: I think that reifying with FD.Reified is equivalent to using Modeling.HOLDS, is this true? If true, am I right in thinking that the above is somewhat the same as Modeling.postTrue(space, Modeling.HOLDS(x`=y) `| Modeling.HOLDS(x`=z) ) where x,y and z are terms instead of intvars (types seem correct) ? _______________________________________________ alice-users mailing list [email protected] http://www.ps.uni-sb.de/mailman/listinfo/alice-users
