paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Explainable Program Synthesis by Localizing Specifications

通过局部化规格实现可解释的程序合成
OOPSLA 7(OOPSLA2)2023匹配度 3/10 · 该论文属于程序合成与形式化解释方向,核心是子规格与逻辑验证,与用户关注的静态分析、Agentic/LLM 程序分析、浮点程序分析及贝叶斯程序分析均无直接关联;仅在形式化方法与 PL 工程实现上有一定邻近性。引用 12 inbox
Amirmohammad Nazari, Yifei Huang, Roopsha Samanta, Arjun Radhakrishna, Mukund Raghothaman
crossref: 2026-09-10

AI 速览

一句话:提出子规格机制,为合成程序局部附加由全局规格与上下文推导的逻辑解释,并验证其性质与用户效用。

传统程序合成问题要求找到满足逻辑正确性规格的程序。合成成功时虽能保证实现满足规格,但合成引擎通常是单体式算法,掩盖了规格、实现与用户意图之间的对应关系,开发者难以理解合成结果。本文引入子规格(subspecification)作为解释机制:针对合成实现的某个子表达式,生成一个逻辑公式,描述全局规格及周围实现对其施加的约束。作者开发了构造和验证子规格的算法,并研究其理论性质;通过实验评估子规格生成过程的有效性与运行时间,最后开展用户研究,发现子规格显著有助于理解全局规格、识别替代实现以及调试错误实现。

问题
程序合成虽能保证实现满足规格,但合成器不解释规格、实现与用户意图之间的对应关系,导致合成结果难以理解和调试。
方法
引入子规格机制,为合成实现的子表达式生成由全局规格和周围实现诱导的逻辑约束,并开发构造与验证子规格的算法,分析其理论性质。
评估
通过实验评估子规格生成过程的有效性和运行时间,并通过用户研究检验其在理解全局规格、发现替代实现和调试错误实现方面的作用。
原文摘要(Abstract)

The traditional formulation of the program synthesis problem is to find a program that meets a logical correctness specification. When synthesis is successful, there is a guarantee that the implementation satisfies the specification. Unfortunately, synthesis engines are typically monolithic algorithms, and obscure the correspondence between the specification, implementation and user intent. In contrast, humans often include comments in their code to guide future developers towards the purpose and design of different parts of the codebase. In this paper, we introduce subspecifications as a mechanism to augment the synthesized implementation with explanatory notes of this form. In this model, the user may ask for explanations of different parts of the implementation; the subspecification generated in response is a logical formula that describes the constraints induced on that subexpression by the global specification and surrounding implementation. We develop algorithms to construct and verify subspecifications and investigate their theoretical properties. We perform an experimental evaluation of the subspecification generation procedure, and measure its effectiveness and running time. Finally, we conduct a user study to determine whether subspecifications are useful: we find that subspecifications greatly aid in understanding the global specification, in identifying alternative implementations, and in debugging faulty implementations.

链接与引用

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

BibTeX
@article{paperbot1831,
  title = {Explainable Program Synthesis by Localizing Specifications},
  author = {Amirmohammad Nazari and Yifei Huang and Roopsha Samanta and Arjun Radhakrishna and Mukund Raghothaman},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {OOPSLA2},
  year = {2023},
  doi = {10.1145/3622874}
}