Skip to main content

Alias Types for Recursive Data Structures

  • Conference paper
  • First Online:
Types in Compilation (TIC 2000)

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

Included in the following conference series:

Abstract

Linear type systems permit programmers to deallocate or explicitly recycle memory, but are severely restricted by the fact that they admit no aliasing. This paper describes a pseudo-linear type system that allows a degree of aliasing and memory reuse as well as the ability to define complex recursive data structures. Our type system can encode conventional linear data structures such as linear lists and trees as well as more sophisticated data structures including cyclic and doubly-linked lists and trees. In the latter cases, our type system is expressive enough to represent pointer aliasing and yet safely permit destructive operations such as object deallocation.We demonstrate the flexibility of our type system by encoding two common space-conscious algorithms: destination-passing style and Deutsch-Schorr-Waite or “link-reversal” traversal algorithms.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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. Samson Abramsky. Computational interpretations of linear logic. Theoretical Computer Science, 111:3–57, 1993.

    Article  MATH  MathSciNet  Google Scholar 

  2. Alexander Aiken, Manuel Fähndrich, and Raph Levien. Better static memory management: Improving region-based analysis of higher-order languages. In ACM Conference on Programming Language Design and Implementation, pages 174–185, La Jolla, California, 1995.

    Google Scholar 

  3. Erik Barendsen and Sjaak Smetsers. Conventional and uniqueness typing in graph rewrite systems (extended abstract). In Thirteenth Conference on the Foundations of Software Technology and Theoretical Computer Science, pages 41–51, Bombay, 1993. In Shyamasundar, ed., Springer-Verlag, LNCS 761.

    Google Scholar 

  4. Michael Benedikt, Thomas Reps, and Mooly Sagiv. A decidable logic for describing linked data structures. In European Symposium on Programming, pages 2–19, Amsterdam, March 1999.

    Google Scholar 

  5. Lars Birkedal, Mads Tofte, and Magnus Vejlstrup. From region inference to von Neumann machines via region representation inference. In Twenty-Third ACM Symposium on Principles of Programming Languages, pages 171–183, St. Petersburg, January 1996.

    Google Scholar 

  6. Rodney M. Burstall. Some techniques for proving correctness of programs which alter data structures. In Bernard Meltzer and Donald Michie, editors, Machine Intelligence, pages 23–50, Edinburgh, 1972. Edinburgh University Press.

    Google Scholar 

  7. Perry Cheng and Chris Okasaki. Destination-passing style and generational garbage collection. Unpublished., November 1996.

    Google Scholar 

  8. Jawahar Chirimar, Carl A. Gunter, and Jon G. Riecke. Reference counting as a computational interpretation of linear logic. Journal of Functional Programming, 6(2):195–244, March 1996. 202 D. Walker and G. Morrisett

    Article  MATH  MathSciNet  Google Scholar 

  9. Stephen Cook and Derek Oppen. An assertion language for data structures. In Second ACM Symposium on Principles of Programming Languages, pages 160–166, New York, 1975. ACM Press.

    Google Scholar 

  10. Karl Crary, David Walker, and Greg Morrisett. Typed memory management in a calculus of capabilities. In Twenty-Sixth ACM Symposium on Principles of Programming Languages, pages 262–275, San Antonio, January 1999.

    Google Scholar 

  11. Alain Deutsch. Interprocedural may-alias analysis for pointers: Beyond k-limiting. In ACM Conference on Programming Language Design and Implementation, pages 230–241, Orlando, June 1994.

    Google Scholar 

  12. Rakesh Ghiya and Laurie J. Hendren. Is it a tree, a DAG, or a cyclic graph? A shape analysis for heap-directed pointers in C. In Twenty-Third ACM Symposium on Principles of Programming Languages, pages 1–15, St. Petersburg Beach, Florida, January 1996.

    Google Scholar 

  13. Jean-Yves Girard. Linear logic. Theoretical Computer Science, 50:1–102, 1987.

    Article  MATH  MathSciNet  Google Scholar 

  14. Dan Grossman and Greg Morrisett. Scalable certi cation for typed assembly language. In ACM SIGPLAN Workshop on Types in Compilation, Montreal, September 2000.

    Google Scholar 

  15. Juan C. Guzmán and Paul Hudak. Single-threaded polymorphic lambda calculus. In Symposium on Logic in Computer Science, pages 333–343, Philadelphia, June 1990. IEEE Computer Society Press.

    Google Scholar 

  16. Robert Harper. A simplified account of polymorphic references. Information Processing Letters, 51(4):201–206, August 1994.

    Article  MATH  MathSciNet  Google Scholar 

  17. Samin Ishtiaq and Peter O’Hearn. BI as an assertion language for mutable data structures. In Twenty-Eighth ACM Symposium on Principles of Programming Languages, pages 14–26, January 2001.

    Google Scholar 

  18. Neil D. Jones and Steven Muchnick, editors. Flow analysis and optimization of Lisp-like structures. Prentice-Hall, 1981.

    Google Scholar 

  19. Naoki Kobayashi. Quasi-linear types. In Twenty-Sixth ACM Symposium on Principles of Programming Languages, pages 29–42, San Antonio, January 1999.

    Google Scholar 

  20. Yves Lafont. The linear abstract machine. Theoretical Computer Science, 59:157–180, 1988.

    Article  MATH  MathSciNet  Google Scholar 

  21. James R. Larus and Paul N. Hil nger. Detecting conflicts between structure accesses. In ACM Conference on Programming Language Design and Implementation, pages 24–31, June 1988.

    Google Scholar 

  22. James Richard Larus. Restructuring Symbolic Programs for Concurrent Execution on Multiprocessors. PhD thesis, University of California at Berkeley, May 1989. Available as Berkeley technical report UCB/CSD 89/502.

    Google Scholar 

  23. Erik Meijer, Maarten Fokkinga, and Ross Paterson. Functional programming with bananas, lenses, envelopes, and barbed wire. In ACM Conference on Functional Programming and Computer Architecture, volume 523 of Lecture Notes in Computer Science, Berlin, 1991. Springer-Verlag.

    Google Scholar 

  24. Y. Minamide. A functional representation of data structures with a hole. In Twenty-Fifth ACM Symposium on Principles of Programming Languages, pages 75–84, San Diego, January 1998.

    Google Scholar 

  25. Y. Minamide, G. Morrisett, and R. Harper. Typed closure conversion. In Twenty-Third ACM Symposium on Principles of Programming Languages, pages 271–283, St. Petersburg, January 1996.

    Google Scholar 

  26. Bernhard Möller. Towards pointer algebra. Science of Computer Programming, 21:57–90, 1993. Alias Types for Recursive Data Structures 203

    Article  MATH  MathSciNet  Google Scholar 

  27. Greg Morrisett, Karl Crary, Neal Glew, and David Walker. Stack-based Typed Assembly Language. In Xavier Leroy and Atsushi Ohori, editors, Second International Workshop on Types in Compilation, volume 1473 of Lecture Notes in Computer Science, pages 28–52, Kyoto, March 1998. Springer-Verlag.

    Chapter  Google Scholar 

  28. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to Typed Assembly Language. In Twenty-Fifth ACM Symposium on Principles of Programming Languages, pages 85–97, San Diego, January 1998.

    Google Scholar 

  29. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to Typed Assembly Language. ACM Transactions on Programming Languages and Systems, 3(21):528–569, May 1999.

    Google Scholar 

  30. George Necula and Peter Lee. The design and implementation of a certifying compiler. In ACM Conference on Programming Language Design and Implementation, pages 333–344, Montreal, June 1998.

    Google Scholar 

  31. John C. Reynolds. Syntactic control of interference. In Fifth ACM Symposium on Principles of Programming Languages, pages 39–46, Tucson, 1978.

    Google Scholar 

  32. John C. Reynolds. Intuitionistic reasoning about shared mutable data structure. In Millennial Perspectives in Computer Science, Palgrove, 2000.

    Google Scholar 

  33. Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Solving shape-analysis problems in languages with destructive updating. ACM Transactions on Programming Languages and Systems, 20(1):1–50, January 1998.

    Article  Google Scholar 

  34. Mooly Sagiv, Thomas Reps, and Reinhard Wilhelm. Parametric shape analysis via 3-valued logic. In Twenty-Sixth ACM Symposium on Principles of Programming Languages, pages 105–118, San Antonio, January 1999.

    Google Scholar 

  35. H. Schorr and W. M. Waite. An efficient machine-independent procedure for garbage collection in various list structures. Communications of the ACM, 10(8):501–506, August 1967.

    Article  MATH  Google Scholar 

  36. Frederick Smith, David Walker, and Greg Morrisett. Alias types. In European Symposium on Programming, volume 1782 of Lecture Notes in Computer Science, pages 366–381, Berlin, March 2000. Springer-Verlag.

    Google Scholar 

  37. Johnathan Sobel and Daniel Friedman. Recycling continuations. In ACM International Conference on Functional Programming, pages 251–260, Baltimore, September 1998.

    Google Scholar 

  38. TALx86. See http://www.cs.cornell.edu/talc for an implementation of Typed Assembly Language based on Intel’s IA32 architecture.

  39. Mads Tofte and Jean-Pierre Talpin. Implementation of the typed call-by-value λ-calculus using a stack of regions. In Twenty-First ACM Symposium on Principles of Programming Languages, pages 188–201, Portland, Oregon, January 1994.

    Google Scholar 

  40. David N. Turner, Philip Wadler, and Christian Mossin. Once upon a type. In ACM International Conference on Functional Programming and Computer Architecture, San Diego, CA, June 1995.

    Google Scholar 

  41. Philip Wadler. Listlessness is Better than Laziness. PhD thesis, Carnegie Mellon University, August 1985. Available as Carnegie Mellon University technical report CMU-CS-85-171.

    Google Scholar 

  42. Philip Wadler. Linear types can change the world! In M. Broy and C. Jones, editors, Programming Concepts and Methods, Sea of Galilee, Israel, April 1990. North Holland. IFIP TC 2 Working Conference.

    Google Scholar 

  43. David Walker. Typed Memory Management. PhD thesis, Cornell University, January 2001. To appear.

    Google Scholar 

  44. Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994. 204 D. Walker and G. Morrisett

    Article  MATH  MathSciNet  Google Scholar 

  45. Hongwei Xi. Dependent Types in Practical Programming. PhD thesis, Carnegie Mellon University, 1999.

    Google Scholar 

  46. Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In Twenty-Sixth ACM Symposium on Principles of Programming Languages, pages 214–227, San Antonio, TX, January 1999.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2001 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Walker, D., Morrisett, G. (2001). Alias Types for Recursive Data Structures. In: Harper, R. (eds) Types in Compilation. TIC 2000. Lecture Notes in Computer Science, vol 2071. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45332-6_7

Download citation

  • DOI: https://doi.org/10.1007/3-540-45332-6_7

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-42196-2

  • Online ISBN: 978-3-540-45332-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics