Memory Reuse for CHR

  • Jon Sneyers
  • Tom Schrijvers
  • Bart Demoen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4079)


Two Constraint Handling Rules compiler optimizations that drastically reduce the memory footprint of CHR programs are introduced. The reduction is the result of reusing suspension terms, the internal CHR constraint representation, and avoiding the overhead of constraint removal followed by insertion. The optimizations are defined formally and their correctness is proved. Both optimizations were implemented in the K.U.Leuven CHR system. Significant memory savings and speedups were measured on classical and well-known benchmarks.


Operational Semantic Garbage Collection Cache Size Propagation History Execution State 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
    Demoen, B.: The hProlog home page,
  3. 3.
    Duck, G.J., Stuckey, P.J., García de la Banda, M., Holzbaur, C.: The Refined Operational Semantics of Constraint Handling Rules. In: Demoen, B., Lifschitz, V. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 90–104. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  4. 4.
    Frühwirth, T.: Theory and practice of Constraint Handling Rules. Journal of Logic Programming 37(1–3), 95–138 (1998)MATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Holzbaur, C., Frühwirth, T.: Compiling constraint handling rules into Prolog with attributed variables. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 117–133. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  6. 6.
    Mazur, N.: Compile-time Garbage Collection for the Declarative Language Mercury. PhD thesis, K.U.Leuven, Leuven, Belgium (May 2004)Google Scholar
  7. 7.
    Mazur, N., Ross, P., Janssens, G., Bruynooghe, M.: Practical Aspects for a Working Compile Time Garbage Collection System for Mercury. In: Codognet, P. (ed.) ICLP 2001. LNCS, vol. 2237, p. 105. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  8. 8.
    Schrijvers, T.: Analyses, Optimizations and Extensions of Constraint Handling Rules. PhD thesis, K.U.Leuven, Leuven, Belgium (June 2005)Google Scholar
  9. 9.
    Schrijvers, T., Stuckey, P., Duck, G.: Abstract Interpretation for Constraint Handling Rules. In: Proceedings of the 7th Intl. Conference on Principles and Practice of Declarative Programming (PPDP 2005), Lisbon, Portugal (July 2005)Google Scholar
  10. 10.
    Sneyers, J., Schrijvers, T., Demoen, B.: The computational power and complexity of Constraint Handling Rules. In: Proc. 2nd Workshop on Constraint Handling Rules (CHR 2005), Sitges, Spain, pp. 3–17 (October 2005)Google Scholar
  11. 11.
    Sneyers, J., Schrijvers, T., Demoen, B.: Suspension optimization and in-place updates for optimizing CHR compilation. Technical Report CW 433, K.U.Leuven, Dept. CS (December 2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Jon Sneyers
    • 1
  • Tom Schrijvers
    • 1
  • Bart Demoen
    • 1
  1. 1.Dept. of Computer ScienceK.U. LeuvenBelgium

Personalised recommendations