/// <summary>
        /// Creates and returns an integer variable that represents the difference of <paramref name="a"/> and <paramref name="b"/>
        /// </summary>
        public static IntegerVariable Subtract(IntegerVariable a, IntegerVariable b)
        {
            IntegerVariable difference = new IntegerVariable(a.ConstraintThingySolver, null, IntegerVariable.DefaultRange);

            Constraint.InRange(difference, a.AllowableValues - b.AllowableValues);

            Difference(difference, a, b);

            return(difference);
        }
        /// <summary>
        /// Creates and returns an integer variable that represents the sum of <paramref name="a"/> and <paramref name="b"/>
        /// </summary>
        public static IntegerVariable Add(IntegerVariable a, IntegerVariable b)
        {
            IntegerVariable sum = new IntegerVariable(a.ConstraintThingySolver, null, IntegerVariable.DefaultRange);

            Constraint.InRange(sum, a.AllowableValues + b.AllowableValues);

            Sum(sum, a, b);

            return(sum);
        }
 /// <summary>
 /// Constrains <paramref name="variable" /> to be in <paramref name="range"/>
 /// </summary>
 public static void InRange(IntegerVariable variable, IntegerInterval range)
 {
     variable.BackdoorSet(IntegerInterval.Intersection(variable.AllowableValues, range));
 }
 /// <summary>
 /// Constraints <paramref name="variable"/> to be exactly <paramref name="value"/>
 /// </summary>
 public static void Equal(IntegerVariable variable, int value)
 {
     InRange(variable, value, value);
 }
 /// <summary>
 /// Creates and returns an integer variable that represents the difference of <paramref name="a"/> and <paramref name="b"/>
 /// </summary>
 public static void Difference(IntegerVariable difference, IntegerVariable a, IntegerVariable b)
 {
     new IntegerDifferenceConstraint(difference, a, b);
 }
 /// <summary>
 /// Constrains <paramref name="sum"/> to be the sum of <paramref name="a"/> and <paramref name="b"/>
 /// </summary>
 public static void Sum(IntegerVariable sum, IntegerVariable a, IntegerVariable b)
 {
     new IntegerSumConstraint(sum, a, b);
 }
 /// <summary>
 /// Constrains that the values of <paramref name="a"/> and <paramref name="b"/> are not equal.
 /// </summary>
 public static void NotEqual(IntegerVariable a, IntegerVariable b)
 {
     new IntegerInequalityConstraint(a, b);
 }
 /// <summary>
 /// Constrains <paramref name="variable"/> to be at least <paramref name="value"/>
 /// </summary>
 public static void GreaterThanOrEqual(IntegerVariable variable, int value)
 {
     InRange(variable, value, int.MaxValue);
 }
 /// <summary>
 /// Constraints <paramref name="variable"/> to be at most <paramref name="value"/>
 /// </summary>
 public static void LessThanOrEqual(IntegerVariable variable, int value)
 {
     InRange(variable, int.MinValue, value);
 }
 /// <summary>
 /// Constrains <paramref name="variable"/> to be between <paramref name="minValue"/> and <paramref name="maxValue"/>
 /// </summary>
 public static void InRange(IntegerVariable variable, int minValue, int maxValue)
 {
     InRange(variable, new IntegerInterval(minValue, maxValue));
 }