paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Specification-guided component-based synthesis from effectful libraries

从带副作用的库中进行规范引导的组件式合成
OOPSLA 6(OOPSLA2)2022匹配度 2/10 · 论文属于程序合成与形式化验证方向,使用Hoare前后条件和effectful库规格引导合成,但未涉及LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析,与用户当前研究主线关联较弱。引用 7 inbox
Ashish Mishra, Suresh Jagannathan
crossref: 2026-09-10

AI 速览

一句话:提出用 Hoare 前后条件表达库效应,以双向搜索和冲突驱动学习引导组件式程序合成。

基于组件的合成利用库 API 构造程序,但库 API 常带副作用:对全局状态的修改会影响组件组合,使搜索空间急剧增大,传统枚举式合成难以应对。本文提出规范引导的合成过程,用 Hoare 风格前后条件描述候选库组件的细粒度效应,并驱动双向搜索:前向搜索在已有上下文下构造更大项,却不感知目标;后向搜索寻找与目标一致的项,却不感知合成上下文。二者交替进行。为提升效率与可扩展性,作者将冲突驱动学习融入算法,对失败搜索路径给出语义刻画并剪枝候选空间。作者实现工具并在多个带副作用规范的 OCaml 库合成任务上验证了有效性。

问题
当库 API 带有副作用时,组件组合会改变全局状态,导致候选空间巨大,传统枚举式组件合成难以正确且高效地搜索程序。
方法
提出规范引导的组件式合成,用 Hoare 风格前后条件刻画库组件的细粒度效应,并交替执行前向上下文构造与后向目标导向搜索,同时加入冲突驱动学习剪枝失败路径。
评估
在实现的原型工具上,针对配备副作用规范的 OCaml 库,对若干具有挑战性的合成问题进行了有效性评估。
原文摘要(Abstract)

Component-based synthesis seeks to build programs using the APIs provided by a set of libraries. Oftentimes, these APIs have effects, which make it challenging to reason about the correctness of potential synthesis candidates. This is because changes to global state made by effectful library procedures affect how they may be composed together, yielding an intractably large search space that can confound typical enumerative synthesis techniques. If the nature of these effects are exposed as part of their specification, however, deductive synthesis approaches can be used to help guide the search for components. In this paper, we present a new specification-guided synthesis procedure that uses Hoare-style pre- and post-conditions to express fine-grained effects of potential library component candidates to drive a bi-directional synthesis search strategy. The procedure alternates between a forward search process that seeks to build larger terms given an existing context but which is otherwise unaware of the actual goal, alongside a backward search mechanism that seeks terms consistent with the desired goal but which is otherwise unaware of the context from which these terms must be synthesized. To further improve efficiency and scalability, we integrate a conflict-driven learning procedure into the synthesis algorithm that provides a semantic characterization of previously encountered unsuccessful search paths that is used to prune the space of possible candidates as synthesis proceeds. We have implemented our ideas in a tool called and demonstrate its effectiveness on a number of challenging synthesis problems defined over OCaml libraries equipped with effectful specifications.

链接与引用

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

BibTeX
@article{paperbot1448,
  title = {Specification-guided component-based synthesis from effectful libraries},
  author = {Ashish Mishra and Suresh Jagannathan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {OOPSLA2},
  year = {2022},
  doi = {10.1145/3563310}
}