paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Fair enumeration combinators

公平枚举组合子
JFP vol.272017匹配度 3/10 · 论文属于属性测试与形式语义方向,讨论枚举组合子的公平性理论及其在发现程序语言模型缺陷中的应用,与用户核心关注的静态分析、LLM/Agent 与程序分析交叉、浮点程序分析或贝叶斯程序分析均无直接关联。虽有一定理论形式化与工程评估,但与研究方向仅存在宽泛的 PL/形式方法边缘关联。引用 9 inbox
MAX S. NEW, BURKE FETSCHER, ROBERT BRUCE FINDLER, JAY MCCARTHY
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出枚举组合子的公平性理论,设计公平组合子并证明其性质,用于属性测试更高效地发现程序语言模型缺陷。

属性测试常把枚举表示为自然数与类型元素间的双射,但不同枚举组合子的效率差异很大。本文提出“公平性”性质来刻画更适合属性测试的组合子:公平组合子在构造结果时均衡地索引其参数枚举,例如三元组取第 n 个元素时约向各分量索引 n 的三次方根,三路联合则约返回第 n/3 个元素。作者给出枚举组合子的语义和公平性理论,证明新组合子公平,且某些公平组合子的组合并不公平。最后在寻找编程语言模型缺陷的任务上评估,发现公平枚举组合子与调优随机生成器优势互补(短时间更好、长时间更差),而不公平组合子整体更差。

问题
如何为属性测试设计更高效的枚举组合子,避免不公平组合子导致的索引分布偏斜。
方法
定义枚举组合子的公平性,给出其语义与公平性理论,构造公平组合子并证明其公平性及某些组合的不公平性。
评估
在寻找编程语言模型缺陷的任务中比较公平与不公平组合子及调优随机生成器,评估缺陷发现效果。
原文摘要(Abstract)

Abstract Enumerations represented as bijections between the natural numbers and elements of some given type have recently garnered interest in property-based testing because of their efficiency and flexibility. There are, however, many ways of defining these bijections, some of which are better than others. This paper offers a new property of enumeration combinators called fairness that identifies enumeration combinators that are better suited to property-based testing. Intuitively, the result of a fair combinator indexes into its argument enumerations equally when constructing its result. For example, extracting the n th element from our enumeration of three-tuples indexes about $\sqrt[3]{n}$ elements into each of its components instead of, say, indexing $\sqrt[2]{n}$ into one and $\sqrt[4]{n}$ into the other two, as you would if a three-tuple were built out of nested pairs. Similarly, extracting the n th element from our enumeration of a three-way union returns an element that is $\frac{n}{3}$ into one of the argument enumerators. The paper presents a semantics of enumeration combinators, a theory of fairness, proofs establishing fairness of our new combinators and that some combinations of fair combinators are not fair. We also report on an evaluation of fairness for the purpose of finding bugs in programming-language models. We show that fair enumeration combinators have complementary strengths to an existing, well-tuned ad hoc random generator (better on short time scales and worse on long time scales) and that using unfair combinators is worse across the board.

链接与引用

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

BibTeX
@article{NewFFM17,
  title = {Fair enumeration combinators},
  author = {MAX S. NEW and BURKE FETSCHER and ROBERT BRUCE FINDLER and JAY MCCARTHY},
  journal = {Journal of Functional Programming},
  volume = {27},
  year = {2017},
  doi = {10.1017/s0956796817000107}
}