 
Summary: Imperative SelfAdjusting Computation
Umut A. Acar Amal Ahmed Matthias Blume
Toyota Technological Institute at Chicago
{umut,amal,blume}@ttic.org
Abstract
Selfadjusting computation enables writing programs that can automatically and efficiently respond
to changes to their data (e.g., inputs). The idea behind the approach is to store all data that can
change over time in modifiable references and to let computations construct traces that can drive change
propagation. After changes have occurred, change propagation updates the result of the computation
by reevaluating only those expressions that depend on the changed data. Previous approaches to self
adjusting computation require that modifiable references be written at most once during executionthis
makes the model applicable only in a purely functional setting.
In this paper, we present techniques for imperative selfadjusting computation where modifiable ref
erences can be written multiple times. We define a language SAIL (SelfAdjusting Imperative Language)
and prove consistency, i.e., that change propagation and fromscratch execution are observationally equiv
alent. Since SAIL programs are imperative, they can create cyclic data structures. To prove equivalence
in the presence of cycles in the store, we formulate and use an untyped, stepindexed logical relation,
where step indices are used to ensure wellfoundedness. We show that SAIL accepts an asymptotically
efficient implementation by presenting algorithms and data structures for its implementation. When the
number of operations (reads and writes) per modifiable is bounded by a constant, we show that change
