next up previous contents
Next: Options Up: More on the CHR Previous: Declarations

ECLiPSe Clauses

A constraint handler program may also include arbitrary ECLiPSe code (written with the four operators :- /[1,2] and ?- /[1,2]).

Clause  ::=  Head :- Body.
 ::=  Head ?- Body.
 ::=  :- Body.
 ::=  ?- Body.

Note that :-/1 and ?-/1 behave different from each other in CHR programs. Clauses starting with :- are copied into the pl file by the CHR compiler, clauses with ?- are executed by the compiler. As the op declaration needs both copying and execution, we have introduced the special operator declaration (see previous subsection on declarations). A "Head" can be a "Constraint", such clauses are used for built-in labeling only (see section on labeling).



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