# ConstraintSystem Class

**Solver Foundation 3.0**

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Defines how to create and solve models.

**Namespace:**Microsoft.SolverFoundation.Solvers

**Assembly:**Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

The ConstraintSystem type exposes the following members.

Name | Description | |
---|---|---|

AbortDomainNarrowing | Returns a value that indicates whether the solver is being requested to stop or has already stopped. | |

BacktrackCount | Gets the number of backtracks during a search. | |

Constraints | Gets the collection of constraint functions added to a solver. | |

DefaultBoolean | Gets a Boolean domain that contains 0 (false) and 1 (true). | |

DefaultInterval | Gets a domain that represents the minimum to maximum finite values supported by a solver. | |

Empty | Gets a domain with the empty set. | |

False | Gets the Boolean CspTerm {false}. | |

GoalCount | Gets the number of minimization goals. | |

IsEmpty | Returns a value that indicates whether a model in a solver is empty. | |

IsInterrupted | Returns a value that indicates whether the last solve operation was interrupted. | |

MaxFinite | Gets the maximum integer value for the CSP solver. | |

MinFinite | Gets the minimum integer value for a CSP solver. | |

MinimizationGoals | Gets the collection of constraint functions that have been added to a solver. | |

Mode | Gets or sets the debug mode for a solver. | |

Parameters | Gets a set of parameters with default values and a callback function to query about cancelling the solve process. | |

Precision | Gets the global precision setting for real values in a solver. | |

QueryAbort | A function that is called periodically through the computation to determine if the user has cancelled the operation. | |

True | Gets the Boolean CspTerm {true}. | |

Variables | Gets the collection of variables that have been instantiated for a solver. | |

Version | Gets the version of a solver. |

Name | Description | |
---|---|---|

Abs | Computes the absolute value. | |

AddConstraints | Returns a value that indicates whether all constraint functions added to a model are valid. | |

And | Performs a Boolean AND operation. | |

AtMostMofN | Tests that at most M inputs are true. | |

Constant(Double) | Gets a term for the immutable real value k with double precision. | |

Constant(Int32) | Gets a term for the immutable value k. | |

Constant(Int32, Double) | Gets a term for the immutable real value k. | |

Constant(CspDomain, String) | Gets a term for the immutable symbol value k. | |

CreateBoolean() | Creates a Boolean variable with an auto-generated key. | |

CreateBoolean(Object) | Creates a Boolean variable with a true or false initial value. | |

CreateBooleanArray | Creates a two-level array of Boolean variable terms in a domain. | |

CreateBooleanVector | Creates a vector of Boolean variable terms in a domain. | |

CreateComposite() | Creates an empty composite with an auto-generated key. | |

CreateComposite(Object) | Creates an empty composite that can have fields added. | |

CreateDecimalInterval | Creates a domain of a real interval with double precision. | |

CreateDecimalSet(Double[]) | Creates a domain of allowed real values with default precision in strictly ascending order. | |

CreateDecimalSet(Double[], Int32, Int32) | Creates a domain of allowed real values with default precision in strictly descending order. | |

CreateIntegerInterval | Creates an integer domain. | |

CreateIntegerSet(Int32[]) | Creates a domain of allowed integer values in strictly ascending order. | |

CreateIntegerSet(Int32[], Int32, Int32) | Create a domain of allowed integer values in strictly descending order. | |

CreateSolver() | Creates an instance of a solver. | |

CreateSolver(ISolverEnvironment) | Creates an instance of a solver. | |

CreateSolver(Func<TResult>, Void, Boolean) | Creates an instance of the solver. | |

CreateSymbolSet | Creates a domain of symbols. | |

CreateVariable(CspComposite) | Creates a composite variable with an auto-generated key. | |

CreateVariable(CspDomain) | Creates a finite variable with a given domain and auto-generated key. | |

CreateVariable(CspComposite, Object) | Creates a composite variable with the specified domain and key. | |

CreateVariable(CspDomain, Object) | Creates a finite variable with the specified domain and key. | |

CreateVariableArray | Creates a two-level array of finite variable terms in a domain. | |

CreateVariableVector(CspComposite, Object, Int32) | Creates a vector of finite variable terms in a composite domain. | |

CreateVariableVector(CspDomain, Object, Int32) | Creates a vector of finite variable terms in a domain. | |

Equal(CspTerm[]) | Tests if all inputs are equal. | |

Equal(Int32, CspTerm[]) | Tests if all inputs are equal to a constant. | |

Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |

ExactlyMofN | Tests if exactly M of the inputs are true. | |

FilteredSum | Adds the conditional inputs. | |

Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |

GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |

GetReport | Generate a report. | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

Greater(CspTerm[]) | Returns a value that indicates whether each input is greater than the following input. | |

Greater(Int32, CspTerm[]) | Returns a value that indicates whether a constant is greater than each input. | |

GreaterEqual(CspTerm[]) | Returns a value that indicates whether each input is greater than or equal to the following input. | |

GreaterEqual(Int32, CspTerm[]) | Returns a value that indicates whether a constant is greater than or equal to the input. | |

Implies | Tests for logical implication between two inputs. | |

Index(CspTerm[], CspTerm) | Returns the value of the inputs[index]. | |

Index(CspTerm[], CspTerm[]) | Returns the input value selected by the keys. | |

Index(CspTerm[], CspTerm, CspDomain) | Returns the value of the inputs[index]. | |

Index(CspTerm[], CspTerm[], CspDomain[]) | Returns the value of the input selected by the keys. | |

Index(CspTerm[][], CspTerm, CspTerm) | Returns the value of the inputs[row][column]. | |

Index(CspTerm[][], CspTerm, Int32) | Returns the value of the inputs[row][column]. | |

Index(CspTerm[][], Int32, CspTerm) | Returns the value of the inputs[row][column]. | |

Index(CspTerm[][], CspTerm, CspTerm, CspDomain, CspDomain) | Returns the value of the [row][column] input. | |

IsElementOf | Returns a value that indicates if an input is a member of a domain. | |

Less(CspTerm[]) | Returns a value that indicates if an input is less than the following input. | |

Less(Int32, CspTerm[]) | Returns a value that indicates if an input is less than a constant. | |

LessEqual(CspTerm[]) | Returns a value that indicates if an input is less than or equal to the following input. | |

LessEqual(Int32, CspTerm[]) | Returns a value that indicates if an input is less than or equal to a constant. | |

Max | Returns the maximum of the inputs. | |

MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |

Min | Returns the minimum of the inputs. | |

Neg | Negates the input. | |

Not | Performs the Boolean inverse of the input. | |

Or | Performs the Boolean OR of the inputs. | |

Power | Raises an input to the power of a specified value. | |

Product | Returns the product of the inputs. | |

RemoveAllMinimizationGoals | ||

RemoveConstraints | ||

ResetSolver | Resets the solver state. | |

Save | Writes the report. | |

Shutdown | Shuts down the instance of a ConstraintSystem object. | |

Solve() | Solves a model by using the default solver parameters. | |

Solve(ISolverParameters) | Solves a model by using the given solver parameters. | |

Sum | Adds the inputs. | |

SumProduct | Performs the sum of the pairwise-product of the inputs. | |

TableDecimal | Creates a relation constraint by using the column variables and inputs. | |

TableDomain(CspTerm[], CspDomain[][]) | Creates a relation constraint by using the column variables and inputs. | |

TableDomain(CspTerm[], IEnumerable<IEnumerable<CspDomain>>) | Creates a relation constraint by using the column variables and inputs. | |

TableInteger | Creates a relation constraint by using the column variables and inputs. | |

TableSymbol | Creates a relation constraint by using the column variables and inputs. | |

TableTerm(CspTerm[], CspTerm[][]) | Creates a relation constraint by using the column variables and inputs. | |

TableTerm(CspTerm[], IEnumerable<IEnumerable<CspTerm>>) | Creates a relation constraint by using the column variables and inputs. | |

ToString | Returns a string that represents the current object. (Inherited from Object.) | |

TryAddMinimizationGoals | Returns a value that indicates whether terms were minimized successfully by the solver. | |

TryGetVariableFromKey | Returns a value that indicates whether a variable is retrieved by its key. | |

Unequal(CspTerm[]) | Returns a value that indicates if every pairing of the inputs is unequal. | |

Unequal(Int32, CspTerm[]) | Returns a value that indicates if every input is unequal to a constant. |

Name | Description | |
---|---|---|

Cardinality | Counts the number of elements in a set variable. (Defined by CspSetOperators.) | |

Concatenation | Concatenates two input list variables. (Defined by CspListOperators.) | |

ConstantDecimalList | Creates a constant decimal list. (Defined by CspListOperators.) | |

ConstantDecimalSet | Creates a constant decimal set. (Defined by CspSetOperators.) | |

ConstantIntegerList | Creates a constant integer list. (Defined by CspListOperators.) | |

ConstantIntegerSet | Creates a constant integer set. (Defined by CspSetOperators.) | |

ConstantSymbolList | Creates a constant symbol list. (Defined by CspListOperators.) | |

ConstantSymbolSet | Creates a constant symbol set. (Defined by CspSetOperators.) | |

CreatePowerList | Creates a power list to use as the domain for baseline. (Defined by CspListOperators.) | |

CreatePowerSet | Creates a power set to use as the domain for baseline. (Defined by CspSetOperators.) | |

Difference | Computes the difference between two sets. (Defined by CspSetOperators.) | |

ElementAt | Creates a term that indicates whether the value of listVar[index] is equal to elementToBe. (Defined by CspListOperators.) | |

ElementCount | Counts the frequency of an element in a list. (Defined by CspListOperators.) | |

FirstOccurrence | Creates a term that indicates whether the first occurrence of element in listVar is equal to indexToBe. (Defined by CspListOperators.) | |

Intersection | Computes the intersection between two sets. (Defined by CspSetOperators.) | |

LastOccurrence | Creates a term that indicates whether the last occurrence of element in listVar is equal to indexToBe. (Defined by CspListOperators.) | |

Length | Measures the length of a list variable. (Defined by CspListOperators.) | |

ListEqual(Int32[], CspTerm) | Overloaded. Creates a term that indicates whether a list is equal to a list variable. (Defined by CspListOperators.) | |

ListEqual(CspTerm, CspTerm) | Overloaded. Creates a term that indicates whether two list variables are equal. (Defined by CspListOperators.) | |

ListEqual(CspTerm, Int32[]) | Overloaded. Creates a term that indicates whether a list variable is equal to a list. (Defined by CspListOperators.) | |

MemberOf(Int32, CspTerm) | Overloaded. Creates a term that indicates whether a value is a member of a set variable. (Defined by CspSetOperators.) | |

MemberOf(CspTerm, CspTerm) | Overloaded. Creates a term that indicates whether a value is a member of a set variable. (Defined by CspSetOperators.) | |

MemberOf(CspTerm, Int32[]) | Overloaded. Creates a term that indicates whether a value is a member of a set. (Defined by CspSetOperators.) | |

SetEqual(Int32[], CspTerm) | Overloaded. Creates a term that indicates whether a set is equal to a set variable. (Defined by CspSetOperators.) | |

SetEqual(CspTerm, CspTerm) | Overloaded. Creates a term that indicates whether two set variables are equal. (Defined by CspSetOperators.) | |

SetEqual(CspTerm, Int32[]) | Overloaded. Creates a term that indicates whether a set variable is equal to a set. (Defined by CspSetOperators.) | |

SublistEq(Int32[], CspTerm) | Overloaded. Creates a term that indicates if a list if a subset of a list variable. (Defined by CspListOperators.) | |

SublistEq(CspTerm, CspTerm) | Overloaded. Creates a term that indicates if a list variable is a subset of another list variable. (Defined by CspListOperators.) | |

SublistEq(CspTerm, Int32[]) | Overloaded. Creates a term that indicates if a list variable is a subset of another list. (Defined by CspListOperators.) | |

SubsetEq(Int32[], CspTerm) | Overloaded. Creates a term that indicates if a set if a subset of a set variable. (Defined by CspSetOperators.) | |

SubsetEq(CspTerm, CspTerm) | Overloaded. Creates a term that indicates if a set variable is a subset of another set variable. (Defined by CspSetOperators.) | |

SubsetEq(CspTerm, Int32[]) | Overloaded. Creates a term that indicates if a set variable is a subset of another set. (Defined by CspSetOperators.) | |

Union | Creates a term that represents the union of two sets. (Defined by CspSetOperators.) |

Show: