skip to main content
10.1145/3340672.3341115acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Decidable tag-based semantic subtyping for nominal types, tuples, and unions

Published:15 July 2019Publication History

ABSTRACT

Semantic subtyping enables simple, set-theoretical reasoning about types by interpreting a type as the set of its values. Previously, semantic subtyping has been studied primarily in the context of statically typed languages with structural typing. In this paper, we explore the applicability of semantic subtyping in the context of a dynamic language with nominal types. Instead of static type checking, dynamic languages rely on run-time checking of type tags associated with values, so we propose using the tags for semantic subtyping. We base our work on a fragment of the Julia language and present tag-based semantic subtyping for nominal types, tuples, and unions, where types are interpreted set-theoretically as sets of type tags. The proposed subtyping relation is shown to be decidable, and a corresponding analytic definition is provided. The implications of using semantic subtyping for multiple dispatch are also discussed.

References

  1. Eric Allen, Justin Hilburn, Scott Kilpatrick, Victor Luchangco, Sukyoung Ryu, David Chase, and Guy Steele. 2011. Type Checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance. SIGPLAN Not. 46, 10 (Oct. 2011), 973--992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Davide Ancona and Andrea Corradi. 2016. Semantic Subtyping for Imperative Object-oriented Languages. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016). ACM, New York, NY, USA, 568--587. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Julia Belyakova. 2018. Coq mechanization of MiniJl. https://github.com/julbinb/ftfjp-2019/tree/master/MechanizationGoogle ScholarGoogle Scholar
  4. Jeff Bezanson. 2015. Abstraction in technical computing.Google ScholarGoogle Scholar
  5. Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B Shah. 2017. Julia: A fresh approach to numerical computing. SIAM review 59, 1 (2017), 65--98.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Giuseppe Castagna, Giorgio Ghelli, and Giuseppe Longo. 1992. A Calculus for Overloaded Functions with Subtyping. In Proceedings of the 1992 ACM Conference on LISP and Functional Programming (LFP '92). ACM, New York, NY, USA, 182--192. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Craig Chambers. 1992. Object-Oriented Multi-Methods in Cecil. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP '92). Springer-Verlag, Berlin, Heidelberg, 33--56. http://dl.acm.org/citation.cfm?id=646150.679216 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Benjamin Chung, Francesco Zappa Nardelli, and Jan Vitek. 2019. Julia's efficient algorithm for subtyping unions and covariant tuples (Pearl). In 33rd European Conference on Object-Oriented Programming (ECOOP 2019). (To appear).Google ScholarGoogle Scholar
  9. Curtis Clifton, Gary T. Leavens, Craig Chambers, and Todd Millstein. 2000. MultiJava: Modular Open Classes and Symmetric Multiple Dispatch for Java. In Proceedings of the 15th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA '00). ACM, New York, NY, USA, 130--145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Ornela Dardha, Daniele Gorla, and Daniele Varacca. 2013. Semantic Subtyping for Objects and Classes. In Formal Techniques for Distributed Systems, Dirk Beyer and Michele Boreale (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 66--82.Google ScholarGoogle Scholar
  11. Alain Frisch, Giuseppe Castagna, and Véronique Benzaken. 2008. Semantic Subtyping: Dealing Set-theoretically with Function, Union, Intersection, and Negation Types. J. ACM 55, 4, Article 19 (Sept. 2008), 64 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Haruo Hosoya and Benjamin C. Pierce. 2003. XDuce: A Statically Typed XML Processing Language. ACM Trans. Internet Technol. 3, 2 (May 2003), 117--148. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Haruo Hosoya, Jérôme Vouillon, and Benjamin C. Pierce. 2005. Regular Expression Types for XML. ACM Trans. Program. Lang. Syst. 27, 1 (Jan. 2005), 46--90. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Gavin King. 2017. The Ceylon Language Specification, Version 1.3. https://ceylon-lang.org/documentation/1.3/spec/Google ScholarGoogle Scholar
  15. Gary T. Leavens and Todd D. Millstein. 1998. Multiple Dispatch As Dispatch on Tuples. In Proceedings of the 13th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA '98). ACM, New York, NY, USA, 374--387. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Per Martin-öf. 1994. Analytic and Synthetic Judgements in Type Theory. Springer Netherlands, Dordrecht, 87--99.Google ScholarGoogle Scholar
  17. Fabian Muehlboeck and Ross Tate. 2018. Empowering Union and Intersection Types with Integrated Subtyping. Proc. ACM Program. Lang. 2, OOPSLA, Article 112 (Oct. 2018), 29 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Gyunghee Park, Jaemin Hong, Guy L. Steele Jr., and Sukyoung Ryu. 2019. Polymorphic Symmetric Multiple Dispatch with Variance. Proc. ACM Program. Lang. 3, POPL, Article 11 (Jan. 2019), 28 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Francesco Zappa Nardelli, Julia Belyakova, Artem Pelenitsyn, Benjamin Chung, Jeff Bezanson, and Jan Vitek. 2018. Julia Subtyping: A Rational Reconstruction. Proc. ACM Program. Lang. 2, OOPSLA, Article 113 (Oct. 2018), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Decidable tag-based semantic subtyping for nominal types, tuples, and unions

    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
    • Published in

      cover image ACM Other conferences
      FTfJP '19: Proceedings of the 21st Workshop on Formal Techniques for Java-like Programs
      July 2019
      38 pages
      ISBN:9781450368643
      DOI:10.1145/3340672

      Copyright © 2019 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 15 July 2019

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate51of75submissions,68%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader