Abstract
Path dependent types have long served as an expressive component of the Scala programming language. They allow for the modelling of both bounded polymorphism and a degree of nominal subtyping. Nominality in turn provides the ability to capture first class modules. Thus a single language feature gives rise to a rich array of expressiveness. Recent work has proven path dependent types sound in the presence of both intersection and recursive types, but unfortunately typing remains undecidable, posing problems for programmers who rely on the results of type checkers. The Wyvern programming language is an object oriented language with path dependent types, recursive types and first class modules. In this paper we define two variants of Wyvern that feature decidable typing, along with machine checked proofs of decidability. Despite the restrictions, our approaches retain the ability to encode the parameteric polymorphism of Java generics along with many idioms of the Scala module system.
Supplemental Material
- Nada Amin. 2016. Dependent Object Types. Ph.D. Dissertation. Lausanne.Google Scholar
- Nada Amin, Karl Samuel Grütter, Martin Odersky, Tiark Rompf, and Sandro Stucki. 2016. The Essence of Dependent Object Types. A List of Successes That Can Change the World: Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (2016), 249–272.Google Scholar
- Nada Amin, Adriaan Moors, and Martin Odersky. 2012. Dependent object types. In 19th International Workshop on Foundations of Object-Oriented Languages.Google Scholar
- Nada Amin, Tiark Rompf, and Martin Odersky. 2014. Foundations of Path-dependent Types. In OOPSLA ’14.Google Scholar
- Edoardo Biagioni, Robert Harper, and Peter Lee. 2001. A Network Protocol Stack in Standard ML. Higher-Order and Symbolic Computation (2001).Google Scholar
- Luca Cardelli and Peter Wegner. 1985. On Understanding Types, Data Abstraction, and Polymorphism. ACM Comput. Surv. 17, 4 (1985), 471–523.Google Scholar
Digital Library
- Giuseppe Castagna and Benjamin C. Pierce. 1994. Decidable Bounded Quantification. In POPL ’94.Google Scholar
- William R. Cook. 2009. On Understanding Data Abstraction, Revisited. In OOPSLA ’09.Google Scholar
- Erik Ernst. 2001. Family Polymorphism. In Proceedings of the 15th European Conference on Object-Oriented Programming (ECOOP ’01).Google Scholar
- Ben Greenman, Fabian Muehlboeck, and Ross Tate. 2014. Getting F-bounded Polymorphism into Shape. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14).Google Scholar
Digital Library
- Radu Grigore. 2017. Java Generics Are Turing Complete. In POPL 2017.Google Scholar
- Robert Harper. 2012. Practical Foundations for Programming Languages. Cambridge University Press, New York, NY, USA.Google Scholar
Digital Library
- Jason Hu and Ondřej Lhoták. 2020. Undecidability of D < : and its Decidable Fragments. In POPL 2020.Google Scholar
- Atsushi Igarashi and Benjamin C. Pierce. 2002. Foundations for Virtual Types. Information and Computation 175, 1 (2002), 34 – 49.Google Scholar
Cross Ref
- Bent Kristensen, Ole Madsen, Birger Møller-Pedersen, and Kristen Nygaard. 1987. The BETA Programming Language. DAIMI Report Series 16, 229 (1987).Google Scholar
- O. L. Madsen and B. Moller-Pedersen. 1989. Virtual Classes: A Powerful Mechanism in Object-oriented Programming. In OOPSLA ’89.Google Scholar
- Darya Melicher, Yangqingwei Shi, Alex Potanin, and Jonathan Aldrich. 2017. A Capability-Based Module System for Authority Control. In 31st European Conference on Object-Oriented Programming (ECOOP 2017).Google Scholar
- Robin Milner, Robert Harper, David MacQueen, and Mads Tofte. 1997. The Definition of Standard ML, Revised Edition. MIT Press.Google Scholar
- Fabian Muehlboeck and Ross Tate. 2018. Empowering Union and Intersection Types with Integrated Subtyping. In OOPSLA 2018.Google Scholar
- Abel Nieto. 2017. Towards Algorithmic Typing for DOT (Short Paper). In Proc. SCALA.Google Scholar
Digital Library
- Ligia Nistor, Darya Kurilova, Stephanie Balzer, Benjamin Chung, Alex Potanin, and Jonathan Aldrich. 2013. Wyvern: A simple, typed, and pure object-oriented language. In Proceedings of the 5th Workshop on MechAnisms for SPEcialization, Generalization and inHerItance. ACM, 9–16.Google Scholar
Digital Library
- Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Stphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. 2004. The Scala language specification.Google Scholar
- Martin Odersky and Matthias Zenger. 2005. Scalable Component Abstractions. In OOPSLA ’05.Google Scholar
- Cyrus Omar, Darya Kurilova, Ligia Nistor, Benjamin Chung, Alex Potanin, and Jonathan Aldrich. 2014. Safely Composable Type-Specific Languages. In ECOOP ’14.Google Scholar
- Benjamin C. Pierce. 1992. Bounded Quantification is Undecidable. In POPL ’92.Google Scholar
- Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press.Google Scholar
Digital Library
- Marianna Rapoport, Ifaz Kabir, Paul He, and Ondřej Lhoták. 2017. A Simple Soundness Proof for Dependent Object Types. In OOPSLA 2017.Google Scholar
Digital Library
- John C. Reynolds. 1974. Towards a Theory of Type Structure. In Programming Symposium, Proceedings Colloque Sur La Programmation.Google Scholar
Cross Ref
- Tiark Rompf and Nada Amin. 2016. Type Soundness for Dependent Object Types (DOT). In OOPSLA 2016.Google Scholar
Digital Library
- Kresten Krab Thorup. 1997. Genericity in java with virtual types. In ECOOP’97 — Object-Oriented Programming, Mehmet Akşit and Satoshi Matsuoka (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 444–471.Google Scholar
- Mads Torgersen. 1998. Virtual types are statically safe. In 5th Workshop on Foundations of Object-Oriented Languages, Vol. 544. Citeseer, 1–9.Google Scholar
- Yu Xiang Zhu. 2019. Nominal Wyvern: Employing Semantic Separation for Usability. Master’s thesis. Carnegie Mellon University.Google Scholar
Index Terms
Decidable subtyping for path dependent types
Recommendations
Syntactically Restricting Bounded Polymorphism for Decidable Subtyping
Programming Languages and SystemsAbstractSubtyping of Bounded Polymorphism has long been known to be undecidable when coupled with contra-variance. While decidable forms of bounded polymorphism exist, they all sacrifice either useful properties such as contra-variance (Kernel F), or ...
Path dependent types with path-equality
Scala 2018: Proceedings of the 9th ACM SIGPLAN International Symposium on ScalaWhile the Scala type system provides expressive features like objects with type members, the lack of equality checking between path-dependent types prohibits some programming idioms. One such an example is abstract domain combinators in implementing ...
Variant parametric types: A flexible subtyping scheme for generics
We develop the mechanism of variant parametric types as a means to enhance synergy between parametric and inclusion polymorphism in object-oriented programming languages. Variant parametric types are used to control both the subtyping between different ...






Comments