7 CHR: Constraint Handling Rules

This chapter is written by Tom Schrijvers, K.U. Leuven, and adjustments by Jan Wielemaker.

The CHR system of SWI-Prolog is the K.U.Leuven CHR system. The runtime environment is written by Christian Holzbaur and Tom Schrijvers while the compiler is written by Tom Schrijvers. Both are integrated with SWI-Prolog and licensed under compatible conditions with permission from the authors.

The main reference for the K.U.Leuven CHR system is:

On the K.U.Leuven CHR website (http://www.cs.kuleuven.be/\~{}toms/CHR/) you can find more related papers, references and example programs.


Section Index


7.1 Introduction
7.2 Syntax and Semantics
7.2.1 Syntax
7.2.2 Semantics
7.3 CHR in SWI-Prolog Programs
7.3.1 Embedding in Prolog Programs
7.3.2 Constraint declaration
7.3.3 Compilation
7.4 Debugging
7.4.1 Ports
7.4.2 Tracing
7.4.3 CHR Debugging Predicates
7.5 Examples
7.6 Backwards Compatibility
7.6.1 The Old SICStus CHR implemenation
7.6.2 The Old ECLiPSe CHR implemenation
7.7 Programming Tips and Tricks
7.8 Compiler Errors and Warnings
7.8.1 CHR Compiler Errors