IBM ILOG Solver User's Manual > Extending the Library > Writing a Constraint: Allocating Frequencies > Understanding constraints

As indicated in other chapters, Solver offers a wide range of predefined constraints, together with powerful logical operators for combining them. These facilities usually suffice for expressing even the most specific constraints.

However, when Solver treats a group of heterogeneous constraints together as a set, it still must deal with each of them locally. One way to offset this "localness" about the way constraints are treated is to use redundant constraints. See "Introduce redundant constraints". Another--more radical approach--is to write a new constraint. This alternative may at times be somewhat more difficult.

When you write a new constraint linking certain variables, you must implement reductions of the domains of these variables by eliminating any values that could not participate in a solution. These reductions are carried out by means of elementary modifiers on the domains of these variables.

This chapter explains what you must do if you decide to implement a new constraint. This section firsts explain the elementary modifiers involved, and then discusses the reduction function itself. Reductions happen according to the type of modification that occurs in the domain of a variable. A complete example of how to write a new constraint is provided. See "Writing your own constraint". "Writing your own metaconstraint" explains how to write metaconstraints, constraints that can be imposed on other constraints.