Previous Up Next

9.3  IC as a solver for real variables

The IC solver is a hybrid solver which supports both real and integer variables.
See Chapter 8 for an introduction to IC and how to use it with integer variables.
See the IC chapter in the Constraint Library Manual for a full list of the arithmetic operators which are available for use in IC constraint expressions.

  • Real variables may be declared using reals/1, $::/2, ::/2 (specifying non-integer bounds) or just by using them in an IC constraint
  • Basic constraints available for real variables are $=/2, $>=/2, $=</2, $>/2, $</2 and $\=/2 as well as their reified versions and the reified connectives
  • Real constraints also work with integer variables and a mix of integer and real variables
  • Solutions to real constraints can be found using locate/2, locate/3, locate/4 or squash/3

Figure 9.3: Real variables and constraints

IC's real constraints perform bounds propagation in the same way as the integer versions; indeed, most of the basic integer constraints are transformed into their real counterparts, plus a declaration of the integrality of the variables appearing in the constraint.

Note that the interval reasoning performed to propagate real bounds is the same as that used for bounded reals; that is, the inferences made are safe, taking into account potential floating point errors.

Previous Up Next