Skip to main content

Typing with Conditions and Guarantees for Functional In-place Update

  • Conference paper
  • First Online:
Types for Proofs and Programs (TYPES 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2646))

Included in the following conference series:

Abstract

Hofmann’s LFPL is a functional language with constructs that can be interpreted as referring to heap locations. In this view, the language is suitable for expressing and verifying in-place update algorithms. Correctness of in-place evaluation is guaranteed by a linear typing. As linearity prevents sharing on the heap, LFPL rejects many sound, natural in-place update algorithms with sharing. Recently, Aspinall and Hofmann added usage aspects to parameters of terms in first-order LFPL in order to type-check sound non-linear programs. Nevertheless, soundness of this system has not been fully established.

We show a more subtle meaning of the usage aspects as pre-conditions and (rely-)guarantees about the heap layout before and after evaluation. This interpretation allows a manageable proof of soundness for Aspinall and Hofmann’s system. Secondly, we present an algorithm for inferring the strongest sound usage aspects for typable recursive programs. We outline two other annotated typings of LFPL as systems inferring preconditions and (rely-)guarantees, both extending usage aspects. One is Atkey’s system based on explicit indication of sharing among parameters in typing contexts and the other one is a system by the author which admits LFPL programs in which datatypes share at different layers. The latter is based on the author’s conditions-and-guarantees approach to usage aspects.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. David Aspinall and Martin Hofmann. Another type system for in-place update. In D. Le Métayer, editor, Programming Languages and Systems, Proceedings of 11th European Symposium on Programming, pages 36–52. Springer-Verlag, 2002. Lecture Notes in Computer Science 2305.

    Chapter  Google Scholar 

  2. Robert Atkey. First year progress report and thesis proposal: Type systems with explicit sharing. Available from: http://www.dcs.ed.ac.uk/home/roba, August 2002.

  3. Robert Atkey. LFPL with explicit sharing and destruction. An unpublished draft, June 2002.

    Google Scholar 

  4. Juan C. Guzmán and Paul Hudak. Single-threaded polymorphic lambda calculus. In Proceedings of the Fifth Annual IEEE Symposium on Logic in Computer Science, pages 333–343, 1990.

    Google Scholar 

  5. Martin Hofmann. Linear types and non size-increasing polynomial time computation. In Logic in Computer Science (LICS), pages 464–476. Computer Society Press, 1999.

    Google Scholar 

  6. Martin Hofmann. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7(4):258–289, 2000.

    MATH  MathSciNet  Google Scholar 

  7. Martin Hofmann. The strength of non size-increasing computation. In Proceedings of 17th Annual IEEE Symposium on Logic in Computer Science, 2002.

    Google Scholar 

  8. Martin Hofmann and Steffen Jost. Static prediction of heap space usage for firstorder functional programs. In 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’ 03), January 2003.

    Google Scholar 

  9. Steffen Jost. Static prediction of dynamic space usage of linear functional programs. Master’s thesis, Technische Universität Darmstadt, Fachbereich Mathematik, 2002.

    Google Scholar 

  10. C. Kirkegaard, R. Atkey, M. Konečný, D. Aspinall, and M. Hofmann. Prototype compilers with resource-bounded type systems. Available from: http://www.dcs.ed.ac.uk/home/resbnd/prototypes/, 2000–2003.

  11. Michal Konečný. LFPL with types for deep sharing. Technical Report EDI-INFRR-157, LFCS, Division of Informatics, University of Edinburgh, October 2002.

    Google Scholar 

  12. Michal Konečný. Typing with conditions and guarantees in LFPL. Technical Report EDI-INF-RR-0151, LFCS, Division of Informatics, University of Edinburgh, October 2002.

    Google Scholar 

  13. P. O’Hearn and D. Pym. The logic of bunched implications. Bulletin of Symbolic Logic, 5(2): 215–243, 1999.

    Article  MATH  MathSciNet  Google Scholar 

  14. P. W. O’Hearn, A. J. Power, M. Takeyama, and R. D. Tennent. Syntactic control of interference revisited. Theoretical Computer Science, 228:211–252, 1999.

    Article  MATH  MathSciNet  Google Scholar 

  15. Peter W. O’Hearn. On bunched typing. To Appear in the Journal of Functional Programming, 2002.

    Google Scholar 

  16. John C. Reynolds. Syntactic control of interference. In Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages, pages 39–46. ACM Press, 1978.

    Google Scholar 

  17. John C. Reynolds. Syntactic control of interference, part 2. In G. Ausiello, M. Dezani-Ciancaglini, and S. Ronchi Della Rocca, editors, Automata, Languages and Programming, 16th International Colloquium, pages 704–722. Springer-Verlag, 1989. Lecture Notes in Computer Science 372.

    Chapter  Google Scholar 

  18. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In Proceedings of 17th Annual IEEE Symposium on Logic in Computer Science, 2002.

    Google Scholar 

  19. David Walker and Greg Morrisett. Alias types. In ESOP 2000, pages 366–381, 2000. Lecture Notes in Computer Science 1782.

    Google Scholar 

  20. David Walker and Greg Morrisett. Alias types for recursive data structures. In Types in Compilation 2000, pages 177–206, 2001. Lecture Notes in Computer Science 2071.

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Konečný, M. (2003). Typing with Conditions and Guarantees for Functional In-place Update. In: Geuvers, H., Wiedijk, F. (eds) Types for Proofs and Programs. TYPES 2002. Lecture Notes in Computer Science, vol 2646. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-39185-1_11

Download citation

  • DOI: https://doi.org/10.1007/3-540-39185-1_11

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-14031-3

  • Online ISBN: 978-3-540-39185-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics