// v0 = v1 * v2 public static IntVarExpr operator *(IntVarExpr lhs, int rhs) { IntVarExpr expr = new IntVarExprValMul(lhs.Var0, rhs); expr.AddExpr(lhs); return(expr); }
static void Prop1() { Solver solver = new Solver( -10000, 10000 ); IntVar a = new IntVar( solver, 6, 10, "a" ); IntVar b = new IntVar( solver, 1, 2, "b" ); IntVarExprVal cons = new IntVarExprValMul( a, b, 5 ); solver.Add( cons ); solver.Propagate(); Console.WriteLine(); }