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.
- M. S. Ager, D. Biernacki, O. Danvy, and J. Midtgaard. A functional correspondence between evaluators and abstract machines. In PPDP, 2003. Google Scholar
Digital Library
- N. Amin. Dependent Object Types. PhD thesis, EPFL, 2016.Google Scholar
- 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 Scholar
Cross Ref
- N. Amin, A. Moors, and M. Odersky. Dependent object types. In FOOL, 2012.Google Scholar
- N. Amin, T. Rompf, and M. Odersky. Foundations of pathdependent types. In OOPSLA, 2014. Google Scholar
Digital Library
- N. Amin and R. Tate. Java and Scala’s type systems are unsound: the existential crisis of null pointers. In OOPSLA, 2016. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- N. R. Cameron, J. Noble, and T. Wrigstad. Tribal ownership. In OOPSLA, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Clarke, S. Drossopoulou, J. Noble, and T. Wrigstad. Tribe: a simple virtual class calculus. In AOSD, 2007. Google Scholar
Digital Library
- V. Cremet, F. Garillot, S. Lenglet, and M. Odersky. A core calculus for Scala type checking. In MFCS, 2006. Google Scholar
Digital Library
- O. Danvy and J. Johannsen. Inter-deriving semantic artifacts for object-oriented programming. J. Comput. Syst. Sci., 76(5):302–323, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Dreyer and A. Rossberg. Mixin’ up the ML module system. In ICFP, 2008.Google Scholar
Digital Library
- E. Ernst. Family polymorphism. In ECOOP, 2001. Google Scholar
Digital Library
- E. Ernst. Higher-order hierarchies. In ECOOP, 2003.Google Scholar
Cross Ref
- E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL, 2006. Google Scholar
Digital Library
- C. Flanagan, A. Sabry, B. F. Duba, and M. Felleisen. The essence of compiling with continuations. In PLDI, 1993. Google Scholar
Digital Library
- V. Gasiunas, M. Mezini, and K. Ostermann. Dependent classes. In OOPSLA, 2007. Google Scholar
Digital Library
- J.-Y. Girard. Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur. 1972.Google Scholar
- R. Harper and M. Lillibridge. A type-theoretic approach to higher-order modules with sharing. In POPL, 1994. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- T. Jones, M. Homer, and J. Noble. Brand objects for nominal typing. In ECOOP, 2015.Google Scholar
- X. Leroy. Manifest types, modules and separate compilation. In POPL, 1994. Google Scholar
Digital Library
- D. Macqueen. Using dependent types to express modular structure. In POPL, 1986. Google Scholar
Digital Library
- A. Moors, F. Piessens, and M. Odersky. Safe type-level abstraction in Scala. In FOOL, 2008.Google Scholar
- N. Nystrom, S. Chong, and A. C. Myers. Scalable extensibility via nested inheritance. In OOPSLA, 2004. Google Scholar
Digital Library
- M. Odersky. The trouble with types. Presentation at Strange Loop, 2013.Google Scholar
- M. Odersky. The essence of Scala. http://www.scala-lang. org/blog/2016/02/03/essence-of-scala.html, February 2016.Google Scholar
- M. Odersky, V. Cremet, C. Röckl, and M. Zenger. A nominal theory of objects with dependent types. In ECOOP, 2003.Google Scholar
Cross Ref
- M. Odersky and K. Läufer. Putting type annotations to work. In POPL, 1996. Google Scholar
Digital Library
- M. Odersky and T. Rompf. Unifying functional and objectoriented programming with Scala. Commun. ACM, 57(4):76– 86, 2014. Google Scholar
Digital Library
- B. C. Pierce. Types and programming languages. MIT Press, 2002. Google Scholar
Digital Library
- B. C. Pierce and D. N. Turner. Local type inference. ACM Trans. Program. Lang. Syst., 22(1):1–44, 2000. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- A. Rossberg. 1ML - core and modules united (f-ing first-class modules). In ICFP, 2015. Google Scholar
Digital Library
- A. Rossberg, C. V. Russo, and D. Dreyer. F-ing modules. J. Funct. Program., 24(5):529–607, 2014.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- G. A. Washburn. SI-1557: Another type soundness hole. https://issues.scala-lang.org/browse/SI-1557, 2008.Google Scholar
- A. K. Wright and M. Felleisen. A syntactic approach to type soundness. Inf. Comput., 115(1):38–94, 1994. Google Scholar
Digital Library
Index Terms
Type soundness for dependent object types (DOT)
Recommendations
Type soundness for dependent object types (DOT)
OOPSLA 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsScala’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. ...
Scala step-by-step: soundness for DOT with step-indexed logical relations in Iris
The metatheory of Scala’s core type system—the Dependent Object Types (DOT) calculus—is hard to extend, like the metatheory of other type systems combining subtyping and dependent types. Soundness of important Scala features therefore remains an open ...
A simple soundness proof for dependent object types
Dependent Object Types (DOT) is intended to be a core calculus for modelling Scala. Its distinguishing feature is abstract type members, fields in objects that hold types rather than values. Proving soundness of DOT has been surprisingly challenging, ...







Comments