Abstract
We propose an extension of Constraint Handling Rules (CHR) with aggregates such as sum, count, findall, and min. This new feature significantly improves the conciseness and expressiveness of the language. In this paper, we describe an implementation based on source-to-source transformations to CHR (extended with some low-level compiler directives). We allow user-defined aggregates and nested aggregate expressions over arbitrary guarded conjunctions of constraints. Both an on-demand and an incremental aggregate computation strategy are supported.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
The CHR Home Page. http://www.cs.kuleuven.be/~dtai/projects/CHR/ .
De Koninck, L., Schrijvers, T., Demoen, B.: User-definable rule priorities for CHR. In: 9th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, Wrocław, Poland, July 2007, pp. 25–36 (2007)
Duck, G.J., Stuckey, P.J., de la Banda, M.G., 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)
Frühwirth, T.: Theory and practice of Constraint Handling Rules. Journal of Logic Programming 37(1–3), 95–138 (1998)
Kiczales, G., Lamping, J., Mendhekar, A., Meda, C., Lopes, C., Loingtier, J.-M., Irwing, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
Schrijvers, T., Demoen, B.: The K.U.Leuven CHR system: Implementation and application. In: Selected Contributions, First Workshop on Constraint Handling Rules, (May 2004), http://www.cs.kuleuven.be/~toms/CHR/
Sneyers, J., Schrijvers, T., Demoen, B.: The computational power and complexity of Constraint Handling Rules. In: Second Workshop on Constraint Handling Rules, October 2005, pp. 3–17. Sitges, Spain (2005)
Sneyers, J., Van Weert, P., Schrijvers, T., Demoen, B.: Aggregates in CHR. In: Fourth Workshop on Constraint Handling Rules (2007) (to appear)
Sneyers, J., Van Weert, P., Schrijvers, T., Demoen, B.: Aggregates in CHR. Technical Report CW481, Dept. Computer Science, K.U.Leuven (2007)
ISO/IEC 9075:2003: Information technology – Database languages – SQL
Van Weert, P., Sneyers, J., Schrijvers, T., Demoen, B.: Extending CHR with negation as absence. In: Third Workshop on Constraint Handling Rules, Venice, Italy, pp. 125–139 (2006)
Wielemaker, J.: An overview of the SWI-Prolog programming environment. In: 13th Intl. Workshop on Logic Programming Environments, pp. 1–16. Heverlee, Belgium (2003), http://www.swi-prolog.org
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Van Weert, P., Sneyers, J., Demoen, B. (2008). Aggregates for CHR through Program Transformation. In: King, A. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2007. Lecture Notes in Computer Science, vol 4915. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-78769-3_5
Download citation
DOI: https://doi.org/10.1007/978-3-540-78769-3_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-78768-6
Online ISBN: 978-3-540-78769-3
eBook Packages: Computer ScienceComputer Science (R0)