arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv cs/0403034cs.PL
收藏

体模类型和子类型

Phantom Types and Subtyping

Matthew Fluet, Riccardo Pucella

摘要:

我们研究了一种技术,从文献中,称为幻影类型技术,使用参数多态性,类型约束,和统一的多态类型建模的子类型层次结构。Hindley-Milner类型系统,例如标准ML中的一个,可以用来强制子类型关系,至少对于一阶值。我们表明,这种技术可以用来编码任何有限的子类型层次结构(包括层次结构所产生的多接口继承)。我们正式证明的幻影类型技术捕捉一阶子类型的适用性,展示了一个类型保持翻译从一个简单的演算有界多态性的演算体现SML的类型系统。

英文摘要:

We investigate a technique from the literature, called the phantom-types technique, that uses parametric polymorphism, type constraints, and unification of polymorphic types to model a subtyping hierarchy. Hindley-Milner type systems, such as the one found in Standard ML, can be used to enforce the subtyping relation, at least for first-order values. We show that this technique can be used to encode any finite subtyping hierarchy (including hierarchies arising from multiple interface inheritance). We formally demonstrate the suitability of the phantom-types technique for capturing first-order subtyping by exhibiting a type-preserving translation from a simple calculus with bounded polymorphism to a calculus embodying the type system of SML.

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

↑