Node:CHR Constraint Handlers, Next:, Previous:CHR Programming Hints, Up:CHR

Constraint Handlers

The CHR library comes with plenty of constraint handlers written in CHR. The most recent versions of these are maintained at
classical arc-consistency over finite domains
simple Boolean constraints
feature term constraints according to the CFT theory
finite domains over arbitrary ground terms and interval domains over integers and reals, but without arithmetic functions
elegant two-liner for the greatest common divisor
straightforward interval domains over integers and reals, with arithmetic functions
terminological reasoning similar to KL-ONE or feature trees
standard introductory CHR example handler for less-than-or-equal
equality constraints over concatenations of lists (or strings)
a straightforward finite enumeration list domains over integers, similar to
solves linear polynomial equations and inequations using variable elimination, several variations possible
solves linear polynomial equations and inequations by combining variable elimination for equations with Fourier's algorithm for inequations, several variations possible
a straightforward Fouriers algorithm to solve polynomial inequations over the real or rational numbers
a straightforward, elegant implementation of variable elimination for equations in one rule
simple less-than and less-than-or-equal ordering constraints together with minimum and maximum constraints
example of how to use CHR for model generation in theorem proving
classical monkey and banana problem, illustrates how CHR can be used as a fairly efficient production rule system
constraints over order sorted feature terms according to the OSF theory
rational trees with disequality and OZ type constraint with intersection
the most simple example of a handler for path consistency--two rules
elegant implementations of the sieve of Eratosthenes reminiscent of the chemical abstract machine model, also illustrates use of CHR as a general purpose concurrent constraint language
simple classical constraint logic programming scheduling example on building a house
most of Tarski's axiomatization of geometry as constraint system
Prolog term manipulation built-in predicates functor/3, arg/3, =../2 as constraints
grand generic handler for path-consistency over arbitrary constraints, load via to get a powerful solver for temporal constraints based on Meiri's unifying framework. contains a generator for random test problems.
quantitative temporal constraints over time points using path-consistency
equality and disequality over finite and infinite trees (terms)
equalities and type constraints over finite and infinite trees (terms)

You can consult or compile a constraint handler from the CHR library using e.g.:

| ?- [library('chr/examples/gcd')].
| ?- compile(library('chr/examples/gcd')).
If you want to learn more about the handlers, look at their documented source code.

In addition, there are files with example queries for some handlers, their file name starts with examples- and the file extension indicates the handler, e.g. .bool: