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

Static prediction of heap space usage for first-order functional programs

Authors Info & Claims
Published:15 January 2003Publication History

ABSTRACT

We show how to efficiently obtain linear a priori bounds on the heap space consumption of first-order functional programs.The analysis takes space reuse by explicit deallocation into account and also furnishes an upper bound on the heap usage in the presence of garbage collection. It covers a wide variety of examples including, for instance, the familiar sorting algorithms for lists, including quicksort.The analysis relies on a type system with resource annotations. Linear programming (LP) is used to automatically infer derivations in this enriched type system.We also show that integral solutions to the linear programs derived correspond to programs that can be evaluated without any operating system support for memory management. The particular integer linear programs arising in this way are shown to be feasibly solvable under mild assumptions.

References

  1. Mobile resource guarantees. EU Project No. IST-2001-33149, see http://www.dcs.ed.ac.uk/home/mrg/.Google ScholarGoogle Scholar
  2. David Aspinall and Martin Hofmann. Another Type System for In-Place Update. In D. Le Metayer, editor, Programming Languages and Systems (Proc. ESOP'02), volume Springer LNCS 2305, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. K. Crary and S. Weirich. Resource bound certification. In Proc. 27th Symp. Principles of Prog. Lang. (POPL), pages 184--198. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. Flajolet, B. Salvy, and P. Zimmermann. Lambda-Upsilon-Omega: An assistant algorithms analyzer. In T. Mora, editor, Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, volume 357 of Lecture Notes in Computer Science, pages 201--212, 1989. Proceedings AAECC'6, Rome, July 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Gustavo Gómez and Yanhong A. Liu. Automatic accurate cost-bound analysis for high-level languages. In Frank Mueller and Azer Bestavros, editors, Languages, Compilers, and Tools for Embedded Systems, ACM SIGPLAN Workshop LCTES'98, Montreal, Canada. Springer, 1998. LNCS 1474. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Gustavo Gómez and Yanhong A. Liu. Automatic time-bound analysis for a higher-order language. In Proceedings of the 2002 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation, pages 75--86. ACM Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bernd Grobauer. Topics in Semantics-based Program Manipulation. PhD thesis, BRICS Aarhus, 2001.Google ScholarGoogle Scholar
  8. Martin Hofmann. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7(4):258--289, 2000. An extended abstract has appeared in Programming Languages and Systems, G. Smolka, ed., Springer LNCS, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Martin Hofmann. The strength of non size-increasing computation. 2002. Proc. ACM Symp. on Principles of Programming Languages (POPL), Portland, Oregon. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Hughes and L. Pareto. Recursion and dynamic data structures in bounded space: towards embedded ML programming. In Proc. International Conference on Functional Programming (ACM). Paris, September '99., pages 70--81, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Steffen Jost. Static prediction of dynamic space usage of linear functional programs, 2002. Diploma thesis at Darmstadt University of Technology, Department of Mathematics. Available at www.tcs.informatik.uni-muenchen.de/~jost/da_sj_28-02-2002.ps.Google ScholarGoogle Scholar
  12. Naoki Kobayashi. Quasi-linear types. In Proceedings ACM Principles of Programming Languages, pages 29--42, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. H.-W. Loidl. Granularity in Large-Scale Parallel Functional Programming. PhD thesis, Department of Computing Science, University of Glasgow, 1998.Google ScholarGoogle Scholar
  14. George Necula. Proof-carrying code. In Proc. 24th Symp. Principles of Prog. Lang. (POPL). ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Martin Odersky. Observers for linear types. In B. Krieg-Brückner, editor, ESOP '92: 4th European Symposium on Programming, Rennes, France, Proceedings, pages 390--407. Springer-Verlag, February 1992. Lecture Notes in Computer Science 582. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Lars Pareto. Types for crash prevention. PhD thesis, Chalmers University, Göteborg, Sweden, 2000.Google ScholarGoogle Scholar
  17. John C. Reynolds. Definitional interpreters for higher-order programming languages. In Proceedings of the 25th ACM National Conference, pages 717--740, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Natarajan Shankar. Efficiently executing PVS. Technical report, Computer Science Laboratory, SRI International, 1999.Google ScholarGoogle Scholar
  19. M. Tofte and J.-P. Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Leena Unnikrishnan, Scott D. Stoller, and Yanhong A. Liu. Automatic accurate live memory analysis for garbage-collected languages. In Proceedings of The Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES 2001), June 22--23, 2001 The Workshop on Optimization of Middleware and Distributed Systems (OM 2001), June 18, 2001, Snowbird, Utah, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Static prediction of heap space usage for first-order functional programs

            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 '03: Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
              January 2003
              308 pages
              ISBN:1581136285
              DOI:10.1145/604131
              • cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 38, Issue 1
                January 2003
                298 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/640128
                Issue’s Table of Contents

              Copyright © 2003 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: 15 January 2003

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • Article

              Acceptance Rates

              POPL '03 Paper Acceptance Rate24of126submissions,19%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