ABSTRACT
If the result of an expensive computation is invalidated by a small change to the input, the old result should be updated incrementally instead of reexecuting the whole computation. We incrementalize programs through their derivative. A derivative maps changes in the program's input directly to changes in the program's output, without reexecuting the original program. We present a program transformation taking programs to their derivatives, which is fully static and automatic, supports first-class functions, and produces derivatives amenable to standard optimization.
We prove the program transformation correct in Agda for a family of simply-typed λ-calculi, parameterized by base types and primitives. A precise interface specifies what is required to incrementalize the chosen primitives.
We investigate performance by a case study: We implement in Scala the program transformation, a plugin and improve performance of a nontrivial program by orders of magnitude.
- U. A. Acar. Self-Adjusting Computation. PhD thesis, Princeton University, 2005. Google Scholar
Digital Library
- U. A. Acar. Self-adjusting computation: (an overview). In PEPM, pages 1--6. ACM, 2009. Google Scholar
Digital Library
- U. A. Acar, G. E. Blelloch, and R. Harper. Adaptive functional programming. TOPLAS, 28(6):990--1034, Nov. 2006. Google Scholar
Digital Library
- U. A. Acar, G. E. Blelloch, M. Blume, R. Harper, and K. Tangwongsan. An experimental analysis of self-adjusting computation. TOPLAS, 32 (1):3:1--3:53, Nov. 2009. Google Scholar
Digital Library
- U. A. Acar, G. Blelloch, R. Ley-Wild, K. Tangwongsan, and D. Turkoglu. Traceable data types for self-adjusting computation. In PLDI, pages 483--496. ACM, 2010. Google Scholar
Digital Library
- Agda Development Team. The Agda Wiki. http://wiki.portal.chalmers.se/agda/, 2013. Accessed on 2013-10-30.Google Scholar
- A. W. Appel and T. Jim. Shrinking lambda expressions in linear time. JFP, 7:515--540, 1997. Google Scholar
Digital Library
- J. A. Blakeley, P.-A. Larson, and F. W. Tompa. Efficiently updating materialized views. In SIGMOD, pages 61--71. ACM, 1986. Google Scholar
Digital Library
- Y. Chen, J. Dunfield, M. A. Hammer, and U. A. Acar. Implicit self-adjusting computation for purely functional programs. In ICFP, pages 129--141. ACM, 2011. Google Scholar
Digital Library
- C. Elliott and P. Hudak. Functional reactive animation. In ICFP, pages 263--273. ACM, 1997. Google Scholar
Digital Library
- P. G. Giarrusso, K. Ostermann, M. Eichberg, R. Mitschke, T. Rendel, and C. Kästner. Reify your collection queries for modularity and speed! In AOSD, pages 1--12. ACM, 2013. Google Scholar
Digital Library
- D. Gluche, T. Grust, C. Mainberger, and M. Scholl. Incremental updates for materialized OQL views. In Deductive and Object-Oriented Databases, volume 1341 of LNCS, pages 52--66. Springer, 1997. Google Scholar
Digital Library
- A. Gupta and I. S. Mumick. Maintenance of materialized views: problems, techniques, and applications. In A. Gupta and I. S. Mumick, editors, Materialized views, pages 145--157. MIT Press, 1999. Google Scholar
Digital Library
- M. A. Hammer, G. Neis, Y. Chen, and U. A. Acar. Self-adjusting stack machines. In OOPSLA, pages 753--772. ACM, 2011. Google Scholar
Digital Library
- C. Koch. Incremental query evaluation in a ring of databases. In Symp. Principles of Database Systems (PODS), pages 87--98. ACM, 2010. Google Scholar
Digital Library
- R. Lämmel. Google's MapReduce programming model --- revisited. Sci. Comput. Program., 68(3):208--237, Oct. 2007. Google Scholar
Digital Library
- Y. A. Liu. Efficiency by incrementalization: An introduction. HOSC, 13(4):289--313, 2000. Google Scholar
Digital Library
- I. Maier and M. Odersky. Higher-order reactive programming with incremental lists. In ECOOP, pages 707--731. Springer-Verlag, 2013. Google Scholar
Digital Library
- J. C. Mitchell. Foundations of programming languages. MIT Press, 1996. Google Scholar
Digital Library
- R. Paige and S. Koenig. Finite differencing of computable expressions. TOPLAS, 4(3):402--454, July 1982. Google Scholar
Digital Library
- G. Ramalingam and T. Reps. A categorized bibliography on incremental computation. In POPL, pages 502--510. ACM, 1993. Google Scholar
Digital Library
- T. Rompf and M. Odersky. Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs. In GPCE, pages 127--136. ACM, 2010. Google Scholar
Digital Library
- G. Salvaneschi and M. Mezini. Reactive behavior in object-oriented applications: an analysis and a research roadmap. In AOSD, pages 37--48. ACM, 2013. Google Scholar
Digital Library
- D. Willis, D. J. Pearce, and J. Noble. Caching and incrementalisation in the Java Query Language. In OOPSLA, pages 1--18. ACM, 2008. Google Scholar
Digital Library
Index Terms
A theory of changes for higher-order languages: incrementalizing λ-calculi by static differentiation
Recommendations
A theory of changes for higher-order languages: incrementalizing λ-calculi by static differentiation
PLDI '14If the result of an expensive computation is invalidated by a small change to the input, the old result should be updated incrementally instead of reexecuting the whole computation. We incrementalize programs through their derivative. A derivative maps ...
Decidability of conversion for type theory in type theory
Type theory should be able to handle its own meta-theory, both to justify its foundational claims and to obtain a verified implementation. At the core of a type checker for intensional type theory lies an algorithm to check equality of types, or in ...
Parametric quantifiers for dependent type theory
Polymorphic type systems such as System F enjoy the parametricity property: polymorphic functions cannot inspect their type argument and will therefore apply the same algorithm to any type they are instantiated on. This idea is formalized mathematically ...






Comments