8.3 Example Constraint Handlers
All example files are in the subdirectory lib/chr of the
installation-directory of ECLiPSe (which can be found using get_flag(installation_directory,Dir).
The files (.chr, .pl, examples)
relevant to a
particular constraint system can be found by looking at all files that
match the pattern given in the following listing with each example
handler. The examples include a color graphic demo about
optimal sender placement for wire-less devices in buildings and
company sites, small constraint handlers for
and larger constraint handlers for
minimum, maximum of and inequalities between terms (*minmax*),
- terms (functor/3, arg/3, =.. as constraints) (*term*),
- lists (similar to Prolog III) (*list*),
- rational trees (*tree*),
- sound if-then-else, negation and checking,
lazy conjunction and disjunction (*control*),
- geometric reasoning about rectangles (*demo*),
CHRs have also been used as a committed choice programming language
on their own (*prime*).
booleans for propositional logic (*bool*),
- finite and infinite domains (inspired by CHIP) (*domain*),
- sets (*set*),
- terminological reasoning (similar to KL-ONE)  (*kl-one*),
- temporal reasoning (over time points and intervals)  (*time*),
- equation solving over real numbers (similar to CLP(R)) or rational numbers (*math*).
The example handlers can be loaded using
instance the finite domain handler can be made available as follows
(the current directory must have write permission so that
the pl file can be created):
[eclipse 1]: lib(chr), chr(lib(domain)).
domain.pl compiled traceable 241028 bytes in 1.22 seconds
[eclipse 2]: X::1..10, X ne 5.
X = X
(4) X_g1165 :: [1, 2, 3, 4, 6, 7, 8, 9, 10]