Skip to main content

Java Type Unification with Wildcards

  • Conference paper
Applications of Declarative Programming and Knowledge Management (INAP 2007, WLP 2007)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Gosling, J., Joy, B., Steele, G., Bracha, G.: The JavaTM Language Specification, 3rd edn. The Java series. Addison-Wesley, Reading (2005)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Google Scholar 

  4. Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proc. 9th Symposium on Principles of Programming Languages (1982)

    Google Scholar 

  5. Smolka, G.: Logic Programming over Polymorphically Order-Sorted Types. PhD thesis, Department Informatik, University of Kaiserslautern, Kaiserslautern, Germany (May 1989)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. Beierle, C.: Type inferencing for polymorphic order-sorted logic programs. In: International Conference on Logic Programming, pp. 765–779 (1995)

    Google Scholar 

  9. Plümicke, M.: OBJ–P The Polymorphic Extension of OBJ–3. PhD thesis, University of Tuebingen, WSI-99-4 (1999)

    Google Scholar 

  10. Plümicke, M.: Type unification in Generic–Java. In: Kohlhase, M. (ed.) Proceedings of 18th International Workshop on Unification (UNIF 2004) (July 2004)

    Google Scholar 

  11. Martelli, A., Montanari, U.: An efficient unification algorithm. ACM Transactions on Programming Languages and Systems 4, 258–282 (1982)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics