Abstract
Dependent Object Types (DOT) is a calculus with path dependent types, intersection types, and object self-references, which serves as the core calculus of Scala 3. Although the calculus has been proven sound, it remains open whether type checking in DOT is decidable. In this paper, we establish undecidability proofs of type checking and subtyping of D<:, a syntactic subset of DOT. It turns out that even for D<:, undecidability is surprisingly difficult to show, as evidenced by counterexamples for past attempts. To prove undecidability, we discover an equivalent definition of the D<: subtyping rules in normal form. Besides being easier to reason about, this definition makes the phenomenon of subtyping reflection explicit as a single inference rule. After removing this rule, we discover two decidable fragments of D<: subtyping and identify algorithms to decide them. We prove soundness and completeness of the algorithms with respect to the fragments, and we prove that the algorithms terminate. Our proofs are mechanized in a combination of Coq and Agda.
Supplemental Material
- Nada Amin, Samuel Grütter, Martin Odersky, Tiark Rompf, and Sandro Stucki. 2016. The Essence of Dependent Object Types. In A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday (Lecture Notes in Computer Science), Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella (Eds.), Vol. 9600. Springer, 249–272. Google Scholar
Cross Ref
- 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 and Tiark Rompf. 2017. Type soundness proofs with definitional interpreters. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017. ACM, 666–679. http://dl.acm.org/citation.cfm?id=3009866Google Scholar
Digital Library
- Nada Amin, Tiark Rompf, and Martin Odersky. 2014. Foundations of Path-dependent Types. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’14). ACM, New York, NY, USA, 233–249. Google Scholar
Digital Library
- David Aspinall and Adriana Compagnoni. 2001. Subtyping dependent types. Theoretical Computer Science 266, 1 (2001), 273 – 309. Google Scholar
Digital Library
- Hendrik Pieter Barendregt. 1985. The lambda calculus - its syntax and semantics. Studies in logic and the foundations of mathematics, Vol. 103. North-Holland.Google Scholar
- L. Cardelli, S. Martini, J.C. Mitchell, and A. Scedrov. 1994. An Extension of System F with Subtyping. Information and Computation 109, 1 (1994), 4 – 56. Google Scholar
Digital Library
- Luca Cardelli and Peter Wegner. 1985. On Understanding Types, Data Abstraction, and Polymorphism. ACM Comput. Surv. 17, 4 (Dec. 1985), 471–523. Google Scholar
Digital Library
- Adam Chlipala. 2013. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant. The MIT Press.Google Scholar
Digital Library
- Pierre-Louis Curien and Giorgio Ghelli. 1990. Coherence of Subsumption. In CAAP ’90, 15th Colloquium on Trees in Algebra and Programming, Copenhagen, Denmark, May 15-18, 1990, Proceedings (Lecture Notes in Computer Science), André Arnold (Ed.), Vol. 431. Springer, 132–146. Google Scholar
Cross Ref
- Yannick Forster, Edith Heiter, and Gert Smolka. 2018. Verification of PCP-Related Computational Reductions in Coq. In Interactive Theorem Proving - 9th International Conference, ITP 2018, Oxford, UK, July 9-12, 2018 (LNCS 10895). Springer, 253–269. Preliminary version appeared as arXiv:1711.07023.Google Scholar
Cross Ref
- Yannick Forster and Dominique Larchey-Wendling. 2019. Certified Undecidability of Intuitionistic Linear Logic via Binary Stack Machines and Minsky Machines. In Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2019). ACM, New York, NY, USA, 104–117. Google Scholar
Digital Library
- Yannick Forster and Gert Smolka. 2017. Weak Call-by-Value Lambda Calculus as a Model of Computation in Coq. In Interactive Theorem Proving - 8th International Conference, ITP 2017, Brasília, Brazil, September 26-29, 2017, Proceedings (Lecture Notes in Computer Science), Mauricio Ayala-Rincón and César A. Muñoz (Eds.), Vol. 10499. Springer, 189–206. Google Scholar
Cross Ref
- Ben Greenman, Fabian Muehlboeck, and Ross Tate. 2014. Getting F-bounded polymorphism into shape. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, Edinburgh, United Kingdom - June 09 - 11, 2014, Michael F. P. O’Boyle and Keshav Pingali (Eds.). ACM, 89–99. Google Scholar
Digital Library
- Radu Grigore. 2017. Java generics are turing complete. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2017, Paris, France, January 18-20, 2017. 73–85. http://dl.acm.org/citation.cfm?id=3009871Google Scholar
Digital Library
- Zhong Sheng Hu. 2019. Decidability and Algorithmic Analysis of Dependent Object Types (DOT). Master’s thesis. University of Waterloo. http://hdl.handle.net/10012/14964Google Scholar
- Andrew Kennedy and Benjamin C. Pierce. 2007. On Decidability of Nominal Subtyping with Variance. In International Workshop on Foundations and Developments of Object-Oriented Languages (FOOL/WOOD) (international workshop on foundations and developments of object-oriented languages (fool/wood) ed.). https://www.microsoft.com/enus/research/publication/on- decidability- of- nominal- subtyping- with- variance/Google Scholar
- Julian Mackay, Alex Potanin, Lindsay Groves, and Jonathan Aldrich. 2020. Decidable Subtyping for Path Dependent Types. In Proceedings of the 47th ACM SIGPLAN Symposium on Principles of Programming Languages, POPL 2020, New Orleans, USA, January 22-24, 2020. Google Scholar
Digital Library
- John C. Martin. 1997. Introduction to Languages and the Theory of Computation (2nd ed.). McGraw-Hill Higher Education.Google Scholar
- Abel Nieto. 2017. Towards Algorithmic Typing for DOT (Short Paper). In Proceedings of the 8th ACM SIGPLAN International Symposium on Scala (SCALA 2017). ACM, New York, NY, USA, 2–7. Google Scholar
Digital Library
- Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. 2003. A Nominal Theory of Objects with Dependent Types. In ECOOP 2003 - Object-Oriented Programming, 17th European Conference, Darmstadt, Germany, July 21-25, 2003, Proceedings (Lecture Notes in Computer Science), Luca Cardelli (Ed.), Vol. 2743. Springer, 201–224. Google Scholar
Cross Ref
- Frank Pfenning. 2000. Structural Cut Elimination: I. Intuitionistic and Classical Logic. Information and Computation 157, 1 (2000), 84 – 141. Google Scholar
Digital Library
- Benjamin C. Pierce. 1991. Programming with intersection types and bounded polymorphism. Ph.D. Dissertation. Carnegie Mellon University.Google Scholar
Digital Library
- Benjamin C. Pierce. 1992. Bounded Quantification is Undecidable. In Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’92). ACM, New York, NY, USA, 305–315. Google Scholar
Digital Library
- Benjamin C. Pierce. 1997. Bounded Quantification with Bottom. Technical Report 492. Computer Science Department, Indiana University.Google Scholar
- Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press.Google Scholar
Digital Library
- Benjamin C. Pierce. 2004. Advanced Topics in Types and Programming Languages. 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. Proc. ACM Program. Lang. 1, OOPSLA, Article 46 (Oct. 2017), 27 pages. Google Scholar
Digital Library
- Tiark Rompf and Nada Amin. 2016. Type Soundness for Dependent Object Types (DOT). In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). ACM, New York, NY, USA, 624–641. Google Scholar
Digital Library
- Agda Team. 2019. Agda 2.5.4.2.Google Scholar
- The Coq Development Team. 2018. The Coq Proof Assistant, version 8.8.2. Google Scholar
Cross Ref
- Stefan Wehr and Peter Thiemann. 2009. On the Decidability of Subtyping with Bounded Existential Types. In Proceedings of the 7th Asian Symposium on Programming Languages and Systems (APLAS ’09). Springer-Verlag, Berlin, Heidelberg, 111–127. Google Scholar
Digital Library
Index Terms
Undecidability of d<: and its decidable fragments
Recommendations
Towards algorithmic typing for DOT (short paper)
SCALA 2017: Proceedings of the 8th ACM SIGPLAN International Symposium on ScalaThe Dependent Object Types (DOT) calculus formalizes key features of Scala. The D<: calculus is the core of DOT. To date, presentations of D<: have used declarative, as opposed to algorithmic, typing and subtyping rules. Unfortunately, algorithmic ...
Undecidability of Type-Checking in Domain-Free Typed Lambda-Calculi with Existence
CSL '08: Proceedings of the 22nd international workshop on Computer Science LogicThis paper shows undecidability of type-checking and type-inference problems in domain-free typed lambda-calculi with existential types: a negation and conjunction fragment, and an implicational fragment. These are proved by reducing type-checking and ...
The undecidability of type related problems in the type-free style System F with finitely stratified polymorphic types
We consider here a number of variations on System F that are predicative second-order systems whose terms are intermediate between the Curry style and the Church style. As in the Church style, the terms we deal with here contain the information on where ...






Comments