ToyCHR compiler 3.1
The toyCHR package contains two different implementations of CHRs.
- toychr.pl -- a simple CHR compiler; and
- toychrdb.pl -- a simple CHR interpreter and trace debugger.
All you ever want to know about CHRs can be found
here.
See also:
- A Haskell implementation of CHRs can be found
here.
Requirements:
- toychr.pl -- Prolog (tested with Sicstus & SWI, but any Prolog should be okay);
- toychrdb.pl -- SWI Prolog.
Limitations:
- toychr.pl -- Cannot extend other constraint solvers, so ground data only.
Note that variables can be used as long as they are immediately bound the
first time the constraint is called.
- toychrdb.pl -- No limitations, fully implements the refined
operational semantics of CHRs.
Includes:
- gcd.chr -- One of the most basic CHR programs, it calculates
the greatest common divisor between two numbers.
- leq.chr -- Classic less-than-or-equal-to solver.
Note only works with toychrdb.pl for non-ground goals.
- ray.chr -- A simple ray tracer implemented in CHRs
(see example image).
Disclaimer: CHRs are not the best programming language for ray
tracing!
Latest release:
Older versions:
Last updated: Wed Oct 20 2004