Static caching for incremental computation

A systematic approach is given for deriving incremental programs that exploit caching. The cache-and-prune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the final result, (II)) the extended program is incrementalized so that computation on a new input can use all intermediate results on an old input, and (III) unused results cached by the extended program and maintained by the incremental program are pruned away, leaving a pruned extended program that caches only useful intermediate results and a pruned incremental program that uses and maintains only useful results. All three stages utilize static analyses and semantics-preserving transformations. Stages I and III are simple, clean, and fully automatable. The overall method has a kind of optimality with respect to the techniques used in Stage II. The method can be applied straightfowardly to provide a systematic approach to program improvement via caching.

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

[2]  Yanhong A. Liu,et al.  Loop optimization for aggregate array computations , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[3]  Yanhong A. Liu,et al.  Principled strength reduction , 1997, Algorithmic Languages and Calculi.

[4]  Daniel Le Métayer,et al.  Computer-Time Garbage Collection by Sharing Analysis , 1989, FPCA.

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

[6]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[7]  Sidney B. Gasser Program optimization , 1972 .

[8]  Yanhong A. Liu,et al.  CACHET: an interactive, incremental-attribution-based program transformation system for deriving incremental programs , 1995, Proceedings 1995 10th Knowledge-Based Software Engineering Conference.

[9]  Wei-Ngan Chin Towards an automated tupling strategy , 1993, PEPM '93.

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

[11]  Dana S. Scott,et al.  Lectures on a Mathematical Theory of Computation , 1982 .

[12]  Alberto Pettorossi,et al.  Program derivation via list introduction , 1997, Algorithmic Languages and Calculi.

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

[14]  Norman H. Cohen Eliminating Redundant Recursive Calls. , 1983, TOPL.

[15]  Thomas W. Reps,et al.  Incremental Context-Dependent Analysis for Language-Based Editors , 1983, TOPL.

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

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

[18]  Yanhong A. Liu,et al.  Discovering auxiliary information for incremental computation , 1996, POPL '96.

[19]  Yanhong A. Liu,et al.  Systematic Derivation of Incremental Programs , 1995, Sci. Comput. Program..

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

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

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

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

[24]  R. Paige Symbolic finite differencing, part I (invited lecture) , 1990 .

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

[26]  Sidney B. Gasser Program optimization , 1972, SICOSIM3.

[27]  Robert Paige,et al.  Symbolic Finite Differencing - Part I , 1990, ESOP.

[28]  Douglas R. Smith,et al.  KIDS: A Semiautomatic Program Development System , 1990, IEEE Trans. Software Eng..

[29]  Mads Rosendahl,et al.  Automatic complexity analysis , 1989, FPCA.

[30]  Adam Brooks Webber Program analysis using binary relations , 1997, PLDI '97.

[31]  Ken Kennedy,et al.  An algorithm for reduction of operator strength , 1977, Commun. ACM.

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

[33]  William M. Wells,et al.  Efficient Synthesis of Gaussian Filters by Cascaded Uniform Filters , 1986, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[34]  Jukka Paakki,et al.  Attribute grammar paradigms—a high-level methodology in language implementation , 1995, CSUR.

[35]  Robert Cartwright Recursive Programs as Definitions in First Order Logic , 1984, SIAM J. Comput..

[36]  Richard S. Bird The promotion and accumulation strategies in transformational programming , 1984, TOPL.

[37]  PaakkiJukka Attribute grammar paradigmsa high-level methodology in language implementation , 1995 .

[38]  Robert M. Keller,et al.  Applicative caching , 1986, TOPL.

[39]  Olivier Danvy,et al.  Separating stages in the continuation-passing style transformation , 1993, POPL '93.

[40]  K. R. Traub,et al.  A COMPILER FOR THE MIT TAGGED-TOKEN DATAFLOW ARCHITECTURE , 1986 .

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

[42]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[43]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[44]  Michael L. Van de Vanter,et al.  The Pan language-based editing system , 1992, TSEM.

[45]  John Hughes,et al.  Lazy Memo-functions , 1985, FPCA.

[46]  Charles Rich,et al.  Program Improvement by Automatic Redistribution of Intermediate Results , 1988 .

[47]  William Pugh An improved replacement strategy for function caching , 1988, LFP '88.

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

[49]  Richard S. Bird,et al.  Tabulation Techniques for Recursive Programs , 1980, CSUR.

[50]  Jon A. Webb Steps toward architecture-independent image processing , 1992, Computer.

[51]  David Gries,et al.  Specification and Transformation of Programs: A Formal Approach to Software Development , 1990 .

[52]  Thomas W. Reps,et al.  Program Specialization via Program Slicing , 1996, Dagstuhl Seminar on Partial Evaluation.

[53]  John Hughes,et al.  Compile-time analysis of functional programs , 1990 .

[54]  Robert D. Tennent,et al.  Semantics of programming languages , 1991, Prentice Hall International Series in Computer Science.

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

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

[57]  Yanhong A. Liu,et al.  Dependence analysis for recursive data , 1998, Proceedings of the 1998 International Conference on Computer Languages (Cat. No.98CB36225).

[58]  John Launchbury,et al.  Strictness and binding-time analyses: two for the price of one , 1991, PLDI '91.

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

[60]  Pierre Deransart,et al.  Attribute Grammars: Definitions, Systems and Bibliography , 1988 .

[61]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[62]  Robert Paige,et al.  Finite Differencing of Computable Expressions , 1982, TOPL.

[63]  Torben Æ. Mogensen Separating binding times in language specifications , 1989, Conference on Functional Programming Languages and Computer Architecture.

[64]  Helmuth Partsch,et al.  Specification and Transformation of Programs - A Formal Approach to Software Development , 1990, Texts and Monographs in Computer Science.

[65]  Roger Hoover,et al.  Alphonse: incremental computation as a programming abstraction , 1992, PLDI '92.

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

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

[68]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .

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

[70]  Wei-Ngan Chin,et al.  Tupling Functions with Multiple Recursion Parameters , 1993, WSA.

[71]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[72]  Adam Brooks Webber Principled Optimization of Functional Programs , 1993 .

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

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