paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Program synthesis by type-guided abstraction refinement

类型引导的抽象精化程序合成
POPL 4(POPL)2019匹配度 2/10 · 该论文属于纯 PL 方向的类型导向程序合成,核心是抽象精化与类型系统,未涉及用户当前关注的静态分析、Agentic/LLM 程序、浮点程序分析或贝叶斯程序分析等交叉方向。仅与“形式化+工程实现”的广义 PL 兴趣有较弱关联。引用 44 inbox
Zheng Guo, Michael James, David Justo, Jiaxiao Zhou, Ziteng Wang, Ranjit Jhala, Nadia Polikarpova
crossref: 2026-09-10

AI 速览

一句话:提出 TYGAR,以抽象类型图可达性搜索结合不可类型性证明迭代精化,实现多态组件的高效类型导向程序合成。

本文研究类型导向的基于组件的程序合成:给定一组带类型组件和一个查询类型,目标是合成出具有该类型的项。传统基于直觉主义逻辑证明搜索的方法难以扩展到现代语言动辄成百上千组件的标准库;已有的基于图可达性的 Java 方法虽可扩展,却只适用于单态数据与组件,多态会无限膨胀待搜索图,使合成不可行。作者提出 TYGAR,在表示潜在无界具体类型集合的抽象类型上构图,用图可达性搜索候选项,并引入新算法,利用错误类型候选的不可类型性证明迭代精化抽象,直至找到良类型结果。作者在 H+ 中实现该方法,输入 Haskell 库与查询类型,输出使用库函数的 Haskell 项。对 44 个查询、合计 291 个组件的评估显示,32 个查询在前五个结果内返回有趣解,首个解中位时间仅 1.4 秒,且迭代精化相对穷举枚举的收益在更难查询上更明显。

问题
类型导向的基于组件合成在面对现代语言中成百上千组件及多态数据类型与组件时,传统证明搜索不可扩展,而现有图可达性方法又会因多态导致搜索图无限膨胀。
方法
在抽象类型上构建图,以可达性搜索候选项,并利用坏类型候选的不可类型性证明迭代精化抽象,直到得到良类型项;该方法在 Haskell 工具 H+ 中实现。
评估
在流行 Haskell 库共 291 个组件上评估 44 个查询,其中 32 个查询在前五个结果内得到有趣解,首个解中位时间 1.4 秒,并观察到迭代精化在较难查询上收益更显著。
原文摘要(Abstract)

We consider the problem of type-directed component-based synthesis where, given a set of (typed) components and a query type , the goal is to synthesize a term that inhabits the query. Classical approaches based on proof search in intuitionistic logics do not scale up to the standard libraries of modern languages, which span hundreds or thousands of components. Recent graph reachability based methods proposed for Java do scale, but only apply to monomorphic data and components: polymorphic data and components infinitely explode the size of the graph that must be searched, rendering synthesis intractable. We introduce type-guided abstraction refinement (TYGAR), a new approach for scalable type-directed synthesis over polymorphic datatypes and components. Our key insight is that we can overcome the explosion by building a graph over abstract types which represent a potentially unbounded set of concrete types. We show how to use graph reachability to search for candidate terms over abstract types, and introduce a new algorithm that uses proofs of untypeability of ill-typed candidates to iteratively refine the abstraction until a well-typed result is found. We have implemented TYGAR in H+, a tool that takes as input a set of Haskell libraries and a query type, and returns a Haskell term that uses functions from the provided libraries to implement the query type. Our support for polymorphism allows H+ to work with higher-order functions and type classes, and enables more precise queries due to parametricity. We have evaluated H+ on 44 queries using a set of popular Haskell libraries with a total of 291 components. H+ returns an interesting solution within the first five results for 32 out of 44 queries. Our results show that TYGAR allows H+ to rapidly return well-typed terms, with the median time to first solution of just 1.4 seconds. Moreover, we observe that gains from iterative refinement over exhaustive enumeration are more pronounced on harder queries.

链接与引用

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

BibTeX
@article{paperbot577,
  title = {Program synthesis by type-guided abstraction refinement},
  author = {Zheng Guo and Michael James and David Justo and Jiaxiao Zhou and Ziteng Wang and Ranjit Jhala and Nadia Polikarpova},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3371080}
}