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

Types for describing coordinated data structures

Published:10 January 2005Publication History

ABSTRACT

Coordinated data structures are sets of (perhaps unbounded) data structures where the nodes of each structure may share abstract types with the corresponding nodes of the other structures. For example, consider a list of arguments, and a separate list of functions, where the n-th function of the second list should be applied only to the n-th argument of the first list. We can guarantee that this invariant is obeyed by coordinating the two lists, such that the type of the n-th argument is existentially Quantified and identical to the argument type of the n-th function. In this paper, we describe a minimal set of features sufficient for a type system to support coordinated data structures. We also demonstrate that two known type systems (Crary and Weirich's LX [6] and Xi, Chen and Chen's guarded recursive datatypes [24]) have these features, even though the systems were developed for other purposes. We illustrate the power of coordinated data structures as a programming idiom with three examples: (1) a list of function closures stored as a list of environments and a separate list of code pointers, (2) a "tagless" list, and (3) a red-black tree where the values and colors are stored in separate trees that are guaranteed to have the same shape.

References

  1. Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In 4th ACM Symposium on Principles of Programming Languages, pages 163--173, New York, NY, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Andrew Appel. Foundational proof-carrying code. In 16th IEEE Symposium on Logic in Computer Science, pages 247--258, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Juan Chen, Dinghao Wu, Andrew W. Appel, and Hai Fang. A provably sound TAL for back-end optimization. In ACM Conference on Programming Language Design and Implementation, pages 208--219, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. MIT Press, Cambridge, MA, 2nd edition, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Karl Crary. Toward a foundational typed assembly language. In 30th ACM Symposium on Principles of Programming Languages, pages 198--212, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Karl Crary and Stephanie Weirich. Flexible type analysis. In 4th ACM International Conference on Functional Programming, pages 233--248, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Cormac Flanagan and Martín Abadi. Types for safe locking. In 8th European Symposium on Programming, volume 1576 of Lecture Notes in Computer Science, pages 91--108. Springer-Verlag, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Dan Grossman. Type-safe multithreading in Cyclone. In ACM International Workshop on Types in Language Design and Implementation, pages 13--25, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Dan Grossman, Greg Morrisett, Trevor Jim, Michael Hicks, Yanling Wang, and James Cheney. Region-based memory management in Cyclone. In ACM Conference on Programming Language Design and Implementation, pages 282--293, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Nadeem Hamid, Zhong Shao, Valery Trifonov, Stefan Monnier, and Zhaozhong Ni. A syntactic approach to foundational proof-carrying code. In 17th IEEE Symposium on Logic in Computer Science, pages 89--100, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Ralf Hinze. Fun with phantom types. In Jeremy Gibbons and Oege de Moor, editors, The Fun of Programming, pages 245--262. Palgrave Macmillan, 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  12. Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. In 23rd ACM Symposium on Principles of Programming Languages, pages 271--283, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Greg Morrisett, Karl Crary, Neal Glew, Dan Grossman, Richard Samuels, Frederick Smith, David Walker, Stephanie Weirich, and Steve Zdancewic. TALx86: A realistic typed assembly language. In 2nd ACM Workshop on Compiler Support for System Software, pages 25--35, 1999. INRIA Technical Report 0288, 1999.]]Google ScholarGoogle Scholar
  14. Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to typed assembly language. ACM Transactions on Programming Languages and Systems, 21(3):528--569, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. George Necula. Proof-carrying code. In 24th ACM Symposium on Principles of Programming Languages, pages 106--119, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Chris Okasaki. From fast exponentiation to sQuare matrices: An adventure in types. In 4th ACM International Conference on Functional Programming, pages 28--35, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Francois Pottier and Nadji Gauthier. Polymorphic typed defunctionalization. In Proceedings of the 31st ACM Symposium on Principles of Programming Languages (POPL'04), pages 89--98, Venice, Italy, January 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Francois Pottier and Yann Régis-Gianas. Towards efficient, typed LR parsers. Submitted to thephJournal of Functional Programming, September 2004.]]Google ScholarGoogle Scholar
  19. John Reynolds. Separation logic: A logic for shared mutable data structures. In 17th IEEE Symposium on Logic in Computer Science, pages 55--74, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Michael F. Ringenburg and Dan Grossman. Type safety and erasure proofs for "A type system for coordinated data structures". Technical Report 2004-07-03, University of Washington, 2004.]]Google ScholarGoogle Scholar
  21. Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Mitchell Wand. Type inference for record concatenation and multiple inheritance. Information and Computation, 93:1--15, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Andrew Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded recursive datatype constructors. In 30th ACM Symposium on Principles of Programming Languages, pages 224--235, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Hongwei Xi and Robert Harper. A dependently typed assembly language. In 6th ACM International Conference on Functional Programming, pages 169--180, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In 26th ACM Symposium on Principles of Programming Languages, pages 214--227, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. http://www.cs.washington.edu/homes/miker/coord/.]]Google ScholarGoogle Scholar

Index Terms

  1. Types for describing coordinated data structures

    Recommendations

    Reviews

    James Curtis Miller

    This paper is concerned with the idea of extending the typing system of a programming language to include the idea of sets of data structures, where corresponding nodes within the structures must coordinate. An example of a place where this idea could be useful would be in adding new fields within the context of legacy code. The paper discusses adding this in the context of programming language theory, using λ-calculus. This will probably make the paper difficult for most individuals who do not have a background in programming language research. The paper is divided into several sections. First, the authors describe how to implement coordinated data structures as extensions to a polymorphic typed λ-calculus. Following that, they create a small programming language to demonstrate how to implement their extensions. The syntax and operational semantics are presented. The authors support a Web site in conjunction with this paper that has a downloadable interpreter (written in O'Caml) for the language created, as well as several example programs. Initially, a subset of the final language is discussed. Next, the authors show that two existing languages, LX and guarded recursive datatypes, also support coordinated data types. Then, the authors examine how their results interact with singleton-integer types, and present the full language and an example (the code is available from the authors' Web site). While this paper requires a good deal of background knowledge from the reader, it is quite interesting, and worthwhile reading for people interested in programming languages.

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    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
      TLDI '05: Proceedings of the 2005 ACM SIGPLAN international workshop on Types in languages design and implementation
      January 2005
      122 pages
      ISBN:1581139993
      DOI:10.1145/1040294

      Copyright © 2005 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: 10 January 2005

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate11of26submissions,42%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader