Example programs

The CHR releases in Prolog currently include about 40 constraint solvers, many of them novel or with extended functionality over existing implementations. There are handlers for lists, sets, trees, terms, finite ground term and number domains, booleans, linear polynomials over reals and rationals, for incremental path consistency, for terminological, temporal, geometric reasoning as well as for sound negation and conditional control constructs. Moreover, there are examples showing the use of CHR as general purpose concurrent constraint language with ask and tell, as fairly efficient production rule system, and as system combining forward and backward chaining in theorem proving.

You can run these constraint solvers and programs online with the WebCHR Interactive Demo or even write your own CHR programs.

Simple constraint solvers:

Finite and infinite domains:

Solving (linear) polynomial (in-,diss-)equations over real or rational numbers:

Constraint solvers for equations over terms and trees:

Consistency techniques:

Temporal reasoning with consistency techniques:

Classical algorithms:


Subsuming other languages in CHR:


Example files for the above solvers (not necessarily up-to-date)

CHR Mailing List

Subscribe to the CHR mailing list to get announcements of CHR-related events and to discuss about CHR.