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.
- 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 ScholarDigital Library
- Andrew Appel. Foundational proof-carrying code. In 16th IEEE Symposium on Logic in Computer Science, pages 247--258, 2001.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. MIT Press, Cambridge, MA, 2nd edition, 2001.]] Google ScholarDigital Library
- Karl Crary. Toward a foundational typed assembly language. In 30th ACM Symposium on Principles of Programming Languages, pages 198--212, 2003.]] Google ScholarDigital Library
- Karl Crary and Stephanie Weirich. Flexible type analysis. In 4th ACM International Conference on Functional Programming, pages 233--248, 1999.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Dan Grossman. Type-safe multithreading in Cyclone. In ACM International Workshop on Types in Language Design and Implementation, pages 13--25, 2003.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. In 23rd ACM Symposium on Principles of Programming Languages, pages 271--283, 1996.]] Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- George Necula. Proof-carrying code. In 24th ACM Symposium on Principles of Programming Languages, pages 106--119, 1997.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Francois Pottier and Yann Régis-Gianas. Towards efficient, typed LR parsers. Submitted to thephJournal of Functional Programming, September 2004.]]Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Mads Tofte and Jean-Pierre Talpin. Region-based memory management. Information and Computation, 132(2):109--176, 1997.]] Google ScholarDigital Library
- Mitchell Wand. Type inference for record concatenation and multiple inheritance. Information and Computation, 93:1--15, 1991.]] Google ScholarDigital Library
- Andrew Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Hongwei Xi and Robert Harper. A dependently typed assembly language. In 6th ACM International Conference on Functional Programming, pages 169--180, 2001.]] Google ScholarDigital Library
- Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In 26th ACM Symposium on Principles of Programming Languages, pages 214--227, 1999.]] Google ScholarDigital Library
- http://www.cs.washington.edu/homes/miker/coord/.]]Google Scholar
Index Terms
- Types for describing coordinated data structures
Recommendations
Type-Indexed Data Types
MPC '02: Proceedings of the 6th International Conference on Mathematics of Program ConstructionA polytypic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of polytypic functions are the functions that can be derived in Haskell, such as show, read, and '=='. More advanced ...
Type-indexed data types
Special issue on mathematics of program construction (MPC 2002)A polytypic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of polytypic functions are the functions that can be derived in Haskell, such as show, read, and '=='. More advanced ...
Polymorphic type inference and abstract data types
Many statically typed programming languages provide an abstract data type construct, such as the module in Modula-2. However, in most of these languages, implementations of abstract data types are not first-class values. Thus, they cannot be assigned to ...
Comments