System Summary
The K.U.Leuven CHR system is a competitive Constraint Handling Rules system for Prolog. It is currently available in seven different Prolog systems:
- hProlog
- SWI-Prolog
- XSB
- YAP
- B-Prolog
- SICStus
- Ciao Prolog
- Overview slides of the K.U.Leuven CHR research
The K.U.Leuven CHR Team

From left to right: Jon Sneyers, Peter Van Weert, Leslie De Koninck, Bart Demoen and Tom Schrijvers
News & Events
- There's a new K.U.Leuven CHR team logo by Jon Sneyers:
- The CHR 2007 workshop will be held at the occasion of ICLP 2007 in Porto. Be sure to look out for the three accepted K.U.Leuven CHR papers.
- Paolo Tacchella, Ph.D. student of the university of Bologna, is visiting, March 12-16, 2007
- 99 Bottles of beer on the wall, in CHR.
- ALP newsletter feature article: The K.U.Leuven CHR System, August 2006. [pdf]
- CHR in SWI-Prolog has practical applications: Blocktime tennis scheduling application, version 4 released on July 12, 2006.
- Profile: CHR at Leuven, Bart Demoen, CP newsletter volume 2 number 2, July 2006
- The CHR 2006 workshop, July 9, 2006
- Seminar Day on Constraint Handling Rules, May 10, 2006
- The CHR 2005 workshop, October 5, 2005
- "Analyses, Optimizations and Extensions of Constraint Handling Rules", Ph.D. Defense Tom Schrijvers, June 10, 2005
Related Publications
Please contact Tom Schrijvers for a copy of any of the papers that you cannot find.- B. Demoen, Dynamic attributes, their hProlog implementation, and a first evaluation, Department of Computer Science, K.U.Leuven, Report CW 350, Leuven, Belgium, October, 2002 [paper]
- T. Schrijvers, D. Warren, and B. Demoen, CHR for XSB, Proceedings of CICLOPS 2003: Colloquium on Implementation of Constraint and LOgic Programming Systems (Lopes, R. and Ferreira, M., eds.), pp. 7-20, 2003 [proceedings]
- T. Schrijvers and B. Demoen, The K.U.Leuven CHR system: implementation and application, Proceedings of the First Workshop on Constraint Handling Rules: Selected Contributions, Ulm, Germany (Thom Frühwirth and Marc Meister eds.), May 2004 [proceedings, slides]
- T. Schrijvers and D. Warren, Constraint handling rules and tabled execution, Proceedings of The 20th International Conference on Logic Programming, St.-Malo, France (Demoen, B. and Lifschitz, V., eds.), September 2004. Winner of Best Technical Paper Award. [paper © Springer Verlag]
- T. Schrijvers, JmmSolve: A generative Java Memory Model implemented in Prolog and CHR, Poster Presenation, Proceedings of The 20th International Conference on Logic Programming, St.-Malo, France (Demoen, B. and Lifschitz, V., eds.), September 2004.
- T. Schrijvers and B. Demoen, Antimonotony-based Delay Avoidance for CHR, K.U.Leuven, Department of Computer Science, Report CW 385, July, 2004. [report]
- T. Schrijvers and T. Frühwirth, Implementing and Analysing Union-Find in CHR , K.U.Leuven, Department of Computer Science, Report CW 389, July, 2004. [report, online appendix]
- J. Sneyers, T. Schrijvers and B. Demoen, Guard Simplification in CHR programs, 9th Workshop on (Constraint) Logic Programming, Ulm, February, 2005. [paper, slides,techreport]
- T. Schrijvers and T. Frühwirth, Analysing the CHR Implementation of Union-Find, 9th Workshop on (Constraint) Logic Programming, Ulm, February, 2005. [paper, slides]
- T. Schrijvers, J. Wielemaker and B. Demoen, Constraint Handling Rules for SWI-Prolog, 9th Workshop on (Constraint) Logic Programming, Ulm, February, 2005. Abstract Only. [abstract, slides]
- T. Schrijvers, B. Demoen, G. J. Duck, P. J. Stuckey and T. Frühwirth, Automatic implication checking for CHR constraint solvers, K.U.Leuven, Department of Computer Science, Report CW 402, January, 2005. [report]
- T. Schrijvers, B. Demoen, G. Duck, P. Stuckey, and T. Frühwirth, Automatic implication checking for CHR constraints, Proceedings of 6th International Workshop on Rule-Based Programming, Nara, Japan, April, 2005. [info]
- T. Schrijvers. Analyses, Optimizations and Extensions of Constraint Handling Rules, Ph.D. Thesis. K.U.Leuven, Leuven, Belgium. June 2005. [pdf]
- T. Schrijvers, Peter J. Stuckey, G. J. Duck. Abstract Interpretation for Constraint Handling Rules, PPDP'05, July 2005. [info,techreport]
- J. Sneyers, T. Schrijvers, B. Demoen. Guard and Continuation Optimization for Occurrence Representations of CHR, ICLP 2005, October 2005.
- T. Schrijvers. Analyses, Optimizations and Extensions of Constraint Handling Rules: Ph.D. Summary, ICLP 2005, October 2005.
- J. Sneyers, T. Schrijvers, B. Demoen. The Computational Power and Complexity of Constraint Handling Rules, CHR 2005, October 2005.
- G. J. Duck, T. Schrijvers. Accurate Functional Dependency Analysis for Constraint Handling Rules, CHR 2005, October 2005.
- P. Van Weert, T. Schrijvers, B. Demoen. K.U.Leuven JCHR: a User-Friendly, Flexible and Efficient CHR System for Java, CHR 2005, October 2005.
- T. Schrijvers, M. Bruynooghe. Towards Constraint-based Type Inference with Polymorphic Recursion for Functional and Logic Programs, IFL 2005, September 2005. SWI-Prolog source code for type inference of:
- T. Schrijvers, Thom Frühwirth. Optimal Union-Find in Constraint Handling Rules, Theory and Practice of Logic Programming, issue 6 (1&2), 2006. [article]
- J. Sneyers, T. Schrijvers, B. Demoen, Dijkstra's Algorithm with Fibonacci Heaps: An Executable Description in CHR, WLP 2006. [techreport]
- L. De Koninck, T. Schrijvers, B. Demoen, INCLP(R) - Interval-based Nonlinear Constraint Logic Programming over the Reals, WLP 2006. [webpage]
-
T. Schrijvers, M. Bruynooghe.
Polymorphic Algebraic Data Type Reconstruction,
PPDP 2006.
AMTypRe prototype (SWI-Prolog source code for type inference + ADT reconstruction of)
- ΛK+, λ-calculus with function definitions and ADTs (coming soon)
- Prolog/Mercury (coming soon)
- J. Sneyers, T. Schrijvers, B. Demoen, Memory reuse for CHR, ICLP 2006.
- P. Van Weert, J. Sneyers, T. Schrijvers, B. Demoen, CHR¬: Constraint Handling Rules with Negation, CHR 2006. [techreport]
- L. De Koninck, T. Schrijvers, B. Demoen, Flexible Search Strategies in CHR for Prolog, CHR 2006. [techreport]
- T. Schrijvers, N.-F. Zhou, B. Demoen, Translating Constraint Handling Rules into Action Rules, CHR 2006. [techreport]
- L. De Koninck, T. Schrijvers, and B. Demoen, CHRrp: Constraint Handling Rules with Rule Priorities, PPDP 2007. [techreport]
- L. De Koninck, T. Schrijvers, and B. Demoen, The Correspondence Between the Logical Algorithms Language and CHR, ICLP 2007. [techreport]
Benchmarks
Here are CHR programs of various origin that can be used as benchmarks.
| Benchmark | Description | Source/Author |
|---|---|---|
| dijkstra_chr.tar.gz | several variants of Dijkstra's shortest path algorithm | J. Sneyers |
| bool.chr | N digit binary addition | WebCHR, T. Schrijvers |
| bool_chain.chr | Cycle of and constraints over N variables | bool.chr, J. Sneyers |
| fib.chr | N first Fibonacci numbers | WebCHR |
| fibonacci.chr | more efficient version of fib.chr | B. Demoen, T. Schrijvers |
| inference.chr | type inference with polymorphic recursion | T. Schrijvers |
| leq.chr | circular chain of N smaller-than-or-equal variables | WebCHR |
| primes.chr | prime numbers up to N | WebCHR |
| ram_simul.chr | RAM machine simulator | J. Sneyers, T. Schrijvers |
| sudoku.chr | Sudoku puzzle solver | T. Frühwirth |
| ta.chr | clock bounds in timed automaton | T. Schrijvers |
| union-find.chr | union-by-rank with path compression | T. Frühwirth, T. Schrijvers |
| wfs.chr | well-founded semantics of 3-valued logic program | T. Schrijvers |
| zebra.chr | classic zebra puzzle with finite domain solver | Pieter Valcke, T. Schrijvers |
These benchmarks are useful to compare CHR performance to Prolog:
| Benchmark | Description | Source/Author |
|---|---|---|
| cprimes.chr | list of primes in N first integers | WebCHR, J. Sneyers |
| dfsearch.chr | depth first search in tree | J. Sneyers |
| nrev.chr | naive reverse | J. Sneyers |
| sum.chr | sum of integer list | J. Sneyers |
| tak.chr | Takeuchi function | J. Sneyers |
CHR and Tabling
Here is a CHR program that would benefit from tabling: Truckload| Benchmark | Description | Source/Author |
|---|---|---|
| truckload.chr | shipment problem | T. Schrijvers |
Contact Information
If you want more info, contact:- T. Schrijvers [home page]