脊椎局部类型推断
Spine-local Type Inference
摘要:
我们提出了一个局部类型推断,一个局部类型推断系统,用于基于局部类型推断来推断系统F术语的省略类型注释。局部类型推断依赖于双向推断规则来将类型信息传播到AST的相邻节点中或从相邻节点中传播出来,并且将类型参数推断限制为仅在单个节点内发生。Spine-local inference放宽了对类型参数推断的限制,允许它只在{application spine}中发生,并通过使用上下文类型参数推断对其进行改进。由于我们的目标是探索本地类型推断的设计空间,我们表明,相对于其他变体,脊柱本地类型推断,使理想的功能,如一流的咖喱应用程序,部分类型的应用程序,并能够推断类型的一些条款,否则不可能。我们的方法享有一个双向系统的规范,我们的推理算法和可预测的要求类型注释的通常属性,特别是保持一些本地类型推断的优点,如一个相对简单的实现和倾向于产生高质量的错误消息时,类型推断失败。
英文摘要:
We present spine-local type inference, a partial type inference system for inferring omitted type annotations for System F terms based on local type inference. Local type inference relies on bidirectional inference rules to propagate type information into and out of adjacent nodes of the AST and restricts type-argument inference to occur only within a single node. Spine-local inference relaxes the restriction on type-argument inference by allowing it to occur only within an {application spine and improves upon it by using contextual type-argument inference. As our goal is to explore the design space of local type inference, we show that, relative to other variants, spine-local type inference enables desirable features such as first-class curried applications, partial type applications, and the ability to infer types for some terms not otherwise possible. Our approach enjoys usual properties of a bidirectional system of having a specification for our inference algorithm and predictable requirements for typing annotations, and in particular maintains some the advantages of local type inference such as a relatively simple implementation and a tendency to produce good-quality error messages when type inference fails.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。