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 |
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.