A Theory of Changes for Higher-Order Languages Incrementalizing λ-Calculi by Static Differentiation

被引:23
作者
Cai, Yufei [1 ]
Giarrusso, Paolo G. [1 ]
Rendel, Tillmann [1 ]
Ostermann, Klaus [1 ]
机构
[1] Univ Marburg, D-35032 Marburg, Germany
关键词
Incremental computation; first-class functions; performance; Agda; formalization;
D O I
10.1145/2666356.2594304
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 lambda-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.
引用
收藏
页码:145 / 155
页数:11
相关论文
共 24 条
[1]  
Acar U. A., 2009, ACM T PROGR LANG SYS, V32, P3
[2]  
Acar U. A., 2005, THESIS PRINCETON U
[3]   Adaptive functional programming [J].
Acar, Umut A. ;
Blelloch, Guy E. ;
Harper, Robert .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2006, 28 (06) :990-1034
[4]   Traceable Data Types for Self-Adjusting Computation [J].
Acar, Umut A. ;
Blelloch, Guy ;
Ley-Wild, Ruy ;
Tangwongsan, Kanat ;
Turkoglu, Duru .
ACM SIGPLAN NOTICES, 2010, 45 (06) :483-496
[5]  
Acar UmutA., 2009, Proceedings of the 2009 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, P1
[6]  
Agda Development Team, 2013, AGD WIK
[7]  
[Anonymous], 2013, P 12 ANN INT C ASP O
[8]  
Appel A. W., 1997, JFP, V7, P515
[9]  
Blakeley J. A., 1986, SIGMOD Record, V15, P61, DOI 10.1145/16856.16861
[10]   Implicit Self-Adjusting Computation for Purely Functional Programs [J].
Chen, Yan ;
Dunfield, Joshua ;
Hammer, Matthew A. ;
Acar, Umut A. .
ACM SIGPLAN NOTICES, 2011, 46 (09) :129-141