Incremental Computation: A Semantics-Based Systematic Transformational Approach

Incremental computation takes advantage of repeated computations on inputs that differ slightly from one another, computing each new output incrementally by making use of the previous output rather than from scratch. This thesis concerns the theory, design, and implementation of a general approach to incremental computation. It also elucidates the essence of improving the efficiency of computations by relating it to incremental computation. Our general approach allows incremental computation to be obtained systematically from non-incremental computation and program efficiency to be systematically improved. This research focuses on identifying the fundamentals of efficient incremental computation out of domain-specific properties and language-specific features, devising a general framework that accommodates these fundamentals, and developing a systematic approach based on the framework that exploits program semantics. Three fundamental aspects of incremental computation are identified: avoiding repeated identical computations, caching useful intermediate results, and discovering appropriate auxiliary information. Given a program $f$ and an operation $\oplus$, an incremental program is developed to compute $f(x\oplus y)$ efficiently by using $f(x)$, the intermediate results computed in computing $f(x)$, and auxiliary information about $x$ that can be inexpensively maintained. The approach in this thesis is formalized for a simple functional language, but the underlying principles also apply to other programming languages. It exploits program semantics to discover incrementality that is not directly embedded in primitive operators and takes into consideration properties of application domains as well. It is composed of step-wise program analysis and transformation modules that can, for the most part, be mechanized. Since every non-trivial computation proceeds by iteration (or recursion), the approach is used straightforwardly for achieving efficient computation in general, by computing each iteration incrementally using an appropriate incremental program. This method is applied to problems in interactive systems, optimizing compilers, transformational program development, {\it etc}. The design and implementation of a prototype system, CACHET, for obtaining incremental programs is also described.

[1]  David Gries,et al.  A Note on a Standard Strategy for Developing Loop Invariants and Loops , 1982, Sci. Comput. Program..

[2]  Michael G. Burke An interval-based approach to exhaustive and incremental interprocedural data-flow analysis , 1990, TOPL.

[3]  Martin S. Feather,et al.  A System for Assisting Program Transformation , 1982, TOPL.

[4]  Bernard Lang,et al.  Programming Environments Based on Structured Editors: The MENTOR Experience, , 1980 .

[5]  Gail E. Kaiser,et al.  Incremental dynamic semantics for language-based programming environments , 1989, TOPL.

[6]  Chia-Hsiang Chang,et al.  From Regular Expressions to DFA's Using Compressed NFA's , 1992, Theor. Comput. Sci..

[7]  Greg N. Frederickson,et al.  Data Structures for On-Line Updating of Minimum Spanning Trees, with Applications , 1985, SIAM J. Comput..

[8]  Uday S. Reddy,et al.  Transformational derivation of programs using the focus system , 1989, SDE 3.

[9]  Steven P. Reiss,et al.  An approach to incremental compilation , 1984, SIGPLAN '84.

[10]  Manfred Broy,et al.  Algebraic Methods for Program Construction: The Project CIP , 1984 .

[11]  Adam Brooks Webber,et al.  Optimization of functional programs by grammar thinning , 1995, TOPL.

[12]  Thomas W. Reps,et al.  An incremental algorithm for maintaining the dominator tree of a reducible flowgraph , 1994, POPL '94.

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

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

[15]  Peter Bro Miltersen On-Line Reevaluation of Functions , 1992 .

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

[17]  David W. Binkley,et al.  Program slicing , 2008, 2008 Frontiers of Software Maintenance.

[18]  David Eppstein,et al.  Sparsification—a technique for speeding up dynamic graph algorithms , 1997, JACM.

[19]  Ben Wegbreit,et al.  Mechanical program analysis , 1975, CACM.

[20]  Jeffrey Scott Vitter,et al.  A Complexity Theoretic Approach to Incremental Computation , 1993, STACS.

[21]  R. Zabih,et al.  Individuating unknown objects by combining motion and stereo , 1994 .

[22]  Jennifer Widom,et al.  View maintenance in a warehousing environment , 1995, SIGMOD '95.

[23]  Gregor Snelting,et al.  The PSG system: from formal language definitions to interactive programming environments , 1986, TOPL.

[24]  Rance Cleaveland,et al.  Implementing mathematics with the Nuprl proof development system , 1986 .

[25]  Toshiro Wakayama,et al.  A Reconstruction of Context-Dependent Document Processing In SGML , 1991 .

[26]  Bernhard Steffen,et al.  Partial dead code elimination , 1994, PLDI '94.

[27]  Nachum Dershowitz The evolution of programs , 1983, Progress in computer science.

[28]  G. Ramalingam Bounded Incremental Computation , 1996, Lecture Notes in Computer Science.

[29]  Lawrence C. Paulson,et al.  A Higher-Order Implementation of Rewriting , 1983, Sci. Comput. Program..

[30]  Thomas Reps,et al.  The Synthesizer Generator: A System for Constructing Language-Based Editors , 1988 .

