Abstract. Constraint Handling Rules (CHR) is a rule-based language to specify application-oriented constraint solvers. CHR requires a host language that provides the basic constraints used in a CHR program. In this paper, we argue that an integrated functional logic language like Curry is an appropriate host language for CHR since it supports a natural formulation of constraint handling rules and a seamless integration into a typed environment. As a proof of concept, we describe CHR(Curry), an integration of CHR into Curry, together with two implementations. The first is an interpreter of CHR's refined operational semantics implemented in Curry, and the second compiles CHR rules into Prolog which can be directly used in Prolog-based Curry implementations, such as PAKCS.
MotivationFunctional logic languages [4,15] integrate the most important features of functional and logic languages in order to provide a variety of programming concepts. They support functional concepts like higher-order functions and lazy evaluation as well as logic programming concepts like non-deterministic search and computing with partial information. This combination allows better abstractions for application programming and has also led to new design patterns [1,5] as well as better abstractions in application programs such as implementing graphical user interfaces [12] or web frameworks [17]. The declarative multi-paradigm language Curry [11,18] is a modern functional logic language with advanced concepts for application programming [2,3].An important application area of declarative, and in particular, logic programming languages is constraint programming [19,22]. Since logic programming is a subset of functional logic programming, there exist various attempts to extend functional logic languages with constraint solving facilities (see [24] for a survey). For instance, Lux [21] describes an implementation of a solver for real arithmetic constraints for Curry, and the inclusion of finite domain constraints in the functional logic language TOY [20] is described in [9].An alternative to using a fixed set of constraint solvers are Constraint Handling Rules (CHR) [10]. CHR is a declarative language for specifying applicationoriented constraint systems. They are useful for applications that require specific