Explainable Program Synthesis by Localizing Specifications
Amirmohammad Nazari, Yifei Huang, Roopsha Samanta, Arjun Radhakrishna, Mukund Raghothaman
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6d26222f-e290-4ec3-854d-74a93606fbe3Cited by top-tier papers1
Ask how each one uses itBuilds on8
- CNN Explainer: Learning Convolutional Neural Networks with Interactive VisualizationZijie J. Wang, Robert Turko, Omar Shaikh, Haekyu Park et al.IEEE VIS 2020 · 341 citations
- egg: Fast and extensible equality saturationMax Willsey, Chandrakana Nandi, Yisu Remy Wang, Oliver Flatt et al.POPL 2021 · 170 citations
- DreamCoder: bootstrapping inductive program synthesis with wake-sleep library learningKevin Ellis, Catherine Wong, Maxwell I. Nye, Mathias Sablé-Meyer et al.PLDI 2021 · 97 citations
- Interactive Program Synthesis by Augmented ExamplesTianyi Zhang, London Lowmanstone, Xinyu Wang, Elena L. GlassmanUIST 2020 · 57 citations
- Small-Step Live Programming by ExampleKasra Ferdowsifard, Allen Ordookhanians, Hila Peleg, Sorin Lerner et al.UIST 2020 · 40 citations
Related papers
- C2S: translating natural language comments to formal program specificationsJuan Zhai, Yu Shi, Minxue Pan, Guian Zhou et al.FSE 2020 · 44 citations
- Synthesizing SpecificationsKanghee Park, Loris D'Antoni, Thomas W. RepsOOPSLA 2023 · 9 citations
- Interpretable Program SynthesisTianyi Zhang, Zhiyang Chen, Yuanli Zhu, Priyan Vaithilingam et al.CHI 2021 · 25 citations
- Counterexample-Guided Inference of Modular SpecificationsWilliam T. Hallahan, Ranjit Jhala, Ruzica PiskacOOPSLA 2025 · 1 citation
- Explainable Network Verification via Localized SubspecificationYongzheng Zhang, Yaxuan Lin, Haoxian Chen, Ruize Ma et al.SIGCOMM 2026
