While conceptually simple, CHR is distinguished by a remarkable combination of desirable features:
- a semantic foundation in classical and linear logic,
- an efficient sequential and parallel execution model,
- guaranteed properties like the anytime online algorithm properties,
- powerful analysis methods for deciding essential program properties.
For example, the following rule computes prime numbers:
prime(X) \ prime(Y) <=> Y mod X == 0 | true.
It takes two prime candidates
Y and removes
Y if the number is a multiple of
X. Given the integers from
n, then after exhaustive application of the rule, only prime numbers up to
n remain in the end.
This example and others can be tried online, e.g. at http://chrjs.net/playground (choose example "primes" in the Playground pull-down menu).
Implementations and free downloads of CHR
For a quick overview of CHR, look at the slides of the CHR keynote talk at RuleML 2015: http://www.informatik.uni-ulm.de/pm/mitarbeiter/fruehwirth/drafts/CHR-ruleml-keynote-online-2015r.pdf
For more information, you may start at the CHR book webpage: http://constraint-handling-rules.org/
In 2016, the annual CHR workshop will take place as special track of the #RuleML2016 conference: http://2016.ruleml.org/calls/constraint-handling-rules-track
So, submit and see you,