Intersection types in Java

Martin Plümicke
{"title":"Intersection types in Java","authors":"Martin Plümicke","doi":"10.1145/1411732.1411757","DOIUrl":null,"url":null,"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.\n In this paper we present an algorithm, which resolves intersection types of Java methods, such that Java programs with standard typings are generated.\n 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.\n Finally, we will see that this differentiation leads to a refined definition of Java method principal types.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"39 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2008-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Principles and Practice of Programming in Java","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1411732.1411757","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

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.
Java中的交集类型
在过去,我们分析了无类型Java程序。我们的结果之一是,一个方法可能有不同的正确类型。这意味着这些方法的主要类型是交叉类型。我们提出了一种类型推断算法。对于无类型的Java方法,该算法推断其主要交集类型。不幸的是,像Java字节码一样,Java不允许交叉类型。本文提出了一种解决Java方法的交叉类型的算法,从而生成具有标准类型的Java程序。在算法中,我们必须区分两种交集类型。一方面,有交叉类型的方法,其中对所有类型执行相同的代码。另一方面,有一些方法,根据它的类型调用不同的方法。在类型解析过程中,这两种情况必须区别对待。最后,我们将看到这种区分导致了Java方法主体类型的精细化定义。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信