arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1006.1413cs.PLcs.LO
收藏

面向对象语言抽象编译成Horn公式的共归纳子类型

Coinductive subtyping for abstract compilation of object-oriented languages into Horn formulas

Davide Ancona, Giovanni Lagorio

摘要:

在最近的工作中,我们已经展示了如何通过将程序抽象编译成Horn公式f来为面向对象语言定义非常精确的类型系统。那么类型推断就等于解决了一个特定的目标。f的共归纳(也就是最大的)Herbrand模型。以这种方式定义的类型系统是理想化的,因为在最有趣的实例化中,共同归纳的Herbrand论域和目标导子的项都不能被直接表示。然而,声音和相当有表现力的近似可以通过只考虑正则项和导数来实现。在这样做的时候,引入一个适当的子类型关系来形式化类型之间近似的概念是至关重要的。本文研究了建立在联合和对象类型构造函数上的共归纳项的子类型关系。我们定义了一个解释的类型作为一组值引起的一个相当直观的关系的成员资格的值类型,并证明了子类型的定义是健全的w.r.t.类型解释之间的子集包含。可靠性的证明使我们能够简化压缩派生的概念,并发现先前给出的子类型定义并没有涵盖空类型的所有可能表示。

英文摘要:

In recent work we have shown how it is possible to define very precise type systems for object-oriented languages by abstractly compiling a program into a Horn formula f. Then type inference amounts to resolving a certain goal w.r.t. the coinductive (that is, the greatest) Herbrand model of f. Type systems defined in this way are idealized, since in the most interesting instantiations both the terms of the coinductive Herbrand universe and goal derivations cannot be finitely represented. However, sound and quite expressive approximations can be implemented by considering only regular terms and derivations. In doing so, it is essential to introduce a proper subtyping relation formalizing the notion of approximation between types. In this paper we study a subtyping relation on coinductive terms built on union and object type constructors. We define an interpretation of types as set of values induced by a quite intuitive relation of membership of values to types, and prove that the definition of subtyping is sound w.r.t. subset inclusion between type interpretations. The proof of soundness has allowed us to simplify the notion of contractive derivation and to discover that the previously given definition of subtyping did not cover all possible representations of the empty type.

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

↑