Traceable data types for self-adjusting computation

Self-adjusting computation provides an evaluation model where computations can respond automatically to modifications to their data by using a mechanism for propagating modifications through the computation. Current approaches to self-adjusting computation guarantee correctness by recording dependencies in a trace at the granularity of individual memory operations. Tracing at the granularity of memory operations, however, has some limitations: it can be asymptotically inefficient (\eg, compared to optimal solutions) because it cannot take advantage of problem-specific structure, it requires keeping a large computation trace (often proportional to the runtime of the program on the current input), and it introduces moderately large constant factors in practice. In this paper, we extend dependence-tracing to work at the granularity of the query and update operations of arbitrary (abstract) data types, instead of just reads and writes on memory cells. This can significantly reduce the number of dependencies that need to be kept in the trace and followed during an update. We define an interface for supporting a traceable version of a data type, which reports the earliest query that depends on (is changed by) revising operations back in time, and implement several such structures, including priority queues, queues, dictionaries, and counters. We develop a semantics for tracing, extend an existing self-adjusting language, ΔML, and its implementation to support traceable data types, and present an experimental evaluation by considering a number of benchmarks. Our experiments show dramatic improvements on space and time, sometimes by as much as two orders of magnitude.

[1]  Thomas W. Reps,et al.  Incremental evaluation for attribute grammars with application to syntax-directed editors , 1981, POPL '81.

[2]  Paul F. Dietz,et al.  Two algorithms for maintaining order in a list , 1987, STOC.

[3]  Roger Hoover Incremental Graph Evaluation , 1987 .

[4]  Thomas W. Reps,et al.  A categorized bibliography on incremental computation , 1993, POPL '93.

[5]  Paul Hudak,et al.  A theory of incremental computation and its application , 1991, POPL '91.

[6]  William Pugh,et al.  Incremental computation via function caching , 1989, POPL '89.

[7]  Umut A. Acar,et al.  CEAL: a C-based language for self-adjusting computation , 2009, PLDI '09.

[8]  Guy E. Blelloch,et al.  An experimental analysis of self-adjusting computation , 2006, PLDI '06.

[9]  R. Hoover Incremental graph evaluation (attribute grammar) , 1987 .

[10]  David P. Dobkin,et al.  The quickhull algorithm for convex hulls , 1996, TOMS.

[11]  Raman Srinivas Sundaresh Incremental computation via partial evaluation , 1992 .

[12]  DONALD MICHIE,et al.  “Memo” Functions and Machine Learning , 1968, Nature.

[13]  Daniel M. Yellin,et al.  INC: a language for incremental computations , 1988, PLDI '88.

[14]  Guy E. Blelloch,et al.  Robust Kinetic Convex Hulls in 3D , 2008, ESA.

[15]  Umut A. Acar,et al.  Dynamic well-spaced point sets , 2010, Comput. Geom..

[16]  Leonidas J. Guibas,et al.  Algorithmic issues in modeling motion , 2002, CSUR.

[17]  Tim Teitelbaum,et al.  Incremental reduction in the lambda calculus , 1990, LISP and Functional Programming.

[18]  Guy E. Blelloch,et al.  Adaptive functional programming , 2002, POPL '02.

[19]  Magnus Carlsson Monads for incremental computing , 2002, ICFP '02.

[20]  X. Liy Dynamic Algorithms in Computational Geometry , 2007 .

[21]  Umut A. Acar,et al.  Compiling self-adjusting programs with continuations , 2008, ICFP.

[22]  Sean R Eddy,et al.  What is dynamic programming? , 2004, Nature Biotechnology.

[23]  Analysis and caching of dependencies , 1996, ICFP '96.

[24]  Umut A. Acar,et al.  A cost semantics for self-adjusting computation , 2009, POPL '09.

[25]  John McCarthy,et al.  A basis for a mathematical theory of computation, preliminary report , 1899, IRE-AIEE-ACM '61 (Western).

[26]  David Eppstein,et al.  Dynamic graph algorithms , 2010 .

[27]  Max Crochemore,et al.  Algorithms and Theory of Computation Handbook , 2010 .

[28]  Guy E. Blelloch,et al.  Non-oblivious Retroactive Data Structures , 2007 .

[29]  Allan Heydon,et al.  Caching function calls using precise dependencies , 2000, PLDI '00.

[30]  Rastislav Bodík,et al.  DITTO: automatic incrementalization of data structure invariant checks (in Java) , 2007, PLDI '07.