Embedding of Constraint Handling Rules

Constraint Handling Rules (CHR) is a declarative, rule-based programming language, designed as an extension for any higher-order programming language. Typically, CHR is implemented using some sort of translation process, transforming CHR-code into code of the language, we want to embed it in. As of now, this is either done by using a powerful macro system, as it is provided by Prolog, or using a compiler somewhere in the language's tool chain, as it is Implemented for Java or JavaScript.

We are now exploring a third attempt: implementing CHR as an embedded domain-specific language (EDSL). To this end, we are formalizing the embedding of CHR into a programming language, and develop an adaptable generic scheme on how to implement a CHR system for any given host-language.