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