[31]  Robert Paige,et al.  Viewing A Program Transformation System At Work , 1994, PLILP.

[32]  Robert Paige,et al.  Real-time Simulation of a Set Machine on a Ram , 1989 .

[33]  David Notkin,et al.  Gandalf: Software development environments , 1986, IEEE Transactions on Software Engineering.

[34]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[35]  Robert Paige,et al.  Programming with Invariants , 1986, IEEE Software.

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

[37]  Keshav Pingali,et al.  The program structure tree: computing control regions in linear time , 1994, PLDI '94.

[38]  Neil D. Jones,et al.  Program flow analysis - theory and applications , 1981, Prentice Hall software series.

[39]  David Gries,et al.  Compiler Construction for Digital Computers , 1971 .

[40]  Robert E. Tarjan,et al.  A data structure for dynamic trees , 1981, STOC '81.

[41]  James Alan Larson,et al.  Interactive Software: Tools for Building Interactive User Interface , 1991 .

[42]  Dashing Yeh On incremental evaluation of ordered attributed grammars , 1983, BIT Comput. Sci. Sect..

[43]  Steven P. Reiss,et al.  Connecting tools using message passing in the Field environment , 1990, IEEE Software.

[44]  A. Pettorossi Strategical derivation of on-line programs , 1987 .

[45]  Harald Vogt,et al.  Rapid Development of a Program Transformation System with Attribute Grammars and Dynamic Transformations , 1990, WAGA.

[46]  Alberto Pettorossi,et al.  A powerful strategy for deriving efficient programs by transformation , 1984, LFP '84.

[47]  Valentin F. Turchin,et al.  The concept of a supercompiler , 1986, TOPL.

[48]  Steven P. Reiss,et al.  Graphical program development with PECAN program development systems , 1984, SDE 1.

[49]  Philip Wadler,et al.  Projections for strictness analysis , 1987, FPCA.

[50]  Bradley T. Vander Zanden Incremental Constraint Satisfaction and its Application to Graphical Interfaces , 1988 .

[51]  Peter Sestoft,et al.  An experiment in partial evaluation: the generation of a compiler generator , 1985, SIGP.

[52]  Douglas R. Smith,et al.  KIDS - A Knowledge-Based Software Development System , 1991 .

[53]  Robert Paige,et al.  Applications of Finite Differencing to Database Integrity Control and Query/Transaction Optimization , 1982, Advances in Data Base Theory.

[54]  Jay Earley,et al.  High Level Iterators and a Method for Automatically Designing Data Structure Representation , 1976, Comput. Lang..

[55]  John Launchbury,et al.  Projection factorisations in partial evaluation , 1991 .

[56]  Fritz Henglein,et al.  Mechanical Translation of Set Theoretic Problem Specifications into Efficient RAM Code - A Case Study , 1985, European Conference on Computer Algebra.

[57]  Rishiyur S. Nikhil,et al.  Incremental Polymorphism , 1991, FPCA.

[58]  Daniel M. Yellin,et al.  Composable attribute grammars: support for modularity in translator design and implementation , 1992, POPL '92.

[59]  Rod M. Burstall,et al.  Proving Properties of Programs by Structural Induction , 1969, Comput. J..

[60]  Pierangela Samarati,et al.  Achieving Incremental Consistency among Autonomous Replicated Databases , 1992, DS-5.

[61]  Amelia C. Fong Generalized common subexpressions in very high level languages , 1977, POPL.

[62]  Jason Hickey,et al.  Non-Restoring Integer Square Root: A Case Study in Design by Principled Optimization , 1994, TPCD.

[63]  Anders Bondorf,et al.  Automatic Autoprojection of Recursive Equations with Global Variables and Abstract Data Types , 1991, Sci. Comput. Program..

[64]  Jr. William Worthington Pugh Incremental Computation and the Incremental Evaluation of Functional Programs , 1988 .

[65]  Ramin Zabih,et al.  Non-parametric Local Transforms for Computing Visual Correspondence , 1994, ECCV.

[66]  Ronald L. Rivest,et al.  The Design and Analysis of Computer Algorithms , 1990 .

[67]  Ben Wegbreit,et al.  Goal-Directed Program Transformation , 1976, IEEE Transactions on Software Engineering.

[68]  Uwe Kastens,et al.  Improvements of an incremental evaluation algorithm for ordered attribute grammars , 1988, SIGP.

[69]  Takuya Katayama,et al.  Translation of attribute grammars into procedures , 1984, TOPL.

[70]  R. S. Sundaresh,et al.  Building incremental programs using partial evaluation , 1991, PEPM '91.

[71]  Zohar Manna,et al.  A Deductive Approach to Program Synthesis , 1979, TOPL.

[72]  Robert Paige,et al.  Transformational programming: applications to algorithms and systems , 1983, POPL '83.

[73]  Jack Mostow,et al.  Automating Program Speedup by Deciding What to Cache , 1985, IJCAI.