Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1328438.1328476acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Imperative self-adjusting computation

Published: 07 January 2008 Publication History

Abstract

Self-adjusting 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 re-evaluating 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 execution---this makes the model applicable only in a purely functional setting.
In this paper, we present techniques for imperative self-adjusting computation where modifiable references can be written multiple times. We define a language SAIL (Self-Adjusting Imperative Language) and prove consistency, i.e., that change propagation and from-scratch execution are observationally equivalent. 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, step-indexed logical relation, where step indices are used to ensure well-foundedness. 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 propagation becomes as efficient as in the non-imperative case. The general case incurs a slowdown that is logarithmic in the maximum number of such operations. We describe a prototype implementation of SAIL as a Standard ML library.

References

[1]
Martin Abadi, Butler W. Lampson, and Jean-Jacques Levy. Analysis and caching of dependencies. In Proceedings of the International Conference on Functional Programming (ICFP), pages 83--91, 1996.
[2]
Umut A. Acar, Guy E. Blelloch, and Robert Harper. Selective memoization. In Proceedings of the 30th Annual ACM Symposium on Principles of Programming Languages (POPL), 2003.
[3]
Umut A. Acar, Guy E. Blelloch, Robert Harper, Jorge L. Vittes, and Maverick Woo. Dynamizing static algorithms with applications to dynamic trees and history independence. In ACM-SIAM Symposium on Discrete Algorithms (SODA), 2004.
[4]
Umut A. Acar, Guy E. Blelloch, Matthias Blume, Robert Harper, and Kanat Tangwongsan. A library for self-adjusting computation. Electronic Notes in Theoretical Computer Science, 148(2), 2006. Also in Proceedings of the ACM-SIGPLAN Workshop on ML. 2005.
[5]
Umut A. Acar, Guy E. Blelloch, Matthias Blume, and Kanat Tangwongsan. An experimental analysis of self--adjusting computation. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2006.
[6]
Umut A. Acar, Guy E. Blelloch, and Robert Harper. Adaptive functional programming. ACM Transactions on Programming Languages and Systems (TOPLAS), 28(6):990--1034, 2006.
[7]
Umut A. Acar, Guy E. Blelloch, Kanat Tangwongsan, and Jorge L. Vittes. Kinetic algorithms via self-adjusting computation. In Proceedings of the 14th Annual European Symposium on Algorithms (ESA), pages 636--647, September 2006.
[8]
Umut A. Acar, Amal Ahmed, and Matthias Blume. Imperative self-adjusting computation. Technical Report TR-2007-18, Department of Computer Science, University of Chicago, November 2007.
[9]
Umut A. Acar, Matthias Blume, and Jacob Donham. A consistent semantics of self-adjusting computation. In Proceedings of the 16th Annual European Symposium on Programming (ESOP), 2007.
[10]
Umut A. Acar, Alexander Ihler, Ramgopal Mettu, and Ozgur Sumer. Adaptive bayesian inference. In Neural Information Systems (NIPS), 2007.
[11]
Amal Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In Proceedings of the 15th Annual European Symposium on Programming (ESOP), pages 69--83, 2006.
[12]
Amal Ahmed, Matthew Fluet, and Greg Morrisett. A step-indexed model of substructural state. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional programming (ICFP), pages 78--91, 2005.
[13]
Andrew W. Appel and David McAllester. An indexed model of recursive types for foundational proof-carrying code. ACM Transactions on Programming Languages and Systems (TOPLAS), 23(5):657--683, September 2001.
[14]
Richard Bellman. Dynamic Programming. Princeton University Press, 1957.
[15]
Nick Benton and Benjamin Leperchey. Relational reasoning in a nominal semantics for storage. In Proceedings of the 7th International Conference on Typed Lambda Calculi and Applications (TLCA), pages 86--101, 2005.
[16]
Nina Bohr and Lars Birkedal. Relational reasoning for recursive types and references. In Proceedings of the 4th Asian Symposium on Programming Languages and Systems (APLAS), 2006.
[17]
Magnus Carlsson. Monads for incremental computing. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional programming (ICFP), pages 26--35. ACM Press, 2002.
[18]
Thomas H. Cormen, Charles E. Leiserson, and Ronald L. Rivest. Introduction to Algorithms. MIT Press/McGraw-Hill, 1990.
[19]
Alan Demers, Thomas Reps, and Tim Teitelbaum. Incremental evaluation of attribute grammars with application to syntax directed editors. In Proceedings of the 8th Annual ACM Symposium on Principles of Programming Languages (POPL), pages 105--116, 1981.
[20]
P. F. Dietz and D. D. Sleator. Two algorithms for maintaining order in a list. In Proceedings of the 19th ACM Symposium on Theory of Computing (STOC), pages 365--372, 1987.
[21]
James R. Driscoll, Neil Sarnak, Daniel D. Sleator, and Robert E. Tarjan. Making data structures persistent. Journal of Computer and System Sciences, 38(1):86--124, February 1989.
[22]
Matthias Felleisen and Robert Hieb. A revised report on the syntactic theories of sequential control and state. Theoretical Computer Science, 103(2):235--271, 1992.
[23]
J. Field and T. Teitelbaum. Incremental reduction in the lambda calculus. In Proceedings of the ACM '90 Conference on LISP and Functional Programming, pages 307--322, June 1990.
[24]
Allan Heydon, Roy Levin, and Yuan Yu. Caching function calls using precise dependencies. In Proceedings of the 2000 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 311--320, 2000.
[25]
Vasileios Koutavas and Mitchell Wand. Small bisimulations for reasoning about higher-order imperative programs. In Proceedings of the 33rd Annual ACM Symposium on Principles of Programming Languages (POPL), 2006.
[26]
Yanhong A. Liu, Scott Stoller, and Tim Teitelbaum. Static caching for incremental computation. ACM Transactions on Programming Languages and Systems, 20(3):546--585, 1998.
[27]
John McCarthy. A Basis for a Mathematical Theory of Computation. In P. Braffort and D. Hirschberg, editors, Computer Programmingand Formal Systems, pages 33--70. North-Holland, Amsterdam, 1963.
[28]
D. Michie. 'Memo' functions and machine learning. Nature, 218:19--22, 1968.
[29]
Peter W. O'Hearn and Robert D. Tennent. Parametricity and local variables. Journal of the ACM, 42(3):658--709, May 1995.
[30]
Nicholas Pippenger. Pure versus impure lisp. ACM Transactions on Programming Languages and Systems (TOPLAS), 19(2):223--238, 1997.
[31]
Andrew M. Pitts. Reasoning about local variables with operationally--based logical relations. In Proceedings of the IEEE Symposium on Logic in Computer Science (LICS), 1996.
[32]
Andrew M. Pitts and Ian D. B. Stark. Observable properties of higher order functions that dynamically create local names, or: What's new? In Mathematical Foundations of Computer Science, volume 711 of LNCS, pages 122--141. Springer-Verlag, 1993.
[33]
William Pugh. Incremental computation via function caching. PhD thesis, Department of Computer Science, Cornell University, August 1988.
[34]
William Pugh and Tim Teitelbaum. Incremental computation via function caching. In Proceedings of the 16th Annual ACM Symposium on Principles of Programming Languages (POPL), pages 315--328, 1989.
[35]
G. Ramalingam and T. Reps. A categorized bibliography on incremental computation. In Proceedings of the 20th Annual ACM Symposium on Principles of Programming Languages (POPL), pages 502--510, 1993.
[36]
Thomas Reps. Optimal-time incremental semantic analysis for syntax-directed editors. In Proceedings of the 9th Annual Symposium on Principles of Programming Languages (POPL), pages 169--176, 1982.
[37]
Marco D Santambrogio, Vincenzo Rana, Seda Ogrenci Memik, Umut A. Acar, and Donatella Sciuto. A novel SoC design methodology for combined adaptive software descripton and reconfigurable hardware. In IEEE/ACM International Conference on Computer Aided Design (ICCAD), 2007.
[38]
Ajeet Shankar and Rastislav Bodik. Ditto: Automatic incrementalization of data structure invariant checks (in Java). In Proceedings of the ACM SIGPLAN 2007 Conference on Programming language Design and Implementation (PLDI), 2007.
[39]
Kurt Sieber. New steps towards full abstraction for local variables. In ACM SIGPLAN Workshop on State in Programming Languages, 1993.
[40]
Ian D. B. Stark. Names and Higher-Order Functions. Ph. D. dissertation, University of Cambridge, Cambridge, England, December 1994.
[41]
R. S. Sundaresh and Paul Hudak. Incremental compilation via partial evaluation. In Conference Record of the 18th Annual ACM Symposium on Principles of Programming Languages (POPL), pages 1--13, 1991.
[42]
D. M. Yellin and R. E. Strom. INC: A language for incremental computations. ACM Transactions on Programming Languages and Systems, 13(2):211--236, April 1991.

