Transformation-based Indexing Techniques for CHR

Beata Sarna-Starosta, Tom Schrijvers

Summary I: Attributed Data

The overhead of matching CHR rules is alleviated by constraint store indexing. Attributed variables provide an efficient means of indexing on logical variables. Existing indexing strategies for ground terms, based on hash tables, incur considerable performance overhead, especially when frequently computing hash values for large terms.

In this paper we (1) propose attributed data, a new data representation for ground terms inspired by attributed variables, that avoids the overhead of hash-table indexing, (2) describe program analysis and transformation techniques that make attributed data more effective, and (3) provide experimental results that establish the usefulness of our approach.

Attributed Data Benchmarks

name source file benchmark driver
chrg chrg.pl
flat_ram ram.pl bench_ram_op.pl
mergesort mergesort.pl
reverse reverse.pl
uf_opt uf_opt.pl
turing turing.pl
wfs wfs.pl
fib fib.pl
fib2 fib2.pl
dijkstra fib_heap.pl dijkstra_bench.pl, dijkstra_bench.pl

Summary II: Flattening

Multi-headed rules are essential for the expressiveness of CHR, but incur considerable performance overhead. Current indexing techniques are often unable to address this problem. They are effective only when matchings have a particular form, or offer good run-time complexity rather than good absolute figures.

We describe two lightweight techniques for improving the effectiveness of existing CHR indexing techniques: two program transformations based on term flattening. With a complimentary set of post-processing program transformations the flattening overhead is considerably reduced.

We compare these techniques with the current state of the art in CHR compilation, and measure their efficacy in K.U.Leuven CHR and CHRd.

Flattening Transformations

Generic Flattening

Constraint Symbol Specialization

Technical Report: Preliminary Ideas

Multi-headed rules are essential for the expressiveness of CHR, but incur a considerable performance penalty. Current indexing techniques are often unable to address this problem. They are effective only when matchings have a particular form, or offer good run-time complexity rather than good absolute figures. In this paper we describe three advanced indexing techniques: (1) two program transformations that make other indexing techniques more effective, (2) an index for ground terms more efficient than hash tables, and (3) a post-processing program transformation that eliminates runtime overhead of (1) and (2). We compare these techniques with the current state of the art, and give measurements of their effectiveness in K.U.Leuven CHR and CHRd. [Get it here]

Related Links

Last update: 03-04-2009