[ library(ech) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

constraints(+SpecList)

Directive for declaring SpecList to be CHR constraints
SpecList
Sequence of the form Atom/Integer

Description

Declares the predicates specified in SpecList as CHR constraints. This allows the predicate to appear in the head of a CHR rule.

Note that a predicate declared as a CHR constraint should not appear as a normal ECLiPSe predicate. Any such definition of the predicate in the user's program would be replaced by the CHR definition.

Examples

   :- constraints leq/2.
   :- op(700, xfx, leq).

   X leq Y <=> \+nonground(X), \+nonground(Y) | X @=< Y.
   X leq X <=> true.