Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

Revisiting iso-recursive subtyping

Published: 13 November 2020 Publication History

Abstract

The Amber rules are well-known and widely used for subtyping iso-recursive types. They were first briefly and informally introduced in 1985 by Cardelli in a manuscript describing the Amber language. Despite their use over many years, important aspects of the metatheory of the iso-recursive style Amber rules have not been studied in depth or turn out to be quite challenging to formalize.
This paper aims to revisit the problem of subtyping iso-recursive types. We start by introducing a novel declarative specification that we believe captures the “spirit” of Amber-style iso-recursive subtyping. Informally, the specification states that two recursive types are subtypes if all their finite unfoldings are subtypes. The Amber rules are shown to be sound with respect to this declarative specification. We then derive a sound, complete and decidable algorithmic formulation of subtyping that employs a novel double unfolding rule. Compared to the Amber rules, the double unfolding rule has the advantage of: 1) being modular; 2) not requiring reflexivity to be built in; and 3) leading to an easy proof of transitivity of subtyping. This work sheds new insights on the theory of subtyping iso-recursive types, and the new double unfolding rule has important advantages over the original Amber rules for both implementations and metatheoretical studies involving recursive types. All results are mechanically formalized in the Coq theorem prover. As far as we know, this is the first comprehensive treatment of iso-recursive subtyping dealing with unrestricted recursive types in a theorem prover.

Supplementary Material

Auxiliary Presentation Video (oopsla20main-p512-p-video.mp4)
This is a presentation of the paper Revisiting Iso-Recursive Subtyping. In this presentation, we gives a novel declarative specification for iso-recursive subtyping, gives a novel algorithmic subtyping formulation using the double unfolding rule, formalizes a typed lambda calculus with iso-recursive types and proves type soundness, and shows that our new subtyping formulation is at least as expressive as the Amber rules.

References

[1]
Roberto M Amadio and Luca Cardelli. 1993. Subtyping recursive types. ACM Transactions on Programming Languages and Systems (TOPLAS) 15, 4 ( 1993 ), 575-631.
[2]
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. Springer, 249-272.
[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. 666-679.
[4]
Andrew W Appel and Amy P Felty. 2000. A semantic model of types and machine instructions for proof-carrying code. In Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. 243-253.
[5]
Brian Aydemir, Arthur Charguéraud, Benjamin C Pierce, Randy Pollack, and Stephanie Weirich. 2008. Engineering formal metatheory. Acm sigplan notices 43, 1 ( 2008 ), 3-15.
[6]
Michael Backes, Cătălin Hriţcu, and Matteo Mafei. 2014. Union, intersection and refinement types and reasoning about type disjointness for secure protocol implementations. Journal of Computer Security 22, 2 ( 2014 ), 301-353.
[7]
Jesper Bengtson, Karthikeyan Bhargavan, Cédric Fournet, Andrew D Gordon, and Sergio Mafeis. 2011. Refinement types for secure implementations. ACM Transactions on Programming Languages and Systems (TOPLAS) 33, 2 ( 2011 ), 1-45.
[8]
Michael Brandt and Fritz Henglein. 1997. Coinductive axiomatization of recursive type equality and subtyping, Vol. 1210. 63-81. Full version in Fundamenta Informaticae, 33 : 309-338, 1998.
[9]
Peter Canning, William Cook, Walter Hill, Walter Olthof, and John C. Mitchell. 1989. F-Bounded Polymorphism for ObjectOriented Programming. In Proceedings of the Fourth International Conference on Functional Programming Languages and Computer Architecture (Imperial College, London, United Kingdom) ( FPCA 1989 ). 8.
[10]
Luca Cardelli. 1985. Amber. In LITP Spring School on Theoretical Computer Science. Springer, 21-47.
[11]
Felice Cardone. 1991. Recursive types for Fun. Theoretical Computer Science 83, 1 ( 1991 ), 39-56.
[12]
Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Elena Giachino, and Luca Padovani. 2009. Foundations of session types. In Proceedings of the 11th ACM SIGPLAN conference on Principles and practice of declarative programming. 219-230.
[13]
Giuseppe Castagna and Alain Frisch. 2005. A Gentle Introduction to Semantic Subtyping. In Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP '05).
[14]
Tzu-Chun Chen, Mariangiola Dezani-Ciancaglini, and Nobuko Yoshida. 2014. On the preciseness of subtyping in session types. In Proceedings of the 16th International Symposium on Principles and Practice of Declarative Programming. 135-146.
[15]
Ravi Chugh. 2015. IsoLATE: A type system for self-recursion. In European Symposium on Programming Languages and Systems. Springer, 257-282.
[16]
Dario Colazzo and Giorgio Ghelli. 1999. Subtyping recursive types in kernel fun. In Proceedings. 14th Symposium on Logic in Computer Science (Cat. No. PR00158). IEEE, 137-146.
[17]
Karl Crary, Robert Harper, and Sidd Puri. 1999. What is a Recursive Module?. In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation (PLDI '99).
[18]
Nils Anders Danielsson and Thorsten Altenkirch. 2010. Subtyping, declaratively. In International Conference on Mathematics of Program Construction. Springer, 100-118.
[19]
Dominic Duggan. 2002. Type-safe linking with recursive DLLs and shared libraries. ACM Transactions on Programming Languages and Systems (TOPLAS) 24, 6 ( 2002 ), 711-804.
[20]
Vladimir Gapeyev, Michael Levin, and Benjamin Pierce. 2003. Recursive Subtyping Revealed. Journal of Functional Programming 12, 6 ( 2003 ), 511-548. Preliminary version in International Conference on Functional Programming (ICFP), 2000. Also appears as Chapter 21 of Types and Programming Languages by Benjamin C. Pierce (MIT Press, 2002 ).
[21]
Simon Gay and Malcolm Hole. 2005. Subtyping for session types in the pi calculus. Acta Informatica 42, 2-3 ( 2005 ), 191-225.
[22]
Simon J Gay and Vasco T Vasconcelos. 2010. Linear type theory for asynchronous session types. Journal of Functional Programming 20, 1 ( 2010 ), 19-50.
[23]
Giorgio Ghelli. 1993. Recursive types are not conservative over F ≤. In International Conference on Typed Lambda calculi and Applications. Springer, 146-162.
[24]
Martin Hofmann and Benjamin C Pierce. 1996. Positive subtyping. Information and Computation 126, 1 ( 1996 ), 11-33.
[25]
Haruo Hosoya, Benjamin C Pierce, David N Turner, et al. 1998. Datatypes and subtyping. Unpublished manuscript. Available http://www. cis. upenn. edu/˜ bcpierce/papers/index. html ( 1998 ).
[26]
Atsushi Igarashi, Benjamin C Pierce, and Philip Wadler. 2001. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems (TOPLAS) 23, 3 ( 2001 ), 396-450.
[27]
Joseph Lee, Jonathan Aldrich, Troy Shaw, and Alex Potanin. 2015. A Theory of Tagged Objects. In European Conference on Object-Oriented Programming (ECOOP).
[28]
Jay Ligatti, Jeremy Blackburn, and Michael Nachtigal. 2017. On subtyping-relation completeness, with an application to iso-recursive types. ACM Transactions on Programming Languages and Systems (TOPLAS) 39, 1 ( 2017 ), 1-36.
[29]
Benjamin C. Pierce. 2002. Types and programming languages. MIT press.
[30]
François Pottier. 2013. Syntactic soundness proof of a type-and-capability system with hidden state. Journal of functional programming 23, 1 ( 2013 ), 38-144.
[31]
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. 624-641.
[32]
Jeremy G Siek and Sam Tobin-Hochstadt. 2016. The recursive union of some gradual types. In A List of Successes That Can Change the World. Springer, 388-410.
[33]
Marvin Solomon. 1978. Type definitions with parameters. In Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages. 31-38.
[34]
Chris Stone and Robert Harper. 1996. A Type-Theoretic Account of Standard ML 1996. Technical Report CMU-CS-96-136. School of Computer Science, Carnegie Mellon University, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213-3891.
[35]
Nikhil Swamy, Juan Chen, Cédric Fournet, Pierre-Yves Strub, Karthikeyan Bhargavan, and Jean Yang. 2011. Secure Distributed Programming with Value-Dependent Types. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming (ICFP 2011 ).
[36]
The Coq Development Team. 2019. Coq. https://coq.inria.fr
[37]
Joseph C. Vanderwaart, Derek Dreyer, Leaf Petersen, Karl Crary, Robert Harper, and Perry Cheng. 2003. Typed Compilation of Recursive Datatypes. In Proceedings of the 2003 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation. 98-108.
[38]
Yanpeng Yang and Bruno C. d. S. Oliveira. 2019. Pure iso-type systems. Journal of Functional Programming 29 ( 2019 ).

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 4, Issue OOPSLA
November 2020
3108 pages
EISSN:2475-1421
DOI:10.1145/3436718
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 November 2020
Published in PACMPL Volume 4, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Formalization
  2. Iso-recursive types
  3. Subtyping

Qualifiers

  • Research-article

Funding Sources

  • Hong Kong Research Grant Council

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)245
  • Downloads (Last 6 weeks)35
Reflects downloads up to 18 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Full Iso-Recursive TypesProceedings of the ACM on Programming Languages10.1145/36897188:OOPSLA2(192-221)Online publication date: 8-Oct-2024
  • (2022)Evolution of SASyLF 2008-2021Electronic Proceedings in Theoretical Computer Science10.4204/EPTCS.354.7354(87-107)Online publication date: 8-Feb-2022
  • (2022)Revisiting Iso-Recursive SubtypingACM Transactions on Programming Languages and Systems10.1145/354953744:4(1-54)Online publication date: 21-Sep-2022
  • (2022)Polarized SubtypingProgramming Languages and Systems10.1007/978-3-030-99336-8_16(431-461)Online publication date: 29-Mar-2022

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media