What are constraint handling rules and why fuss about them?

Constraint handling rules are a language for describing constraint solvers and other programs that involve rewriting rules over terms.

The CHR is it's own independent logic programming language but the excitement about them is still best understood in the context of Prolog programming language.

Constraint programming in prolog require use of attributed variables, coroutining, cuts. These features can be considered extralogical because most of them are not originating from the concept that the computation in prolog is deduction. Programs taking heavy utilization of these features can become difficult to analyse for this movement away from the foundation of logic programming.

CHR conveys some of the usecases of Prolog's extralogical features, yet results in programs that are easier to understand and analyse. We are talking about an user interface improvement for a large pile of algorithms.

The best tutorial I found for getting your feet wet with CHR is the tutorial slides by Tom Schrijvers.

Similar posts