Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

From program verification to program synthesis

Published: 17 January 2010 Publication History
  • Get Citation Alerts
  • Abstract

    This paper describes a novel technique for the synthesis of imperative programs. Automated program synthesis has the potential to make programming and the design of systems easier by allowing programs to be specified at a higher-level than executable code. In our approach, which we call proof-theoretic synthesis, the user provides an input-output functional specification, a description of the atomic operations in the programming language, and a specification of the synthesized program's looping structure, allowed stack space, and bound on usage of certain operations. Our technique synthesizes a program, if there exists one, that meets the input-output specification and uses only the given resources.
    The insight behind our approach is to interpret program synthesis as generalized program verification, which allows us to bring verification tools and techniques to program synthesis. Our synthesis algorithm works by creating a program with unknown statements, guards, inductive invariants, and ranking functions. It then generates constraints that relate the unknowns and enforces three kinds of requirements: partial correctness, loop termination, and well-formedness conditions on program guards. We formalize the requirements that program verification tools must meet to solve these constraint and use tools from prior work as our synthesizers.
    We demonstrate the feasibility of the proposed approach by synthesizing programs in three different domains: arithmetic, sorting, and dynamic programming. Using verification tools that we previously built in the VS3 project we are able to synthesize programs for complicated arithmetic algorithms including Strassen's matrix multiplication and Bresenham's line drawing; several sorting algorithms; and several dynamic programming algorithms. For these programs, the median time for synthesis is 14 seconds, and the ratio of synthesis to verification time ranges between 1x to 92x (with an median of 7x), illustrating the potential of the approach.

    References

    [1]
    D. Basin, Y. DeVille, P. Flener, A. Hamfelt, and J.F. NIlsson. Synthesis of programs in computational logic. In LNCS 3049.
    [2]
    Yves Bertot and Pierre Casteran. Interactive Theorem Proving and Program Development. SpringerVerlag, 2004.
    [3]
    Edmund M. Clarke and E. Allen Emerson. Design and synthesis of synchronization skeletons using branching-time temporal logic. In Logic of Programs, pages 52--71. Springer-Verlag, 1982.
    [4]
    Edmund M. Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith. Counterexample-guided abstraction refinement. In CAV'00, pages 154--169, 2000.
    [5]
    Michael Colon. Schema-guided synthesis of imperative programs by constraint solving. In LOPSTR, pages 166--181, 2004.
    [6]
    Michael Colon, Sriram Sankaranarayanan, and Henny Sipma. Linear invariant generation using non-linear constraint solving. In CAV'03.
    [7]
    Byron Cook, Andreas Podelski, and Andrey Rybalchenko. Termination proofs for systems code. In PLDI'06, pages 415--426, 2006.
    [8]
    T. Cormen, C. Leiserson, and R. Rivest. Introduction to Algorithms.
    [9]
    P. Cousot and R. Cousot. Abstract interpretation a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In POPL'77.
    [10]
    Leonardo de Moura and Nikolaj Bjorner. Z3, 2008. http://research.microsoft.com/projects/Z3/.
    [11]
    Edsger W. Dijkstra. Guarded commands, nondeterminacy and formal derivation of programs. Communications of the ACM, 18(8):453--457.
    [12]
    Edsger W. Dijkstra. A constructive approach to the problem of program correctness. BIT Numerical Math., 8(3):174--186, 1968.
    [13]
    Edsger W. Dijkstra and Carel S. Scholten. Predicate Calculus and Program Semantics. Texts and Monographs in CS. 1990.
    [14]
    Edsger Wybe Dijkstra. A Discipline of Programming. 1976.
    [15]
    Joe W. Duran. Heuristics for program synthesis using loop invariants. In ACM'78, pages 891--900, New York, NY, USA. ACM.
    [16]
    Jean-Christophe Filliatre. Using SMT solvers for deductive verification of C and Java programs. In SMT'08.
    [17]
    Pierre Flener, Kung-Kiu Lau, Mario Ornaghi, and Julian Richardson. An abstract formalization of correct schemas for program synthesis. J. Symb. Comput., 30(1):93--127, 2000.
    [18]
    David Gries. The Science of Programming. 1987.
    [19]
    Andreas Griesmayer, Paul Bloem Roderick, and Byron Cook. Repair of boolean programs with an application to C. In CAV'06.
    [20]
    Sumit Gulwani, Saurabh Srivastava, and Ramarathnam Venkatesan. Constraint-based invariant inference over predicate abstraction. In VMCAI'09.
    [21]
    Sumit Gulwani, Saurabh Srivastava, and Ramarathnam Venkatesan. Program analysis as constraint solving. In PLDI'08, pages 281--292.
    [22]
    Matthew S. Hecht and Jeffrey D. Ullman. Flow graph reducibility. In STOC'72, pages 238--250, New York, NY, USA, 1972. ACM.
    [23]
    Thomas A. Henzinger, Ranjit Jhala, Rupak Majumdar, and Kenneth L. McMillan. Abstractions from proofs. In POPL'04, 2004.
    [24]
    Barbara Jobstmann and Roderick Bloem. Optimizations for LTL synthesis. In FMCAD'06, pages 117--124. IEEE Computer Society.
    [25]
    Barbara Jobstmann, Andreas Griesmayer, and Roderick Paul Bloem. Program repair as a game. In CAV'05, pages 226--238.
    [26]
    Shuvendu Lahiri and Shaz Qadeer. Back to the future: revisiting precise program verification using SMT solvers. In POPL'08.
    [27]
    Zohar Manna and Richard J. Waldinger. Toward automatic program synthesis. Communications of the ACM, 14(3):151--165, 1971.
    [28]
    A. Pnueli and R. Rosner. On the synthesis of a reactive module. In POPL'89, pages 179--190, New York, NY, USA. ACM.
    [29]
    Armando Solar-Lezama, Gilad Arnold, Liviu Tancau, Rastislav Bodik, Vijay Saraswat, and Sanjit Seshia. Sketching stencils. In PLDI'07, pages 167--178, New York, NY, USA. ACM.
    [30]
    Armando Solar-Lezama, Christopher Grant Jones, and Rastislav Bodik. Sketching concurrent data structures. In PLDI'08.
    [31]
    Armando Solar-Lezama, Rodric Rabbah, Rastislav Bodik, and Kemal Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI'05.
    [32]
    Saurabh Srivastava and Sumit Gulwani. Program verification using templates over predicate abstraction. In PLDI'09.
    [33]
    Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. VS3 . http://www.cs.umd.edu/~saurabhs/pacs/.
    [34]
    Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. VS3: SMT solvers for program verification. In CAV'09.
    [35]
    Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. Proof-theoretic program synthesis: From program verification to program synthesis. Technical report, Microsoft Research, Redmond, 2009.
    [36]
    Martin Vechev, Eran Yahav, and Greta Yorsh. Inferring synchronization under limited observability. In TACAS'09, 2009.
    [37]
    Martin Vechev, Eran Yahav, and Greta Yorsh. Abstraction-guided synthesis. In POPL'10, 2010.
    [38]
    Nicholas Wirth. Systematic Programming: An Introduction. 1973.

    Cited By

    View all
    • (2023)Algebro-geometric Algorithms for Template-Based Synthesis of Polynomial ProgramsProceedings of the ACM on Programming Languages10.1145/35860527:OOPSLA1(727-756)Online publication date: 6-Apr-2023
    • (2023)Program Synthesis in SaturationAutomated Deduction – CADE 2910.1007/978-3-031-38499-8_18(307-324)Online publication date: 2-Sep-2023
    • (2022)Multi-donor Neural Transfer Learning for Genetic ProgrammingACM Transactions on Evolutionary Learning and Optimization10.1145/35630432:4(1-40)Online publication date: 24-Nov-2022
    • Show More Cited By

    Index Terms

    1. From program verification to program synthesis

        Recommendations

        Comments

        Information & Contributors

        Information

        Published In

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 1
        POPL '10
        January 2010
        500 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1707801
        Issue’s Table of Contents
        • cover image ACM Conferences
          POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2010
          520 pages
          ISBN:9781605584799
          DOI:10.1145/1706299
        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        Published: 17 January 2010
        Published in SIGPLAN Volume 45, Issue 1

        Check for updates

        Author Tags

        1. proof-theoretic program synthesis
        2. verification

        Qualifiers

        • Research-article

        Contributors

        Other Metrics

        Bibliometrics & Citations

        Bibliometrics

        Article Metrics

        • Downloads (Last 12 months)179
        • Downloads (Last 6 weeks)13

        Other Metrics

        Citations

        Cited By

        View all
        • (2023)Algebro-geometric Algorithms for Template-Based Synthesis of Polynomial ProgramsProceedings of the ACM on Programming Languages10.1145/35860527:OOPSLA1(727-756)Online publication date: 6-Apr-2023
        • (2023)Program Synthesis in SaturationAutomated Deduction – CADE 2910.1007/978-3-031-38499-8_18(307-324)Online publication date: 2-Sep-2023
        • (2022)Multi-donor Neural Transfer Learning for Genetic ProgrammingACM Transactions on Evolutionary Learning and Optimization10.1145/35630432:4(1-40)Online publication date: 24-Nov-2022
        • (2022)Ever Change a Running System: Structured Software Reengineering Using Automatically Proven-Correct Transformation RulesErnst Denert Award for Software Engineering 202010.1007/978-3-030-83128-8_10(197-226)Online publication date: 28-Feb-2022
        • (2021)Multi-modal program inference: a marriage of pre-trained language models and component-based synthesisProceedings of the ACM on Programming Languages10.1145/34855355:OOPSLA(1-29)Online publication date: 15-Oct-2021
        • (2021)Grafs: declarative graph analyticsProceedings of the ACM on Programming Languages10.1145/34735885:ICFP(1-32)Online publication date: 19-Aug-2021
        • (2021)Defining behaviorizeable relations to enable inference in semi-automatic program synthesisJournal of Logical and Algebraic Methods in Programming10.1016/j.jlamp.2021.100714123(100714)Online publication date: Nov-2021
        • (2021)BanditFuzz: Fuzzing SMT Solvers with Multi-agent Reinforcement LearningFormal Methods10.1007/978-3-030-90870-6_6(103-121)Online publication date: 10-Nov-2021
        • (2021): Deductive Synthesis of Sorting Algorithms in Theorema Theoretical Aspects of Computing – ICTAC 202110.1007/978-3-030-85315-0_18(314-333)Online publication date: 6-Sep-2021
        • (2021)Deductive Synthesis of Programs with Pointers: Techniques, Challenges, OpportunitiesComputer Aided Verification10.1007/978-3-030-81685-8_5(110-134)Online publication date: 15-Jul-2021
        • Show More Cited By

        View Options

        Get Access

        Login options

        View options

        PDF

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        Media

        Figures

        Other

        Tables

        Share

        Share

        Share this Publication link

        Share on social media