Title
Aggregates in constraint handling rules
Abstract
We extend the Constraint Handling Rules language with ag- gregates such as sum, count, findall, and min. The proposed exten- sion features nested aggregate expressions over guarded conjunctions of constraints, a series of predened aggregates, and application-tailored user-dened aggregates. We formally dene the operational semantics of aggregates, and show how incremental aggregate computation facilitates ecien t implementations. Case studies demonstrate that language sup- port for aggregates signican tly reduces program size, thus improving readability and maintainability considerably. Constraint Handling Rules (CHR) (6, 4) is a powerful, elegant committed-choice CLP language, based on multi-headed, guarded multiset rewrite rules. Originally designed for the implementation of constraint solvers, CHR has matured towards a general purpose language, used in a wide range of application domains, includ- ing natural language processing, multi-agent systems, and type system design. CHR aims at supporting a very high-level, declarative programming style. While imperative programs explicitly specify an algorithm to achieve some goal, declarative programs simply describe the goal, leaving implementation details to the underlying language. This considerably shortens development time, and vastly improves a program's understandability, maintainability and robustness. In practice, however, there are programming idioms where CHR's conciseness and expressiveness is lacking. This paper identies and addresses one frequently recurring instance, namely the aggregation of information from nontrivial, pos- sibly unbounded parts of the constraint store. As the head of a single CHR rule considers only a bounded number of constraints, any form of aggregation neces- sarily requires explicit encodings using auxiliary CHR constraints and rules. Such ad hoc approaches are repetitive, cumbersome and error-prone, and the resulting auxiliary constructs often cross-cut the entire program. In other words, all afore- mentioned advantages of declarative programming are handicapped severely. With language support for aggregates, the programmer can express the ag- gregate logic concisely in a single self-contained rule, exhibiting all practical ? Research funded by a Ph.D. grant of the Institute for the Promotion of Innovation through Science and Technology in Flanders (IWT-Vlaanderen). ?? Research Assistant of the Research Foundation { Flanders (FWO-Vlaanderen). ? ? ? Post-Doctoral Researcher of the Research Foundation{Flanders (FWO-Vlaanderen).
Year
DOI
Venue
2007
10.1007/978-3-540-74610-2_39
ICLP'07 Proceedings of the 23rd international conference on Logic programming
Keywords
Field
DocType
constraint handling rule
Constraint satisfaction,Programming language,Computer science,Multiset,Constraint programming,Algorithm,Theoretical computer science,Concurrent constraint logic programming,Constraint logic programming,Constraint Handling Rules,Business rule,Encoding (memory)
Conference
Volume
ISSN
ISBN
4670
0302-9743
3-540-74608-0
Citations 
PageRank 
References 
6
0.54
8
Authors
4
Name
Order
Citations
PageRank
jon sneyers11179.47
peter van weert2654.48
tom schrijvers365263.35
bart demoen495677.58