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

通过有限集声明实现交叉类型

Intersection Types via Finite-Set Declarations

Fairouz Kamareddine, Joe Wells

AI总结:

本文提出 f-cube,通过有限集声明将交叉类型编码为 Pi 类型,从而在不使用交叉引入规则的情况下为 lambda-cube 无法赋型的强规范化项 U' 赋予类型。

摘要:

lambda-cube 是一个著名的纯类型系统(PTS)立方体,包含八个强大的显式类型系统,涵盖简单、多态和依赖类型理论。lambda-cube 只能为强规范化(SN)项中的一部分赋予类型,而无法覆盖全部。众所周知,即便是 lambda-cube 中最强大的系统,也只能为与高阶多态隐式类型 lambda 演算 Fomega 可赋予类型的相同纯无类型 lambda 项赋予类型;并且存在一个无类型 λ 项 U',它是 SN 的,但在 Fomega 或 lambda-cube 中不可赋予类型。因此,这两个系统都无法为其所表达的所有 SN 项赋予类型。在本文中,我们提出了 f-cube,它是 lambda-cube 的扩展,加入了有限集声明(FSD),形式如 y\in{C1,...,Cn} : B,表示 y 的类型为 B,并且只能是 C1,..., Cn 之一。我们的 FSD 的新颖之处在于它们允许将交叉类型表示为 Pi 类型。我们展示了如何使用基于 FSD 的交叉类型编码在 f-cube 中翻译并赋予项 U' 类型。值得注意的是,我们的翻译不需要通常麻烦的交叉引入规则,该规则使用 k 个独立的子推导来证明一个纯无类型 lambda 项 M 具有 k 个类型的交叉。因此,我们的方法对于希望获得交叉类型的能力而又不想承受交叉引入规则之痛的语言实现者来说非常有用。

英文摘要:

The lambda-cube is a famous pure type system (PTS) cube of eight powerful explicit type systems that include the simple, polymorphic and dependent type theories. The lambda-cube only types Strongly Normalising (SN) terms but not all of them. It is well known that even the most powerful system of the lambda-cube can only type the same pure untyped lambda-terms that are typable by the higher-order polymorphic implicitly typed lambda-calculus Fomega, and that there is an untyped λ-term U' that is SN but is not typable in Fomega or the lambda-cube. Hence, neither system can type all the SN terms it expresses. In this paper, we present the f-cube, an extension of the lambda-cube with finite-set declarations (FSDs) like y\in{C1,...,Cn} : B which means that y is of type B and can only be one of C1,..., Cn. The novelty of our FSDs is that they allow to represent intersection types as Pi-types. We show how to translate and type the term U' in the f-cube using an encoding of intersection types based on FSDs. Notably, our translation works without needing anything like the usual troublesome intersection-introduction rule that proves a pure untyped lambda-term M has an intersection of k types using k independent sub-derivations. As such, our approach is useful for language implementers who want the power of intersection types without the pain of the intersection-introduction rule.

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

↑