skip to main content
research-article

Type soundness for dependent object types (DOT)

Published:19 October 2016Publication History
Skip Abstract Section

Abstract

Scala’s type system unifies aspects of ML modules, object- oriented, and functional programming. The Dependent Object Types (DOT) family of calculi has been proposed as a new theoretic foundation for Scala and similar expressive languages. Unfortunately, type soundness has only been established for restricted subsets of DOT. In fact, it has been shown that important Scala features such as type refinement or a subtyping relation with lattice structure break at least one key metatheoretic property such as environment narrowing or invertible subtyping transitivity, which are usually required for a type soundness proof. The main contribution of this paper is to demonstrate how, perhaps surprisingly, even though these properties are lost in their full generality, a rich DOT calculus that includes recursive type refinement and a subtyping lattice with intersection types can still be proved sound. The key insight is that subtyping transitivity only needs to be invertible in code paths executed at runtime, with contexts consisting entirely of valid runtime objects, whereas inconsistent subtyping contexts can be permitted for code that is never executed.

References

  1. M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard. A functional correspondence between evaluators and abstract machines. In PPDP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. N. Amin. Dependent Object Types. PhD thesis, EPFL, 2016.Google ScholarGoogle Scholar
  3. N. Amin, S. Grütter, M. Odersky, T. Rompf, and S. Stucki. The essence of dependent object types. In WadlerFest, A List of Successes That Can Change the World: Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, 2016.Google ScholarGoogle ScholarCross RefCross Ref
  4. N. Amin, A. Moors, and M. Odersky. Dependent object types. In FOOL, 2012.Google ScholarGoogle Scholar
  5. N. Amin, T. Rompf, and M. Odersky. Foundations of pathdependent types. In OOPSLA, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. N. Amin and R. Tate. Java and Scala’s type systems are unsound: the existential crisis of null pointers. In OOPSLA, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. B. E. Aydemir, A. Bohannon, M. Fairbairn, J. N. Foster, B. C. Pierce, P. Sewell, D. Vytiniotis, G. Washburn, S. Weirich, and S. Zdancewic. Mechanized metatheory for the masses: The PoplMark Challenge. In TPHOLs, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. R. Cameron, J. Noble, and T. Wrigstad. Tribal ownership. In OOPSLA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. L. Cardelli, S. Martini, J. C. Mitchell, and A. Scedrov. An extension of system F with subtyping. Inf. Comput., 109(1/2):4– 56, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: a simple virtual class calculus. In AOSD, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In MFCS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. O. Danvy and J. Johannsen. Inter-deriving semantic artifacts for object-oriented programming. J. Comput. Syst. Sci., 76(5):302–323, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. O. Danvy, K. Millikin, J. Munk, and I. Zerny. On interderiving small-step and big-step semantics: A case study for storeless call-by-need evaluation. Theor. Comput. Sci., 435:21–42, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Dreyer and A. Rossberg. Mixin’ up the ML module system. In ICFP, 2008.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. E. Ernst. Family polymorphism. In ECOOP, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. E. Ernst. Higher-order hierarchies. In ECOOP, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  17. E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Flanagan, A. Sabry, B. F. Duba, and M. Felleisen. The essence of compiling with continuations. In PLDI, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. V. Gasiunas, M. Mezini, and K. Ostermann. Dependent classes. In OOPSLA, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J.-Y. Girard. Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur. 1972.Google ScholarGoogle Scholar
  21. R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In POPL, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight java: a minimal core calculus for java and gj. ACM Trans. Program. Lang. Syst., 23(3), 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. T. Jones, M. Homer, and J. Noble. Brand objects for nominal typing. In ECOOP, 2015.Google ScholarGoogle Scholar
  24. X. Leroy. Manifest types, modules and separate compilation. In POPL, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. D. Macqueen. Using dependent types to express modular structure. In POPL, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. A. Moors, F. Piessens, and M. Odersky. Safe type-level abstraction in Scala. In FOOL, 2008.Google ScholarGoogle Scholar
  27. N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In OOPSLA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Odersky. The trouble with types. Presentation at Strange Loop, 2013.Google ScholarGoogle Scholar
  29. M. Odersky. The essence of Scala. http://www.scala-lang. org/blog/2016/02/03/essence-of-scala.html, February 2016.Google ScholarGoogle Scholar
  30. M. Odersky, V. Cremet, C. Röckl, and M. Zenger. A nominal theory of objects with dependent types. In ECOOP, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  31. M. Odersky and K. Läufer. Putting type annotations to work. In POPL, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Odersky and T. Rompf. Unifying functional and objectoriented programming with Scala. Commun. ACM, 57(4):76– 86, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. B. C. Pierce. Types and programming languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. B. C. Pierce and D. N. Turner. Local type inference. ACM Trans. Program. Lang. Syst., 22(1):1–44, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. J. C. Reynolds. Towards a theory of type structure. In Symposium on Programming, volume 19 of Lecture Notes in Computer Science, pages 408–423. Springer, 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. T. Rompf and N. Amin. From F to DOT: Type soundness proofs with definitional interpreters. Technical report, Purdue University, July 2015. http://arxiv.org/abs/1510.05216.Google ScholarGoogle Scholar
  37. A. Rossberg. 1ML - core and modules united (f-ing first-class modules). In ICFP, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. A. Rossberg, C. V. Russo, and D. Dreyer. F-ing modules. J. Funct. Program., 24(5):529–607, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  39. A. J. Summers. Modelling java requires state. In Proceedings of the 11th International Workshop on Formal Techniques for Java-like Programs, page 10. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. G. A. Washburn. SI-1557: Another type soundness hole. https://issues.scala-lang.org/browse/SI-1557, 2008.Google ScholarGoogle Scholar
  41. A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Inf. Comput., 115(1):38–94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type soundness for dependent object types (DOT)

    Recommendations

    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 SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 51, Issue 10
      OOPSLA '16
      October 2016
      915 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/3022671
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications
        October 2016
        915 pages
        ISBN:9781450344449
        DOI:10.1145/2983990

      Copyright © 2016 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 19 October 2016

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!