paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Refinement Type Refutations

精化类型反驳
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 论文研究精化类型检查失败的反驳生成,属于PL/形式化验证与开发者工具,与用户核心关注的“LLM/Agent 与静态分析/形式化验证交叉”无直接关联,也不涉及浮点或贝叶斯程序分析;仅作为静态分析与类型系统基础工作有弱相关。引用 4 inbox
Robin Webbers, Klaus von Gleissenthall, Ranjit Jhala
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出精化类型反驳,将双向类型检查规则系统化转为失败解释,支持全局精化推断,并实现于 Liquid Haskell 扩展 HayStack。

精化类型检查失败时,程序员通常只能得到晦涩的错误信息,最多指出子类型约束失败的位置,难以定位根因。本文提出精化类型反驳,一种与精化类型检查的组合式过程相对应的失败解释方法。首先,系统地将标准双向类型检查规则转换为反驳;其次,通过 must-instantiation 概念扩展到基于全局约束的精化推断,给出子项类型的具体居民以展示为何类型检查失败;最后,在 Liquid Haskell 的扩展 HayStack 中实现自动发现类型反驳,并提供交互界面帮助理解。评估使用 Liquid Haskell 回归基准集和 G2 基准集,HayStack 对 99.7% 的基准找到反驳,包括抽象精化、有界精化和 reflection 等复杂类型构造,且比 G2 快一个数量级。

问题
精化类型检查失败时错误信息晦涩,难以确定失败根因,尤其当检查依赖全局精化推断时。
方法
将标准双向类型检查规则系统化转换为反驳,并引入 must-instantiation 处理全局约束推断,在 HayStack 中实现自动反驳发现与交互式解释。
评估
在 Liquid Haskell 回归基准和 G2 基准上评估,HayStack 对 99.7% 的基准找到反驳,支持复杂类型构造,且比 G2 快一个数量级。
原文摘要(Abstract)

Refinement types combine SMT decidable constraints with a compositional, syntax-directed type system to provide a convenient way to statically and automatically check properties of programs. However, when type checking fails, programmers must use cryptic error messages that, at best, point out the code location where a subtyping constraint failed to determine the root cause of the failure. In this paper, we introduce refinement type refutations , a new approach to explaining why refinement type checking fails, which mirrors the compositional way in which refinement type checking is carried out. First, we show how to systematically transform standard bidirectional type checking rules to obtain refutations. Second, we extend the approach to account for global constraint-based refinement inference via the notion of a must-instantiation : a set of concrete inhabitants of the types of subterms that suffice to demonstrate why typing fails. Third, we implement our method in H ay S tack –an extension to L iquid H askell which automatically finds type-refutations when refinement type checking fails, and helps users understand refutations via an interactive user-interface. Finally, we present an empirical evaluation of H ay S tack using the regression benchmark-set of L iquid H askell , and the benchmark set of G2, a previous method that searches for (non-compositional) counterexample traces by symbolically executing Haskell source. We show that H ay S tack can find refutations for 99.7 % of benchmarks, including those with complex typing constructs ( e.g ., abstract and bounded refinements, and reflection), and does so, an order of magnitude faster than G2.

链接与引用

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

BibTeX
@article{WebbersGJ24,
  title = {Refinement Type Refutations},
  author = {Robin Webbers and Klaus von Gleissenthall and Ranjit Jhala},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689745}
}