skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Reusable

Undecidability of d<: and its decidable fragments

Published:20 December 2019Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

a9-hu.webm

References

  1. 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 ScholarGoogle ScholarCross RefCross Ref
  2. Nada Amin, Adriaan Moors, and Martin Odersky. 2012. Dependent object types. In 19th International Workshop on Foundations of Object-Oriented Languages.Google ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 &amp; Applications (OOPSLA ’14). ACM, New York, NY, USA, 233–249. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. David Aspinall and Adriana Compagnoni. 2001. Subtyping dependent types. Theoretical Computer Science 266, 1 (2001), 273 – 309. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Hendrik Pieter Barendregt. 1985. The lambda calculus - its syntax and semantics. Studies in logic and the foundations of mathematics, Vol. 103. North-Holland.Google ScholarGoogle Scholar
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Luca Cardelli and Peter Wegner. 1985. On Understanding Types, Data Abstraction, and Polymorphism. ACM Comput. Surv. 17, 4 (Dec. 1985), 471–523. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Adam Chlipala. 2013. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant. The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarCross RefCross Ref
  11. 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 ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. 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 ScholarGoogle Scholar
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  19. John C. Martin. 1997. Introduction to Languages and the Theory of Computation (2nd ed.). McGraw-Hill Higher Education.Google ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarCross RefCross Ref
  22. Frank Pfenning. 2000. Structural Cut Elimination: I. Intuitionistic and Classical Logic. Information and Computation 157, 1 (2000), 84 – 141. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Benjamin C. Pierce. 1991. Programming with intersection types and bounded polymorphism. Ph.D. Dissertation. Carnegie Mellon University.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. Benjamin C. Pierce. 1997. Bounded Quantification with Bottom. Technical Report 492. Computer Science Department, Indiana University.Google ScholarGoogle Scholar
  26. Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Benjamin C. Pierce. 2004. Advanced Topics in Types and Programming Languages. The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. Agda Team. 2019. Agda 2.5.4.2.Google ScholarGoogle Scholar
  31. The Coq Development Team. 2018. The Coq Proof Assistant, version 8.8.2. Google ScholarGoogle ScholarCross RefCross Ref
  32. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Undecidability of d<: and its decidable fragments

      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

      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!