[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1411732.1411757acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Intersection types in Java

Published: 09 September 2008 Publication History

Abstract

In the past we analyzed typeless Java programs. One of our results was, that there may be different correct typings for one method. This means that the principal types of such methods are intersection types. We presented a type-inference algorithm. For typeless Java methods the algorithm infers its principal intersection type. Unfortunately, like Java byte-code, Java does not allow intersection types.
In this paper we present an algorithm, which resolves intersection types of Java methods, such that Java programs with standard typings are generated.
In the algorithm we have to differentiate two cases of intersection types. On the one hand there are methods with intersection types, where for all types the same code is executed. On the other hand there are methods, which call in dependence to its typings different methods. These two cases have to be treated differently during type resolving.
Finally, we will see that this differentiation leads to a refined definition of Java method principal types.

References

[1]
E. Börger and W. Schulte. A programmer friendly modular definition of the semantics of java. In J. Alves-Foss, editor, Formal Syntax and Semantics of Java, volume 1523 of Lecture Notes in Computer Science, pages 353--404. Springer, 1999.
[2]
G. Boudol and P. Zimmer. On type inference in the intersection type discipline. Electronic Notes in Theoretical Computer Science, 136:23--42, 2005.
[3]
M. Coppo and M. Dezani-Ciancaglini. An extension of the basic functionality theory for the λ-calculus. Notre Dame J. Formal Logic, 21(4):685--693, 1980.
[4]
L. Damas and R. Milner. Principal type-schemes for functional programs. Proc. 9th Symposium on Principles of Programming Languages, 1982.
[5]
J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java#8482; Language Specification. The Java series. Addison-Wesley, 3rd edition, 2005.
[6]
J. R. Hindley. Types with intersection: An introduction. Formal Aspects of Computing, 4(5):470--486, 1992.
[7]
A. J. Kfoury and J. B. Wells. Principality and type inference for intersection types using expansion variables. Theoretical Computer Science, 311(1--3):1--70, 2004.
[8]
D. Leivant. Polymorphic type inference. Proc. 10th Symposium on Principles of Programming Languages 1982, 1983.
[9]
R. Milner. The definition of Standard ML (Revised). MIT Press, Cambridge, Mass., 1997.
[10]
M. Plümicke. Typeless Programming in Java 5.0 with wildcards. In V. Amaral, L. Veiga, L. Marcelino, and H. C. Cunningham, editors, 5th International Conference on Principles and Practices of Programming in Java, ACM International Conference Proceeding Series, pages 73--82, September 2007.
[11]
M. Plümicke and J. Bäuerle. Typeless Programming in Java 5.0. In R. Gitzel, M. Aleksey, M. Schader, and C. Krintz, editors, 4th International Conference on Principles and Practices of Programming in Java, ACM International Conference Proceeding Series, pages 175--181. Mannheim University Press, August 2006.
[12]
S. van Bakel. Principal type schemes for the strict type assignment system. Journal of Logic and Computing, 3(6):643--670, 1993.
[13]
S. van Bakel. Intersection type assignment systems. Theoretical Computer Science, 151(2):385--435, 1995.

Cited By

View all
  • (2017)Rewriting for sound and complete union, intersection and negation typesACM SIGPLAN Notices10.1145/3170492.313604252:12(117-130)Online publication date: 23-Oct-2017
  • (2017)Rewriting for sound and complete union, intersection and negation typesProceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3136040.3136042(117-130)Online publication date: 23-Oct-2017
  • (2013)Sound and Complete Flow Typing with Unions, Intersections and NegationsProceedings of the 14th International Conference on Verification, Model Checking, and Abstract Interpretation - Volume 773710.1007/978-3-642-35873-9_21(335-354)Online publication date: 20-Jan-2013

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PPPJ '08: Proceedings of the 6th international symposium on Principles and practice of programming in Java
September 2008
198 pages
ISBN:9781605582238
DOI:10.1145/1411732
  • Conference Chairs:
  • Luis Veiga,
  • Vasco Amaral
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 September 2008

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. code generation
  2. language design
  3. program design and implementation
  4. type inference
  5. type system

Qualifiers

  • Research-article

Conference

PPPJ08
Sponsor:

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)0
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2017)Rewriting for sound and complete union, intersection and negation typesACM SIGPLAN Notices10.1145/3170492.313604252:12(117-130)Online publication date: 23-Oct-2017
  • (2017)Rewriting for sound and complete union, intersection and negation typesProceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences10.1145/3136040.3136042(117-130)Online publication date: 23-Oct-2017
  • (2013)Sound and Complete Flow Typing with Unions, Intersections and NegationsProceedings of the 14th International Conference on Verification, Model Checking, and Abstract Interpretation - Volume 773710.1007/978-3-642-35873-9_21(335-354)Online publication date: 20-Jan-2013

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media