Constraint Handling Rules as a Library with Delimited Control
BA/MA/ProjectConstraint Handling Rules (CHR) is a declarative, rule-based programming language. Its syntax consists of just three committed-choice multi-set transformation rules and is thus fairly simple. There are implementations and embeddings for many programming languages such as C, Java, Haskell, and JavaScript. However, CHR’s most popular host language remains Prolog. Current implementations of CHR in Prolog rely on Prolog’s implicit execution stack, others use attributed variables. In this project, we want to implement a new compilation scheme to Prolog based on delimited continuations. This takes up the idea of an explicit stack, which is a common optimisation technique when compiling CHR to imperative programming languages. Delimited continuations have already been successfully used to efficiently implement tabling in Prolog – so it might be worth considering them for CHR, too.
- CHR
- compiler construction
- declarative programming
- Prolog