Non-monotonic Self-Adjusting Computation

Self-adjusting computation is a language-based approach to writing programs that respond dynamically to input changes by maintaining a trace of the computation consistent with the input, thus also updating the output. For monotonic programs, ie where localized input changes cause localized changes in the computation, the trace can be repaired efficiently by insertions and deletions. However, non-local input changes can cause major reordering of the trace. In such cases, updating the trace can be asymptotically equal to running from scratch. In this paper, we eliminate the monotonicity restriction by generalizing the update mechanism to use trace slices, which are partial fragments of the computation that can be reordered with some bookkeeping. We provide a high-level source language for pure programs, equipped with a notion of trace distance for comparing two runs of a program modulo reordering. The source language is translated into a low-level target language with intrinsic support for non-monotonic update (ie, with reordering). We show that the translation asymptotically preserves the semantics and trace distance, that the cost of update coincides with trace distance, and that updating produces the same answer as a from-scratch run. We describe a concrete algorithm for implementing change-propagation with asymptotic bounds on running time. The concrete algorithm achieves running time bounds which are within O(logn) of the trace distance, where n is the trace length.

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

[2]  Guy E. Blelloch,et al.  Programmable self-adjusting computation , 2010 .

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

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

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

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

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

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

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

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

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

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

[13]  Umut A. Acar,et al.  Adaptive Bayesian inference , 2007, NIPS 2007.

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

[15]  Yanhong A. Liu,et al.  Static caching for incremental computation , 1998, TOPL.

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

[17]  Guy E. Blelloch,et al.  An experimental analysis of self-adjusting computation , 2009 .

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

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

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