Skip to main content

Schema-Guided Synthesis of Imperative Programs by Constraint Solving

  • Conference paper
Logic Based Program Synthesis and Transformation (LOPSTR 2004)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3573))

Abstract

We present a method for schema-guided synthesis of imperative programs computing polynomial functions and their inverses. The schemas of our approach contain parameters representing both fragments of code and fragments of invariants, and they generate programs annotated with loop invariants establishing partial correctness. Schema application entails simultaneously instantiating the code parameters to polynomials and the invariant parameters to systems of polynomial equalities. By bounding the degrees of these polynomials and their number, our method reduces schema instantiation to non-linear constraint solving, based on the theory of polynomial ideals. Although non-linear constraint solving is NP-hard, a solution can be generated automatically when the resulting system contains few constraints. A specialization of our method yields linear constraints by further restricting the form of the invariants. This restriction improves the efficiency of constraint solving, but may fail to synthesize programs derivable by the general method.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Anderson, P., Basin, D.: Program development schemata as derived rules. Journal of Symbolic Computation 30(1), 5–36 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  2. Basin, D., Deville, Y., Flener, P., Hamfelt, A., Nilsson, J.F.: Synthesis of programs in computational logic. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic, pp. 30–65. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  3. Becker, T., Weispfenning, V.: Gröbner Bases: A Computational Approach to Commutative Algebra. Springer, New York (1993)

    MATH  Google Scholar 

  4. Canny, J.F., Kaltofen, E., Yagati, L.: Solving systems of non-linear polynomial equations faster. In: Gonnet, G.H. (ed.) International Symposium on Symbolic and Algebraic Computation, pp. 121–128. ACM Press, New York (1989)

    Google Scholar 

  5. Colón, M., Sankaranarayanan, S., Sipma, H.: Linear invariant generation using non-linear constraint solving. In: Somenzi, F., Hunt Jr., W. (eds.) 15th International Conference on Computer Aided Verification, pp. 420–432. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  6. Colón, M.A., Sipma, H.B.: Synthesis of linear ranking functions. In: Margaria, T., Yi, W. (eds.) 7th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, pp. 67–81. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  7. Dijkstra, E.W.: A Discipline of Programming. Prentice-Hall, Inc., Englewood Cliffs (1976)

    MATH  Google Scholar 

  8. Flener, P.: Achievements and prospects of program synthesis. In: Kakas, A.C., Sadri, F. (eds.) Computational Logic: Logic Programming and Beyond, Essays in Honour of Robert A. Kowalski, pp. 310–346. Springer, Heidelberg (2002)

    Google Scholar 

  9. Flener, P., Deville, Y.: Towards stepwise, schema-guided synthesis of logic programs. In: Clement, T.P., Lau, K.-K. (eds.) International Workshop on Logic Program Synthesis and Transformation, pp. 46–64. Springer, Heidelberg (1992)

    Google Scholar 

  10. Flener, P., Lau, K.-K., Ornaghi, M., Richardson, J.: An abstract formalization of correct schemas for program synthesis. Journal of Symbolic Computation 30(1), 93–127 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  11. Floyd, R.W.: Assigning meanings to programs. In: Proceedings of the Symposium on Applied Mathematics. Mathematical Aspects of Computer Science, vol. 19, pp. 19–32 (1967)

    Google Scholar 

  12. Granvilliers, L.: RealPaver User’s Manual. Institut de Recherche en Informatique de Nantes, 0.3 edition (July 2003)

    Google Scholar 

  13. Manna, Z.: Mathematical Theory of Computation. McGraw-Hill, New York (1974)

    MATH  Google Scholar 

  14. Manna, Z., Waldinger, R.J.: Fundamentals of deductive program synthesis. IEEE Transactions on Software Engineering 18(8), 674–704 (1992)

    Article  Google Scholar 

  15. Mayr, E., Meyer, A.: The complexity of the word problems for commutative semigroups and polynomial ideals. Advances in Mathematics 46(3), 305–329 (1982)

    Article  MATH  MathSciNet  Google Scholar 

  16. Necula, G.C.: Proof-carrying code. In: 24th ACM Symposium on Principles of Programming Languages, pp. 106–119. ACM Press, New York (1997)

    Chapter  Google Scholar 

  17. Neumaier, A.: Interval Methods for Systems of Equations. Cambridge University Press, Cambridge (1990)

    MATH  Google Scholar 

  18. Rich, C., Waters, R.C.: Approaches to automatic programming. Advances in Computers 37, 1–57 (1993)

    Article  Google Scholar 

  19. Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Non-linear loop invariant generation using Gröbner bases. In: Jones, N.D., Leroy, X. (eds.) 31st ACM Symposium on Principles of Programming Languages, pp. 318–329. ACM Press, New York (2004)

    Chapter  Google Scholar 

  20. Schrijver, A.: Theory of Linear and Integer Programming. John Wiley & Sons, Chichester (1986)

    MATH  Google Scholar 

  21. Smith, D.R.: KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering 16(9), 1024–1043 (1990)

    Article  Google Scholar 

  22. Stark, J., Ireland, A.: Towards automatic imperative program synthesis through proof planning. In: 14th IEEE International Conference on Automated Software Engineering, pp. 44–51. IEEE Computer Society Press, Los Alamitos (1999)

    Chapter  Google Scholar 

  23. Stickel, M.E., Waldinger, R.J., Lowry, M.R., Pressburger, T., Underwood, I.: Deductive composition of astronomical software from subroutine libraries. In: Bundy, A. (ed.) 12th International Conference on Automated Deduction, pp. 341–355. Springer, Heidelberg (1994)

    Google Scholar 

  24. Tarski, A.: A Decision Method for Elementary Algebra and Geometry. University of California Press (1951)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2005 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Colón, M.A. (2005). Schema-Guided Synthesis of Imperative Programs by Constraint Solving. In: Etalle, S. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2004. Lecture Notes in Computer Science, vol 3573. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11506676_11

Download citation

  • DOI: https://doi.org/10.1007/11506676_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-26655-6

  • Online ISBN: 978-3-540-31683-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics