Abstract
With the introduction of Java 5.0 the type system has been extended by parameterized types, type variables, type terms, and wildcards. As a result very complex types can arise. The term
\(\tt{Vector}<{\tt{\texttt{?}\ extends\ Vector}<{\tt{AbstractList}<{Integer}>>>}}\)
is for example a correct type in Java 5.0.
In this paper we present a type unification algorithm for Java 5.0 type terms. The algorithm unifies type terms, which are in subtype relationship. For this we define Java 5.0 type terms and its subtyping relation, formally.
As Java 5.0 allows wildcards as instances of generic types, the subtyping ordering contains infinite chains. We show that the type unification is still finitary. We give a type unification algorithm, which calculates the finite set of general unifiers.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Gosling, J., Joy, B., Steele, G., Bracha, G.: The JavaTM Language Specification, 3rd edn. The Java series. Addison-Wesley, Reading (2005)
Plümicke, M., Bäuerle, J.: Typeless Programming in Java 5.0. In: Gitzel, R., Aleksey, M., Schader, M., Krintz, C. (eds.) 4th International Conference on Principles and Practices of Programming in Java. ACM International Conference Proceeding Series, pp. 175–181. Mannheim University Press (August 2006)
Plümicke, M.: Typeless Programming in Java 5.0 with wildcards. In: Amaral, V., Veiga, L., Marcelino, L., Cunningham, H.C. (eds.) 5th International Conference on Principles and Practices of Programming in Java. ACM International Conference Proceeding Series, pp. 73–82. ACM Press, New York (September 2007)
Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proc. 9th Symposium on Principles of Programming Languages (1982)
Smolka, G.: Logic Programming over Polymorphically Order-Sorted Types. PhD thesis, Department Informatik, University of Kaiserslautern, Kaiserslautern, Germany (May 1989)
Hanus, M.: Parametric order-sorted types in logic programming. In: Abramsky, S. (ed.) TAPSOFT 1991, CCPSD 1991, and ADC-Talks 1991. LNCS, vol. 494, pp. 181–200. Springer, Heidelberg (1991)
Hill, P.M., Topor, R.W.: A Semantics for Typed Logic Programs. In: Pfenning, F. (ed.) Types in Logic Programming, pp. 1–62. MIT Press, Cambridge (1992)
Beierle, C.: Type inferencing for polymorphic order-sorted logic programs. In: International Conference on Logic Programming, pp. 765–779 (1995)
Plümicke, M.: OBJ–P The Polymorphic Extension of OBJ–3. PhD thesis, University of Tuebingen, WSI-99-4 (1999)
Plümicke, M.: Type unification in Generic–Java. In: Kohlhase, M. (ed.) Proceedings of 18th International Workshop on Unification (UNIF 2004) (July 2004)
Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Transactions on Programming Languages and Systems 4, 258–282 (1982)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Plümicke, M. (2009). Java Type Unification with Wildcards. In: Seipel, D., Hanus, M., Wolf, A. (eds) Applications of Declarative Programming and Knowledge Management. INAP WLP 2007 2007. Lecture Notes in Computer Science(), vol 5437. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-00675-3_15
Download citation
DOI: https://doi.org/10.1007/978-3-642-00675-3_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-00674-6
Online ISBN: 978-3-642-00675-3
eBook Packages: Computer ScienceComputer Science (R0)