多重标注箭头线性类型的模推断
Modular Inference of Linear Types for Multiplicity-Annotated Arrows
摘要:
Bernardy等人[2018]提出了一个线性类型系统$λ^q_\to$作为Linear Haskell的核心类型系统。在系统中,线性由带注释的箭头类型$A \to_m B$表示,其中$m$表示参数的多重性。由于这种表示,在许多情况下,现有的非线性代码类型和新编写的线性代码可以与现有的非线性代码一起使用。然而,对$λ^q_\to$的类型推断知之甚少。虽然Linear Haskell实现配备了类型推断,但其算法尚未正式化,并且实现通常无法推断主类型,特别是对于高阶函数。在本文中,基于OutsideIn(X)[Vytiniotis等人,2011],我们提出了一个推理系统的秩1限定类型的变体$λ^q_\to$,推断主类型。这种新设置的一个技术挑战是处理由朴素限定类型推断的二义性类型。我们通过量词消去来解决这个歧义问题,并通过实例证明了该方法的有效性。
英文摘要:
Bernardy et al. [2018] proposed a linear type system $λ^q_\to$ as a core type system of Linear Haskell. In the system, linearity is represented by annotated arrow types $A \to_m B$, where $m$ denotes the multiplicity of the argument. Thanks to this representation, existing non-linear code typechecks as it is, and newly written linear code can be used with existing non-linear code in many cases. However, little is known about the type inference of $λ^q_\to$. Although the Linear Haskell implementation is equipped with type inference, its algorithm has not been formalized, and the implementation often fails to infer principal types, especially for higher-order functions. In this paper, based on OutsideIn(X) [Vytiniotis et al., 2011], we propose an inference system for a rank 1 qualified-typed variant of $λ^q_\to$, which infers principal types. A technical challenge in this new setting is to deal with ambiguous types inferred by naive qualified typing. We address this ambiguity issue through quantifier elimination and demonstrate the effectiveness of the approach with examples.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。