arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.09914cs.PL
收藏

基于约束的FreezeML类型推断

Constraint-based type inference for FreezeML

Frank Emrich, Jan Stolarek, James Cheney, Sam Lindley

摘要:

FreezeML是一种新的一级多态类型推断方法,它使用术语注释来控制多态类型何时以及如何被实例化和泛化。它保守地扩展了Hindley-Milner类型推断,并且首先作为算法W的扩展而提出。诸如HM(X)和OutsideIn($X$)之类的更现代的类型推断技术使用约束来支持诸如类型类、类型族、行和其他扩展之类的特性。我们通过提出一个基于约束的类型推断算法,迈出了现代化FreezeML的第一步。我们引入了一种新的约束语言,灵感来自于HM(X)的Pottier/Rémy表示,以便允许FreezeML类型推断问题被表示为约束。我们提出了一个确定性堆栈机解决FreezeML约束,并证明其终止性和正确性。

英文摘要:

FreezeML is a new approach to first-class polymorphic type inference that employs term annotations to control when and how polymorphic types are instantiated and generalised. It conservatively extends Hindley-Milner type inference and was first presented as an extension to Algorithm W. More modern type inference techniques such as HM(X) and OutsideIn($X$) employ constraints to support features such as type classes, type families, rows, and other extensions. We take the first step towards modernising FreezeML by presenting a constraint-based type inference algorithm. We introduce a new constraint language, inspired by the Pottier/Rémy presentation of HM(X), in order to allow FreezeML type inference problems to be expressed as constraints. We present a deterministic stack machine for solving FreezeML constraints and prove its termination and correctness.

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

↑