Non-monotonic Self-Adjusting Computation [chapter]

Ruy Ley-Wild, Umut A. Acar, Guy Blelloch
2012 Lecture Notes in Computer Science  
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, i.e. 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
more » ... 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 (i.e., 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(log n) of the trace distance, where n is the trace length.
doi:10.1007/978-3-642-28869-2_24 fatcat:payxcagbwrez7mmcqwkrmc4db4