Cited By

View all
  • (2024)Interactive Abstract Interpretation with Demanded SummarizationACM Transactions on Programming Languages and Systems10.1145/364844146:1(1-40)Online publication date: 15-Feb-2024
  • (2023)A type-directed, dictionary-passing translation of method overloading and structural subtyping in Featherweight Generic GoJournal of Functional Programming10.1017/S095679682300004733Online publication date: 9-Oct-2023
  • (2022)Semantic Preservation for a Type Directed Translation Scheme of Featherweight GoMathematics of Program Construction10.1007/978-3-031-16912-0_7(178-197)Online publication date: 22-Sep-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
POPL '08: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2008
448 pages
ISBN:9781595936899
DOI:10.1145/1328438
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 43, Issue 1
    POPL '08
    January 2008
    420 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1328897
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 January 2008

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. change propagation
  2. imperative programming
  3. incremental computation
  4. memoization
  5. mutable state
  6. self-adjusting computation
  7. step-indexed logical relations

Qualifiers

  • Research-article

Conference

POPL08

Acceptance Rates

Overall Acceptance Rate 824 of 4,130 submissions, 20%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)13
  • Downloads (Last 6 weeks)3
Reflects downloads up to 12 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Interactive Abstract Interpretation with Demanded SummarizationACM Transactions on Programming Languages and Systems10.1145/364844146:1(1-40)Online publication date: 15-Feb-2024
  • (2023)A type-directed, dictionary-passing translation of method overloading and structural subtyping in Featherweight Generic GoJournal of Functional Programming10.1017/S095679682300004733Online publication date: 9-Oct-2023
  • (2022)Semantic Preservation for a Type Directed Translation Scheme of Featherweight GoMathematics of Program Construction10.1007/978-3-031-16912-0_7(178-197)Online publication date: 22-Sep-2022
  • (2021)Compositional optimizations for CertiCoqProceedings of the ACM on Programming Languages10.1145/34735915:ICFP(1-30)Online publication date: 19-Aug-2021
  • (2021)Demanded abstract interpretationProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454044(282-295)Online publication date: 19-Jun-2021
  • (2020)Trident: Toward Distributed Reactive SDN Programming With Consistent UpdatesIEEE Journal on Selected Areas in Communications10.1109/JSAC.2020.299965438:7(1322-1334)Online publication date: Jul-2020
  • (2019)Efficient, Consistent Distributed Computation with Predictive TreatiesProceedings of the Fourteenth EuroSys Conference 201910.1145/3302424.3303987(1-16)Online publication date: 25-Mar-2019
  • (2019)Change propagation and bidirectionality in internal transformation DSLsSoftware and Systems Modeling (SoSyM)10.1007/s10270-017-0617-618:1(249-278)Online publication date: 1-Feb-2019
  • (2019)Incremental $$\lambda $$ -Calculus in Cache-Transfer StyleProgramming Languages and Systems10.1007/978-3-030-17184-1_20(553-580)Online publication date: 6-Apr-2019
  • (2018)Reactive caching for composed services: polling at the speed of pushProceedings of the ACM on Programming Languages10.1145/32765222:OOPSLA(1-28)Online publication date: 24-Oct-2018
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media