Part of the book series:Lecture Notes in Computer Science ((LNCS,volume 13658))
Included in the following conference series:
300Accesses
Abstract
Calculi with subtyping, a form of record concatenation and recursive types are useful to model objects with multiple inheritance. Surprisingly, almost no existing calculi supports the three features together, partly because the combination of subtyping and record concatenation is already known to be troublesome. Recently, a line of work ondisjoint intersection types with amerge operator has emerged as a new approach to deal with the interaction between subtyping and record concatenation. However, the addition of recursive types has not been studied.
In this paper we present a calculus that combinesiso-recursive types with disjoint intersection types and a merge operator. The merge operator generalizes symmetric record concatenation, and the calculus supports subtyping as well as recursive types. We build on recent developments on the theory of iso-recursive subtyping using the so-callednominal unfolding rules to add iso-recursive types to a calculus with disjoint intersection types and a merge operator. The main challenge lies in the disjointness definition with iso-recursive subtyping. We show the type soundness of the calculus, decidability of subtyping, as well as the soundness and completeness of our disjointness definition. All the proofs are mechanized in the Coq theorem prover.
This is a preview of subscription content,log in via an institution to check access.
Access this chapter
Subscribe and save
- Get 10 units per month
- Download Article/Chapter or eBook
- 1 Unit = 1 Article or 1 Chapter
- Cancel anytime
Buy Now
- Chapter
- JPY 3498
- Price includes VAT (Japan)
- eBook
- JPY 7435
- Price includes VAT (Japan)
- Softcover Book
- JPY 9294
- Price includes VAT (Japan)
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
We assume the presence of recursive functions, and that records are lazy in the example.
References
Abadi, M., Cardelli, L.: A Theory of Objects. Springer, New York (1996).https://doi.org/10.1007/978-1-4419-8598-9
Alpuim, J., Oliveira, B.C.S., Shi, Z.: Disjoint polymorphism. In: Yang, H. (ed.) ESOP 2017. LNCS, vol. 10201, pp. 1–28. Springer, Heidelberg (2017).https://doi.org/10.1007/978-3-662-54434-1_1
Amin, N., Rompf, T., Odersky, M.: Foundations of path-dependent types. In: Proceedings of the 2014 ACM International Conference on Object Oriented Programming, Systems, Languages, and Applications. OOPSLA 2014. Association for Computing Machinery (2014)
Barendregt, H., Coppo, M., Dezani-Ciancaglini, M.: A filter lambda model and the completeness of type assignment. J. Symb. Logic48(4), 931–940 (1983)
Bi, X., Oliveira, B.C.d.S.: Typed first-class traits. In: 32nd European Conference on Object-Oriented Programming (ECOOP 2018) (2018)
Bi, X., Oliveira, B.C.d.S., Schrijvers, T.: The essence of nested composition. In: 32nd European Conference on Object-Oriented Programming (ECOOP 2018) (2018)
Bi, X., Xie, N., Oliveira, B.C.S., Schrijvers, T.: Distributive disjoint polymorphism for compositional programming. In: Caires, L. (ed.) ESOP 2019. LNCS, vol. 11423, pp. 381–409. Springer, Cham (2019).https://doi.org/10.1007/978-3-030-17184-1_14
Bierman, G., Abadi, M., Torgersen, M.: Understanding typescript. In: Jones, R. (ed.) ECOOP 2014. LNCS, vol. 8586, pp. 257–281. Springer, Heidelberg (2014).https://doi.org/10.1007/978-3-662-44202-9_11
Bruce, K., Cardeli, L., Castagna, G., Group, T.H.O., Leavens, G.T., Pierce, B.: On binary methods. Theory Pract. Object Syst.1(3) (1996)
Bruce, K.B., Cardelli, L., Pierce, B.C.: Comparing object encodings155(1/2), 108–133 (1999).http://www.cis.upenn.edu/bcpierce/papers/compobj.ps
Cardelli, L.: A semantics of multiple inheritance. In: Semantics of Data Types (1984)
Cardelli, L.: Amber. In: Cousineau, G., Curien, P.-L., Robinet, B. (eds.) LITP 1985. LNCS, vol. 242, pp. 21–47. Springer, Heidelberg (1986).https://doi.org/10.1007/3-540-17184-3_38
Cardelli, L.: Extensible Records in a Pure Calculus of Subtyping. Digital, Systems Research Center (1992)
Cardelli, L.: A language with distributed scope. In: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL 1995, pp. 286–297 (1995)
Cardelli, L., Mitchell, J.C.: Operations on records. Math. Struct. Comput. Sci.1(1), 3–48 (1991)
Castagna, G., Frisch, A.: A gentle introduction to semantic subtyping. In: Proceedings of the 7th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pp. 198–199 (2005)
Compagnoni, A.B., Pierce, B.C.: Higher-order intersection types and multiple inheritance. Math. Struct. Comput. Sci. (MSCS)6(5), 469–501 (1996)
Cook, W.R., Hill, W., Canning, P.S.: Inheritance is not subtyping. In: Proceedings of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL 1990, pp. 125–135 (1989)
Cook, W.R., Palsberg, J.: A denotational semantics of inheritance and its correctness. In: Object-Oriented Programming: Systems, Languages and Applications (OOPSLA) (1989)
Damm, F.M.: Subtyping with union types, intersection types and recursive types. In: Hagiya, M., Mitchell, J.C. (eds.) TACS 1994. LNCS, vol. 789, pp. 687–706. Springer, Heidelberg (1994).https://doi.org/10.1007/3-540-57887-0_121
Davies, R., Pfenning, F.: Intersection types and computational effects. In: International Conference on Functional Programming (ICFP) (2000)
Dunfield, J.: Elaborating intersection and union types. J. Funct. Program.24(2–3), 133–165 (2014)
Ernst, E.: Family polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001).https://doi.org/10.1007/3-540-45337-7_17
Frisch, A., Castagna, G., Benzaken, V.: Semantic subtyping. In: Proceedings 17th Annual IEEE Symposium on Logic in Computer Science, pp. 137–146. IEEE (2002)
Giarrusso, P.G., Stefanesco, L., Timany, A., Birkedal, L., Krebbers, R.: Scala step-by-step: soundness for dot with step-indexed logical relations in iris. Proc. ACM Program. Lang.4(ICFP) (2020)
Glew, N.: An efficient class and object encoding. In: Proceedings of the 15th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications. OOPSLA 2000, pp. 311–324. Association for Computing Machinery (2000)
Hu, J.Z., Lhoták, O.: Undecidability of DSUB and its decidable fragments. Proc. ACM Program. Lang.4(POPL), 1–30 (2019)
Huang, X., Oliveira, B.C.d.S.: A type-directed operational semantics for a calculus with a merge operator. In: 34th European Conference on Object-Oriented Programming (ECOOP 2020), vol. 166 (2020).https://doi.org/10.4230/LIPIcs.ECOOP.2020.26
Huang, X., Zhao, J., Oliveira, B.C.d.S.: Taming the merge operator: a type-directed operational semantics approach. J. Funct. Program. (2021)
Jones, T., Pearce, D.J.: A mechanical soundness proof for subtyping over recursive types. In: Proceedings of the 18th Workshop on Formal Techniques for Java-like Programs, pp. 1–6 (2016)
Mackay, J., Potanin, A., Aldrich, J., Groves, L.: Decidable subtyping for path dependent types. Proc. ACM Program. Lang.4(POPL), 1–27 (2019)
Microsoft: Typescript (2021).https://www.typescriptlang.org/
Oliveira, B.C.d.S., Shi, Z., Alpuim, J.: Disjoint intersection types. In: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, pp. 364–377 (2016)
Palsberg, J., Zhao, T.: Type inference for record concatenation and subtyping. Inf. Comput.189(1) (2004)
Pearce, D.J.: Rewriting for sound and complete union, intersection and negation types. ACM SIGPLAN Not.52(12), 117–130 (2017)
Pearce, D.J., Groves, L.: Whiley: a platform for research in software verification. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds.) SLE 2013. LNCS, vol. 8225, pp. 238–248. Springer, Cham (2013).https://doi.org/10.1007/978-3-319-02654-1_13
Pierce, B.C.: Bounded quantification is undecidable. Inf. Comput.112(1), 131–165 (1994)
Pottier, F.: A 3-part type inference engine. In: Smolka, G. (ed.) ESOP 2000. LNCS, vol. 1782, pp. 320–335. Springer, Heidelberg (2000).https://doi.org/10.1007/3-540-46425-5_21
Rémy, D.: A case study of typechecking with constrained types: typing record concatenation (1995). Presented at the Workshop on Advances in Types for Computer Science at the Newton Institute, Cambridge, UK
Reynolds, J.C.: Preliminary design of the programming language Forsythe (1988)
Rompf, T., Amin, N.: Type soundness for dependent object types (DOT). In: Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 624–641 (2016)
The CoQ Development Team: CoQ (2019).https://coq.inria.fr
Wadler, P.: The expression problem (1998). Discussion on the Java Genericity mailing list
Wang, F., Rompf, T.: Towards strong normalization for dependent object types (DOT). In: 31st European Conference on Object-Oriented Programming (ECOOP 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2017)
Zhang, W., Sun, Y., Oliveira, B.C.d.S.: Compositional programming. ACM Trans. Program. Lang. Syst. (TOPLAS), 1–60 (2021)
Zhou, Y., Oliveira, B.C.d.S., Fan, A.: A calculus with recursive types, record concatenation and subtyping (artifact) (2022).https://doi.org/10.5281/zenodo.7003284
Zhou, Y., Zhao, J., Oliveira, B.C.d.S.: Revisiting ISO-recursive subtyping. ACM Trans. Program. Lang. Syst. (TOPLAS) (2022).https://doi.org/10.1145/3549537
Acknowledgement
We thank the anonymous reviewers for their helpful comments. This work has been sponsored by Hong Kong Research Grant Council projects number 17209519, 17209520 and 17209821.
Author information
Authors and Affiliations
The University of Hong Kong, Hong Kong, Hong Kong SAR, China
Yaoda Zhou & Bruno C. d. S. Oliveira
Zhejiang University, Hangzhou, China
Andong Fan
- Yaoda Zhou
You can also search for this author inPubMed Google Scholar
- Bruno C. d. S. Oliveira
You can also search for this author inPubMed Google Scholar
- Andong Fan
You can also search for this author inPubMed Google Scholar
Corresponding author
Correspondence toYaoda Zhou.
Editor information
Editors and Affiliations
National University of Singapore, Singapore, Singapore
Ilya Sergey
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Zhou, Y., Oliveira, B.C.d.S., Fan, A. (2022). A Calculus with Recursive Types, Record Concatenation and Subtyping. In: Sergey, I. (eds) Programming Languages and Systems. APLAS 2022. Lecture Notes in Computer Science, vol 13658. Springer, Cham. https://doi.org/10.1007/978-3-031-21037-2_9
Download citation
Published:
Publisher Name:Springer, Cham
Print ISBN:978-3-031-21036-5
Online ISBN:978-3-031-21037-2
eBook Packages:Computer ScienceComputer Science (R0)
Share this paper
Anyone you share the following link with will be able to read this content:
Sorry, a shareable link is not currently available for this article.
Provided by the Springer Nature SharedIt content-sharing initiative