arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1503.04911cs.PLcs.LOcs.SE
收藏

类型化类和具有交集类型的混合

Typing Classes and Mixins with Intersection Types

Jan Bessai, Boris Düdder, Andrej Dudenhefner, Tzu-Chun Chen, Ugo de'Liguoro

摘要:

我们研究了一个具有记录和记录合并算子的代数演算的交集类型赋值系统,其中类型在主题缩减和扩展下都保持不变。演算的表达能力足以自然地将mixin表示为递归定义的类上的函数,类的固定点(对象)是递归记录。尽管定义中涉及到双重递归,但类和mixin可以有意义地类型化,而无需求助于递归或F有界多态类型。然后,我们将mixin构造和组合适应于Java和C#,仅依赖于现有的功能,从而使生成的代码在各自的类型系统中保持可类型化。我们展示了一些示例代码,并研究其在交叉类型系统中的类型,通过解释到我们所提出的记录的代数演算。

英文摘要:

We study an assignment system of intersection types for a lambda-calculus with records and a record-merge operator, where types are preserved both under subject reduction and expansion. The calculus is expressive enough to naturally represent mixins as functions over recursively defined classes, whose fixed points, the objects, are recursive records. In spite of the double recursion that is involved in their definition, classes and mixins can be meaningfully typed without resorting to neither recursive nor F-bounded polymorphic types. We then adapt mixin construct and composition to Java and C#, relying solely on existing features in such a way that the resulting code remains typable in the respective type systems. We exhibit some example code, and study its typings in the intersection type system via interpretation into the lambda-calculus with records we have proposed.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