ToyCHR 3.1


HOME TOYCHR
Δ ToyCHR

ToyCHR is a very simple reference implementation of Constraint Handling Rules (CHR) for Prolog using the refined operational semantics. The toyCHR package contains two different CHR interpreters:

  • toychr.pl -- a simple CHR compiler; and
  • toychrdb.pl -- a simple CHR interpreter and trace debugger.
More information about CHR can be found at the CHR Homepage.

Disclaimer: ToyCHR is not a serious CHR implementation. To implement CHR applications in Prolog, please use the K. U. Leuven CHR System.

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 very simple ray tracer implemented in CHRs.

Latest release:


© Copyright 2013, all rights reserved