next up previous contents
Next: Constraint Handling Rules Up: The Constraint Handling Rules Previous: Example Constraint Handlers

The CHR Language

User-defined constraints are defined by constraint handling rules - and optional ECLiPSe clauses for the built-in labeling feature. The constraints must be declared before they are defined. A CHR program (file extension chr) may also include other declarations, options and arbitrary ECLiPSe clauses.

Program  ::=  Statement [ Program ]
Statement  ::=  Declaration |  Option |  Rule |  Clause

Constraint handling rules involving the same constraint can be scattered across a file as long as they are in the same module and compiled together. For readability declarations and options should precede rules and clauses.

In the following subsections, we introduce constraint handling rules and explain how they work. The next section describes declarations, clauses, options and built-in predicates for CHRs.





Joachim Schimpf
Sun Jul 19 22:34:17 BST 1998