paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Searching entangled program spaces

搜索纠缠的程序空间
ICFP 6(ICFP)2022匹配度 2/10 · 论文属于经典程序合成与自动机/PL理论,提出 ECTA 与 Haskell 合成器;但未涉及用户核心关注的 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析,因此匹配度低。引用 16 inbox
James Koppel, Zheng Guo, Edsko de Vries, Armando Solar-Lezama, Nadia Polikarpova
crossref: 2026-09-10

AI 速览

一句话:提出等式约束树自动机(ECTA)以紧凑表示子项选择相互纠缠的程序空间,并据此实现高性能 Haskell 合成器 Hectare。

程序合成与基于重写的优化等问题往往需要在天文数字规模的程序空间中搜索。已有方法依赖版本空间代数、有限树自动机、e-graph 等专用数据结构来紧凑表示这些空间,但它们本质上都利用了子项的独立性,因而无法高效表示子项选择相互纠缠的复杂程序空间。本文提出等式约束树自动机(equality-constrained tree automata, ECTA),一种可紧凑表示带纠缠子项的大规模程序空间的新数据结构,并给出从 ECTA 中抽取程序的高效算法,实现为性能良好的 Haskell 库 ecta。基于该库,作者构建了面向 Haskell 的类型驱动程序合成器 Hectare。实验表明,Hectare 显著优于最先进的合成器 Hoogle+,平均加速达 8 倍,而其实现代码量却小一个数量级。

问题
现有版本空间代数、有限树自动机与 e-graph 等程序空间表示结构都依赖子项独立性,难以紧凑表示子项选择相互纠缠的程序空间,导致合成与重写优化在此类空间上效率低下。
方法
提出等式约束树自动机(ECTA)这一新数据结构来紧凑表示纠缠程序空间,设计从 ECTA 中抽取程序的高效算法,并用 Haskell 实现为 ecta 库,进而构建类型驱动合成器 Hectare。
评估
通过实现 ecta 库并构建 Hectare 合成器,与最先进的 Haskell 合成器 Hoogle+ 进行对比,Hectare 平均获得 8 倍加速,同时实现规模小一个数量级。
原文摘要(Abstract)

Many problem domains, including program synthesis and rewrite-based optimization, require searching astronomically large spaces of programs. Existing approaches often rely on building specialized data structures—version-space algebras, finite tree automata, or e-graphs—to compactly represent such spaces. At their core, all these data structures exploit independence of subterms; as a result, they cannot efficiently represent more complex program spaces, where the choices of subterms are entangled. We introduce equality-constrained tree automata (ECTAs), a new data structure, designed to compactly represent large spaces of programs with entangled subterms. We present efficient algorithms for extracting programs from ECTAs, implemented in a performant Haskell library, ecta. Using the ecta library, we construct Hectare, a type-driven program synthesizer for Haskell. Hectare significantly outperforms a state-of-the-art synthesizer Hoogle+—providing an average speedup of 8×—despite its implementation being an order of magnitude smaller.

链接与引用

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

BibTeX
@article{paperbot1487,
  title = {Searching entangled program spaces},
  author = {James Koppel and Zheng Guo and Edsko de Vries and Armando Solar-Lezama and Nadia Polikarpova},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {ICFP},
  year = {2022},
  doi = {10.1145/3547622}
}