skip to main content
10.1145/503272.503296acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Adaptive functional programming

Published:01 January 2002Publication History

ABSTRACT

An adaptive computation maintains the relationship between its input and output as the input changes. Although various techniques for adaptive computing have been proposed, they remain limited in their scope of applicability. We propose a general mechanism for adaptive computing that enables one to make any purely-functional program adaptive.We show that the mechanism is practical by giving an efficient implementation as a small ML library. The library consists of three operations for making a program adaptive, plus two operations for making changes to the input and adapting the output to these changes. We give a general bound on the time it takes to adapt the output, and based on this, show that an adaptive Quicksort adapts its output in logarithmic time when its input is extended by one key.To show the safety and correctness of the mechanism we give a formal definition of AFL, a call-by-value functional language extended with adaptivity primitives. The modal type system of AFL enforces correct usage of the adaptivity mechanism, which can only be checked at run time in the ML library. Based on the AFL dynamic semantics, we formalize the change-propagation algorithm and prove its correctness.

References

  1. 1.Umut A. Acar, Guy E. Blelloch, and Robert W. Harper. Adaptive functional programming. Technical Report CMU- CS- 01-161, Carnegie Mellon University, Computer Science Department, November 2001.Google ScholarGoogle Scholar
  2. 2.Julien Basch, Leonidas J. Guibas, and John Hershberger. Data structures for mobile data. Journal of Algorithms, 31(1):1-28, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3.Alan Demers, Thomas Reps, and Tim Teitelbaum. Incremental evaluation of attribute grammars with application to syntax directed editors. In Conference Record of the 8th Annual ACM Symposium on POPL, pages 105-116, January 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4.P. F. Dietz and D. D. Sleator. Two algorithms for maintaining order in a list. In Proceedings. 19th ACM Symposium. Theory of Computing, pages 365-372, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5.Paul F. Dietz. Fully persistent arrays. In Workshop on Algorithms and Data Structures, volume 382 of Lecture Notes in Computer Science, pages 67-74. Springer-Verlag, August 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6.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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7.James R. Driscoll, Daniel D. Sleator, and Robert E. Tarjan. Fully persistent lists with catenation. Journal of the ACM, 41(5):943-959, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8.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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9.Roger Hoover. Incremental Graph Evaluation. PhD thesis, Department of Computer Science, Cornell University, May 1987.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10.Yanhong A. Liu, Scott Stoller, and Tim Teitelbaum. Discovering auxiliary information for incremental computation. In Conference Record of the 23rd Annual ACM Symposium on POPL, pages 157-170, January 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11.Yanhong A. Liu and Tim Teitelbaum. Systematic derivation of incremental programs. Science of Computer Programming, 24(1):1-30, February 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12.Frank Pfenning and Rowan Davies. A judgmental reconstruction of modal logic. Mathematical Structures in Computer Science, 11:511-540, 2001. Notes to an invited talk at the Workshop on Intuitionistic Modal Logics and Applications (IMLA'99), Trento, Italy, July 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13.W. Pugh and T. Teitelbaum. Incremental computation via function caching. In Conference Record of the 16th Annual Symposium on POPL, pages 315-328, January 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 14.William Pugh. Incremental computation via function caching. PhD thesis, Department of Computer Science, Cornell University, August 1987.Google ScholarGoogle Scholar
  15. 15.G. Ramalingam and Thomas W. Reps. A categorized bibliography on incremental computation. In Conference Record of the 20th Annual ACM Symposium on POPL, pages 502- 510, January 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16.Thomas Reps. Generating Language-Based Environments. PhD thesis, Department of Computer Science, Cornell University, August 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17.R. S. Sundaresh and Paul Hudak. Incremental compilation via partial evaluation. In Conference Record of the 18th Annual ACM Symposium on POPL, pages 1-13, January 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. 18.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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    POPL '02: Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
    January 2002
    351 pages
    ISBN:1581134509
    DOI:10.1145/503272

    Copyright © 2002 ACM

    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]

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 1 January 2002

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • Article

    Acceptance Rates

    POPL '02 Paper Acceptance Rate28of128submissions,22%Overall Acceptance Rate824of4,130submissions,20%

    Upcoming Conference

    POPL '25

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader