skip to main content

Study of the subtyping machine of nominal subtyping with variance

Published:15 October 2021Publication History
Skip Abstract Section

Abstract

This is a study of the computing power of the subtyping machine behind Kennedy and Pierce's nominal subtyping with variance. We depict the lattice of fragments of Kennedy and Pierce's type system and characterize their computing power in terms of regular, context-free, deterministic, and non-deterministic tree languages. Based on the theory, we present Treetop---a generator of C# implementations of subtyping machines. The software artifact constitutes the first feasible (yet POC) fluent API generator to support context-free API protocols in a decidable type system fragment.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

A 15-minute presentation of the paper.

References

  1. Ken Arnold, James Gosling, and David Holmes. 2006. The Java Programming Language (4 ed.). Addison-Wesley, Upper Saddle River, NJ. isbn:978-0-321-34980-4Google ScholarGoogle Scholar
  2. Henk Barendregt. 1991. Introduction to generalized type systems. J. Functional Prog., 1 (1991), 125–154. issn:0956-7968 https://doi.org/10.1017/s0956796800020025. Google ScholarGoogle ScholarCross RefCross Ref
  3. Norbert Blum and Robert Koch. 1999. Greibach Normal Form Transformation Revisited. Information and Computation, 150, 1 (1999), 112 – 118. issn:0890-5401 https://doi.org/10.1006/inco.1998.2772 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Donald D. Chamberlin and Raymond F. Boyce. 1974. SEQUEL: A Structured English Query Language. In Proc. ACM SIGFIDET Work. Data Description, Access & Control (SIGFIDET ’74). ACM, NY/USA. 249–264. isbn:9781450374156 https://doi.org/10.1145/800296.811515 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. H. Comon, M. Dauchet, R. Gilleron, C. Löding, F. Jacquemard, D. Lugiez, S. Tison, and M. Tommasi. 2007. Tree Automata Techniques and App.. Available on:. http://tata.gforge.inria.fr/Google ScholarGoogle Scholar
  6. James O. Coplien. 1996. Curiously Recurring Template Patterns. SIGS Publications, Inc., USA. 135–144. isbn:1884842372 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Kostas Ferles, Jon Stephens, and Isil Dillig. 2020. Verifying Correct Usage of Context-Free API Protocols (Extended Version). arxiv:2010.09652. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Martin Fowler. 2005. FluentInterface. https://www.martinfowler.com/bliki/FluentInterface.html (accessed August 12, 2020)Google ScholarGoogle Scholar
  9. Ferenc Gécseg and Magnus Steinby. 1997. Tree Languages. Springer-Verlag, Berlin, Heidelberg. 1–68. isbn:3540606491 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Joseph Gil and Ori Roth. 2020. Ties between Parametrically Polymorphic Type Systems and Finite Control Automata. arXiv preprint arXiv:2009.04437, arxiv:2009.04437.Google ScholarGoogle Scholar
  11. Yossi Gil and Tomer Levy. 2016. Formal language recognition with the Java type checker. In 30 Europ. Conf OO Prog. (ECOOP 2016), Shriram Krishnamurthi and Benjamin S. Lerner (Eds.) (Leibniz International Proceedings in Inf. (LIPIcs), Vol. 56). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 10:1–10:27. isbn:978-3-95977-014-9 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ECOOP.2016.10 Google ScholarGoogle Scholar
  12. Yossi Gil and Ori Roth. 2019. Fling—a fluent API generator. In 33 Europ. Conf OO Prog. (ECOOP 2019), Alastair F. Donaldson (Ed.) (Leibniz International Proceedings in Inf. (LIPIcs), Vol. 134). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 13:1–13:25. isbn:978-3-95977-111-5 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ECOOP.2019.13 Google ScholarGoogle Scholar
  13. Ben Greenman, Fabian Muehlboeck, and Ross Tate. 2014. Getting F-Bounded Polymorphism into Shape. SIGPLAN Not., 49, 6 (2014), June, 89–99. issn:0362-1340 https://doi.org/10.1145/2666356.2594308 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Sheila A. Greibach. 1965. A New Normal-Form Theorem for Context-Free Phrase Structure Grammars. J. ACM, 12, 1 (1965), Jan., 42–52. issn:0004-5411 https://doi.org/10.1145/321250.321254 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). Association for Computing Machinery, New York, NY, USA. 73–85. isbn:9781450346603 https://doi.org/10.1145/3009837.3009871 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Irène Guessarian. 1983. Pushdown tree automata. Math. Syst. Theory, 16, 1 (1983), 237–263.Google ScholarGoogle Scholar
  17. Anders Hejlsberg, Scott Wiltamuth, Peter Golde, and Mads Torgersen. 2003. The C# Programming Language (2 ed.). Addison-Wesley, Reading, MA, USA. isbn:0-321-15491-6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. 2007. Introduction to automata theory, languages, and computation (3 ed.). Pearson Addison Wesley, Boston, MA. isbn:0321455371 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Andrew Kennedy and Benjamin Pierce. 2007. On decidability of nominal subtyping with variance. In Int. Work. Found. & Devel. OO Lang. (FOOL/WOOD‘07). ACM, Nice, France. Article 5, 12 pages. http://foolwood07.cs.uchicago.edu/program/kennedy-abstract.htmlGoogle ScholarGoogle Scholar
  20. Tomoki Nakamaru and Shigeru Chiba. 2020. Generating a generic fluent API in Java. Art, Sci., & Eng. Prog., 4 (2020), Article 9, Feb., 23 pages. issn:2473-7321 https://doi.org/10.22152/programming-journal.org/2020/4/9Google ScholarGoogle Scholar
  21. Tomoki Nakamaru, Kazuhiro Ichikawa, Tetsuro Yamazaki, and Shigeru Chiba. 2017. Silverchain: a fluent API generator. In Proc. 16 ACM SIGPLAN Int. Conf Generative Prog. (GPCE’17). ACM, Vancouver, BC, Canada. 199–211. isbn:978-1-4503-5524-7 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Tomoki Nakamaru, Tomomasa Matsunaga, Tetsuro Yamazaki, Soramichi Akiyama, and Shigeru Chiba. 2020. An Empirical Study of Method Chaining in Java. In Proceedings of the 17th International Conference on Mining Software Repositories (MSR ’20). Association for Computing Machinery, New York, NY, USA. 93–102. isbn:9781450375177 https://doi.org/10.1145/3379597.3387441 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. 2004. An Overview of the Scala Programming Language. EPFL Lausanne, Switzerland.Google ScholarGoogle Scholar
  24. Johannes Osterholzer. 2018. New Results on Context-Free Tree Languages. Ph. D. Dissertation. Technische Universität Dresden. Zellescher Weg 18 01069 Dresden. https://nbn-resolving.org/urn:nbn:de:bsz:14-qucosa-235434Google ScholarGoogle Scholar
  25. Ori Roth. 2021. Study of the Subtyping Machine of Nominal Subtyping with Variance (full version). arxiv:2109.03950. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ori Roth. 2021. Treetop: A Context-Free Fluent API Generator for C#. https://doi.org/10.5281/zenodo.5091711 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Leslie G. Valiant. 1975. General context-free recognition in less than cubic time. J. Comput. System Sci., 10, 2 (1975), 308 – 315. issn:0022-0000 https://doi.org/10.1016/S0022-0000(75)80046-8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Mirko Viroli. 2000. On the recursive generation of parametric types. DEIS-LIA-00-002, Universitá di Bologna.Google ScholarGoogle Scholar
  29. Hao Xu. 2010. EriLex: an embedded domain specific language generator. In Objects, Models, Components, Patterns, Jan Vitek (Ed.). Springer, Berlin, Heidelberg. 192–212. isbn:978-3-642-13953-6 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Tetsuro Yamazaki, Tomoki Nakamaru, Kazuhiro Ichikawa, and Shigeru Chiba. 2019. Generating a fluent API with syntax checking from an LR grammar. Proc. ACM Program. Lang., 3 (2019), Article 134, Oct., 24 pages. https://doi.org/10.1145/3360560 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Study of the subtyping machine of nominal subtyping with variance

        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!