2.2.1 An Implementation

In real-interval constraints [Ben95] a variable denotes a real number r. The constraint approximates r by a lower bound and a upper bound, i. e. l \le r \le u. The bounds are represented as floating point numbers. A floating point number itself is an approximation of a real number due to the limited precision of its machine representation. The implementation of real-interval constraints has to take care to not prune valid solutions by computing the bounds too tight. This has to be avoided by controlling the direction of rounding of the floating point operations.

The width of a real-interval is the difference between its upper bound and its lower bound. If the width of a real-interval constraint is less than or equal to a given precision then the constraint is regarded a value.

The goal of this section is to give an overview of how the CPI classes interact with each other and not to describe the implementation of a complete constraint system in too much detail. The definition of all required classes is only sketched and additionally, a simple propagator is implemented.

Note that floating point numbers have the type ri_float which is compatible with float numbers used by the Oz runtime system. Such float numbers may range from RI_FLOAT_MIN to RI_FLOAT_MAX.

Tobias Müller
Version 1.4.0 (20080702)