arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1407.3892cs.PLcs.LOcs.SE
收藏

使用Traits和Mixins验证子分型

Verified Subtyping with Traits and Mixins

Asankhaya Sharma

摘要:

特性允许将程序分解成更小的部分,而混入是一种类似于多重继承的组合形式。不幸的是,在trait存在的情况下,像Scala这样的程序设计语言放弃了对象之间的子类型关系。本文提出了一种基于分离逻辑中蕴涵的对象子类型检查方法。我们实现我们的方法作为一个领域特定的语言在Scala和Scala标准库上应用。我们已经验证了Scala标准库中使用的67%的mixin确实符合用于构建它们的trait之间的子类型。

英文摘要:

Traits allow decomposing programs into smaller parts and mixins are a form of composition that resemble multiple inheritance. Unfortunately, in the presence of traits, programming languages like Scala give up on subtyping relation between objects. In this paper, we present a method to check subtyping between objects based on entailment in separation logic. We implement our method as a domain specific language in Scala and apply it on the Scala standard library. We have verified that 67% of mixins used in the Scala standard library do indeed conform to subtyping between the traits that are used to build them.

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

↑