paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Elaboration with first-class implicit function types

一等隐式函数类型的精化
ICFP 4(ICFP)2020匹配度 1/10 · 论文聚焦依赖类型理论中的一等隐式函数精化与 Agda/GHC 类型推断,属于类型系统/编译器前端,与用户关注的 ML/Agentic 静态分析、LLM 与静态分析/形式化验证结合、浮点程序分析及贝叶斯程序分析无直接交集。引用 8 inbox
András Kovács
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出面向完全依赖类型理论的一等隐式函数精化算法,借助核心类型论中的函数类型追踪并细化隐式插入信息。

隐式函数是依赖类型函数,其参数默认由推理机制而非程序员提供;Agda 的隐式函数和 GHC 的多态类型都是典型例子。当隐式函数类型成为一等类型时,精化与推理变得困难,该问题被称为 impredicative instantiation。本文提出一种面向完全依赖类型理论的新精化方案,建立在 Norell 的 Agda 双向精化算法之上,并指出关键困难在于隐式抽象与应用插入信息不完整。为此,作者在核心 Martin-Löf 类型论中加入一种支持严格定义性柯里化的函数类型,用于表示隐式函数类型中未确定的定义域元数,从而可在精化过程中任意时刻追踪并细化此类插入信息,决定是否插入隐式抽象。该方案在能力、通用性和简洁性上优于先前方法。

问题
当隐式函数类型作为一等类型出现时,类型推理与精化面临困难,即 impredicative instantiation/inference 问题;其关键难点是隐式抽象和隐式应用插入信息不完整。
方法
在 Norell 的 Agda 双向精化算法基础上,向核心 Martin-Löf 类型论加入支持严格定义性柯里化的函数类型,以表示未确定的定义域元数并追踪、细化隐式插入信息。
评估
摘要未报告具体实验评估;作者从能力、通用性和简洁性三方面与先前解决方案进行比较,并声称新方案更优。
原文摘要(Abstract)

Implicit functions are dependently typed functions, such that arguments are provided (by default) by inference machinery instead of programmers of the surface language. Implicit functions in Agda are an archetypal example. In the Haskell language as implemented by the Glasgow Haskell Compiler (GHC), polymorphic types are another example. Implicit function types are first-class if they are treated as any other type in the surface language. This holds in Agda and partially holds in GHC. Inference and elaboration in the presence of first-class implicit functions poses a challenge; in the context of Haskell and ML-like languages, this has been dubbed “impredicative instantiation” or “impredicative inference”. We propose a new solution for elaborating first-class implicit functions, which is applicable to full dependent type theories and compares favorably to prior solutions in terms of power, generality and simplicity. We build atop Norell’s bidirectional elaboration algorithm for Agda, and we note that the key issue is incomplete information about insertions of implicit abstractions and applications. We make it possible to track and refine information related to such insertions, by adding a function type to a core Martin-L'of type theory, which supports strict (definitional) currying. This allows us to represent undetermined domain arities of implicit function types, and we can decide at any point during elaboration whether implicit abstractions should be inserted.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{Kovacs20,
  title = {Elaboration with first-class implicit function types},
  author = {András Kovács},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {ICFP},
  year = {2020},
  doi = {10.1145/3408983}
}