skip to main content
article

Sound and complete elimination of singleton kinds

Published:01 April 2007Publication History
Skip Abstract Section

Abstract

Singleton kinds provide an elegant device for expressing type equality information resulting from modern module languages, but they can complicate the metatheory of languages in which they appear. I present a translation from a language with singleton kinds to one without, and prove this translation to be sound and complete. This translation is useful for type-preserving compilers generating typed target languages. The proof of soundness and completeness is done by normalizing type equivalence derivations using Stone and Harper's type equivalence decision procedure.

References

  1. Aspinall, D. 1994. Subtyping with singleton types. In Proceedings of the 8th International Workshop on Computer Science Logic (Kazimierz, Poland). Lecture Notes in Computer Science, vol. 933. Springer Verlag. 1--15. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Crary, K. and Weirich, S. 1999. Flexible type analysis. In Proceedings of the ACM International Conference on Functional Programming (Paris). 233--248. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Crary, K., Weirich, S., and Morrisett, G. 2002. Intensional polymorphism in type-erasure semantics. J. Function. Programm. 12, 6 (Nov.), 567--600. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Dreyer, D., Crary, K., and Harper, R. 2003. A type system for higher-order modules. In Proceedings of the 30th ACM Symposium on Principles of Programming Languages (New Orleans, LA). 236--249. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Harper, R. and Lillibridge, M. 1994. A type-theoretic approach to higher-order modules with sharing. In Proceedings of the 21st ACM Symposium on Principles of Programming Languages (Portland, OR). 123--137. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Harper, R., Mitchell, J. C., and Moggi, E. 1990. Higher-Order modules and the phase distinction. In Proceedings of the 17th ACM Symposium on Principles of Programming Languages (San Francisco). 341--354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Harper, R. and Morrisett, G. 1995. Compiling polymorphism using intensional type analysis. In Proceedings of the 22nd ACM Symposium on Principles of Programming Languages (San Francisco). 130--141. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Harper, R. and Stone, C. 2000. A type-theoretic interpretation of standard ML. In Proof, Language and Interaction: Essays in Honour of Robin Milner. MIT Press, Cambridge, MA. Extended version published as CMU Tech. Rep. CMU-CS-97-147. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Leroy, X. 1994. Manifest types, modules and separate compilation. In Proceedings of the 21st ACM Symposium on Principles of Programming Languages (Portland, OR). 109--122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Leroy, X. 1995. Applicative functors and fully transparent higher-order modules. In Proceedings of the 22nd ACM Symposium on Principles of Programming Languages (San Francisco). Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Leroy, X. 2000. A modular module system. J. Function. Programm. 10, 3. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Lillibridge, M. 1997. Translucent sums: A foundation for higher-order module systems. Ph.D. thesis, School of Computer Science, Carnegie Mellon University, Pittsburgh, Pennsylvania.Google ScholarGoogle Scholar
  13. Martin-Löf, P. 1975. An intuitionistic theory of types: Predicative part. In Proceedings of the Logic Colloquium, 1973. Studies in Logic and the Foundations of Mathematics, vol. 80. North-Holland, Amsterdam. 73--118.Google ScholarGoogle ScholarCross RefCross Ref
  14. Minamide, Y., Morrisett, G., and Harper, R. 1996. Typed closure conversion. In Proceedings of the 23rd ACM Symposium on Principles of Programming Languages (St. Petersburg, FL). 271--283. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Morrisett, G., Crary, K., Glew, N., and Walker, D. 2002. Stack-Based typed assembly language. J. Function. Programm. 12, 1 (Jan.), 43--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Morrisett, G., Walker, D., Crary, K., and Glew, N. 1999. From System F to typed assembly language. ACM Trans. Program. Lang. Syst. 21, 3 (May), 527--568. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Shao, Z. 1998. Typed cross-module compilation. In Proceedings of the ACM International Conference on Functional Programming (Baltimore, MD). 141--152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Shao, Z. 1999. Transparent modules with fully syntactic signatures. In Proceedings of the ACM International Conference on Functional Programming (Paris). 220--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Shao, Z., League, C., and Monnier, S. 1998. Implementing typed intermediate languages. In Proceedings of the ACM International Conference on Functional Programming (Baltimore, MD). 313--323. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Shao, Z., Saha, B., Trifonov, V., and Papaspyrou, N. 2002. A type system for certified binaries. In Proceedings of the 29th ACM Symposium on Principles of Programming Languages (Portland, OR). 217--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Smith, F., Walker, D., and Morrisett, G. 2000. Alias types. In European Symposium on Programming (Berlin).Google ScholarGoogle Scholar
  22. Stone, C. and Harper, R. 2004. Personal communciation.Google ScholarGoogle Scholar
  23. Stone, C. A. and Harper, R. 2000. Deciding type equivalence in a language with singleton kinds. In Proceedings of the 27th ACM Symposium on Principles of Programming Languages (Boston, MA). Extended version published as CMU Tech. Rep. CMU-CS-99-155. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Walker, D., Crary, K., and Morrisett, G. 2000. Typed memory management via static capabilities. ACM Trans. Program. Lang. Syst. 22, 4 (July). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Sound and complete elimination of singleton kinds

      Recommendations

      Reviews

      R. Clayton

      Pushing high-level information down to lower-level program representations enables manipulations such as link-time code improvement and runtime security analysis. However, high-level information carries costs not usually found at lower levels, potentially making manipulations expensive. Kinds can be thought of as types for types; singleton kinds are useful for identifying types that can be considered equivalent, a determination useful for languages with type-exporting modules. However, lower-level language representations usually don't deal with higher-order information such as kinds. This paper describes and proves a technique for translating kinds into information more amenable to lower-level language representations, or eliminating them altogether. Program types are modeled with singleton kinds via a calculus having 45 inference rules. One inference rule, the singleton elimination rule, is the key to the transformation: it asserts the equivalence of two types if one of the types is a kind of the other type. Applying the singleton elimination rule to a program model replaces claims about types and kinds with claims about equivalence between types. Over half of this paper consists of proofs of the transformation, its soundness, and its completeness. The proof page count is impressive, because the proof technique was adapted from Stone and Harper [1], allowing much of the proof's development to be farmed out. Much of what remains includes a fair amount of proof by case analysis. Although singleton-kind elimination has been implemented in a compiler, this paper, apart from a warning on exponential blow-up for naive implementations, is light on the practical aspects of this work. Online Computing Reviews Service

      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

      Full Access

      • Published in

        cover image ACM Transactions on Computational Logic
        ACM Transactions on Computational Logic  Volume 8, Issue 2
        April 2007
        196 pages
        ISSN:1529-3785
        EISSN:1557-945X
        DOI:10.1145/1227839
        Issue’s Table of Contents

        Copyright © 2007 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 April 2007
        Published in tocl Volume 8, Issue 2

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader