Abstract
We propose an integration of structural subtyping with boolean connectives and semantic subtyping to define a Java-like programming language that exploits the benefits of both techniques. Semantic subtyping is an approach to defining subtyping relation based on set-theoretic models, rather than syntactic rules. On the one hand, this approach involves some non trivial mathematical machinery in the background. On the other hand, final users of the language need not know this machinery and the resulting subtyping relation is very powerful and intuitive. While semantic subtyping is naturally linked to the structural one, we show how the framework can also accommodate the nominal subtyping. Several examples show the expressivity and the practical advantages of our proposal.
Chapter PDF
References
Abadi, M., Cardelli, L.: A Theory of Primitive Objects - Untyped and First-Order Systems. In: Hagiya, M., Mitchell, J.C. (eds.) TACS 1994. LNCS, vol. 789, pp. 296–320. Springer, Heidelberg (1994)
Agrawal, R., de Michiel, L.G., Lindsay, B.G.: Static type checking of multimethods. In: Proc. of OOPSLA, pp. 113–128. ACM Press (1991)
Aiken, A., Wimmers, E.L.: Type inclusion constraints and type inference. In: Proc. of FPCA, pp. 31–41. ACM (1993)
Ancona, D., Lagorio, G.: Coinductive type systems for object-oriented languages. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 2–26. Springer, Heidelberg (2009)
Boyland, J., Castagna, G.: Type-safe compilation of covariant specialization: A practical case. In: Cointe, P. (ed.) ECOOP 1996. LNCS, vol. 1098, pp. 3–25. Springer, Heidelberg (1996)
Boyland, J.T., Castagna, G.: Parasitic Methods: an implementation of multi-methods for Java. In: Proc. of OOPSLA. ACM Press (1997)
Castagna, G.: Object-oriented programming: a unified foundation. Progress in Theoretical Computer Science series. Birkäuser, Boston (1997)
Castagna, G.: Semantic subtyping: Challenges, perspectives, and open problems. In: Coppo, M., Lodi, E., Pinna, G.M. (eds.) ICTCS 2005. LNCS, vol. 3701, pp. 1–20. Springer, Heidelberg (2005)
Castagna, G., De Nicola, R., Varacca, D.: Semantic subtyping for the pi-calculus. Theoretical Computer Science 398(1-3), 217–242 (2008)
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)
Dardha, O.: Sottotipaggio semantico per linguaggi ad oggetti. MS thesis, Dip. Informatica, “Sapienza” Univ. di Roma, http://www.dsi.uniroma1.it/~gorla/TesiDardha.pdf
Findler, R.B., Flatt, M., Felleisen, M.: Semantic casts: Contracts and structural subtyping in a nominal world. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 365–389. Springer, Heidelberg (2004)
Frisch, A., Castagna, G., Benzaken, V.: Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types. Journal of the ACM 55(4), 1–64 (2008)
Gil, J., Maman, I.: Whiteoak: introducing structural typing into Java. In: Proc. of OOPSLA, pp. 73–90. ACM (2008)
Hosoya, H., Pierce, B.C.: Regular expression pattern matching for XML. SIGPLAN Notices 36(3), 67–80 (2001)
Hosoya, H., Pierce, B.C.: Xduce: A statically typed XML processing language. ACM Transactions on Internet Technology 3(2), 117–148 (2003)
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23(3), 396–450 (2001)
Leroy, X., Doligez, D., Garrigue, J., Rémy, D., Vouillon, J.: The Objective Caml system, release 3.11 (2008)
Malayeri, D., Aldrich, J.: Integrating nominal and structural subtyping. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 260–284. Springer, Heidelberg (2008)
Malayeri, D., Aldrich, J.: Is structural subtyping useful? An empirical study. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 95–111. Springer, Heidelberg (2009)
Odersky, M., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E., Zenger, M.: An overview of the Scala programming language. Technical report (2004)
Ostermann, K.: Nominal and structural subtyping in component-based programming. Journal of Object Technology 7(1), 121–145 (2008)
Pearce, D.J.: Sound and complete flow typing with unions, intersections and negations. In: Giacobazzi, R., Berdine, J., Mastroeni, I. (eds.) VMCAI 2013. LNCS, vol. 7737, pp. 335–354. Springer, Heidelberg (2013)
Rémy, D., Vouillon, J.: Objective ML: A simple object-oriented extension of ML. In: Proc. of POPL, pp. 40–53. ACM (1997)
Sangiorgi, D., Walker, D.: The Pi-Calculus: A Theory of Mobile Processes. Cambridge University Press, New York (2003)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 IFIP International Federation for Information Processing
About this paper
Cite this paper
Dardha, O., Gorla, D., Varacca, D. (2013). Semantic Subtyping for Objects and Classes. In: Beyer, D., Boreale, M. (eds) Formal Techniques for Distributed Systems. FMOODS FORTE 2013 2013. Lecture Notes in Computer Science, vol 7892. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-38592-6_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-38592-6_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-38591-9
Online ISBN: 978-3-642-38592-6
eBook Packages: Computer ScienceComputer Science (R0)