paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Intensional datatype refinement: with application to scalable verification of pattern-match safety

内涵数据类型精化:应用于模式匹配安全性的可扩展验证
POPL 5(POPL)2021匹配度 3/10 · 该论文属于传统PL/形式化验证方向,提出用于模式匹配安全验证的精化类型系统,本身有理论深度和工程实现,但未涉及用户的AI→PL、PL→AI、浮点程序分析或贝叶斯程序分析等核心交叉方向,也未使用LLM/Agent作为工具。引用 3 inbox
Eddie Jones, Steven Ramsay
crossref: 2026-09-10

AI 速览

一句话:提出用于模式匹配安全验证的内涵数据类型精化类型系统,其推断可靠、完备且接近线性时间。

论文研究函数式程序的模式匹配安全问题:验证程序不会因函数定义中模式非穷尽而崩溃。作者提出一种精化类型系统,在 ML 风格代数数据类型类型系统上引入受限的结构子类型和环境级交集,从而描述数据构造子的存在与缺失等内涵信息。该系统支持全自动、可靠且完备的类型推断;在合理假设下,推断的最坏时间复杂度关于程序规模线性,组合性是获得该保证的关键。作者为 Haskell 实现原型,可分析 Hackage 数据库中的若干包,通常在数百毫秒内完成,展示了可扩展性。

问题
如何验证函数式程序不会因非穷尽模式匹配而崩溃,即解决 pattern-match safety 问题。
方法
扩展 ML 风格代数数据类型的精化类型系统,加入受限结构子类型与环境级交集,并设计全自动、可靠完备且最坏线性时间的类型推断。
评估
实现 Haskell 原型,对 Hackage 数据库中的若干包进行分析,通常在数百毫秒内完成,验证了可扩展性。
原文摘要(Abstract)

The pattern-match safety problem is to verify that a given functional program will never crash due to non-exhaustive patterns in its function definitions. We present a refinement type system that can be used to solve this problem. The system extends ML-style type systems with algebraic datatypes by a limited form of structural subtyping and environment-level intersection. We describe a fully automatic, sound and complete type inference procedure for this system which, under reasonable assumptions, is worst-case linear-time in the program size. Compositionality is essential to obtaining this complexity guarantee. A prototype implementation for Haskell is able to analyse a selection of packages from the Hackage database in a few hundred milliseconds.

链接与引用

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

BibTeX
@article{paperbot1169,
  title = {Intensional datatype refinement: with application to scalable verification of pattern-match safety},
  author = {Eddie Jones and Steven Ramsay},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {POPL},
  year = {2021},
  doi = {10.1145/3434336}
}