* @param OFFSET 0 by default but typically 1 if used within MiniZinc
* (which counts from 1 to n instead of from 0 to n-1)
*/
public static Constraint boolean_channeling(BoolVar[] BVARS, IntVar VAR, int OFFSET) {
if (VAR.hasEnumeratedDomain()) {
return new Constraint("DomainChanneling", new PropEnumDomainChanneling(BVARS, VAR, OFFSET));
} else {
IntVar enumV = VF.enumerated(VAR.getName() + "_enumImage", VAR.getLB(), VAR.getUB(), VAR.getSolver());
return new Constraint("BoolChanneling",
new PropEnumDomainChanneling(BVARS, enumV, OFFSET),
new PropEqualX_Y(VAR, enumV)
);
}
}