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.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Anderson, P., Basin, D.: Program development schemata as derived rules. Journal of Symbolic Computation 30(1), 5–36 (2000)
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)
Becker, T., Weispfenning, V.: Gröbner Bases: A Computational Approach to Commutative Algebra. Springer, New York (1993)
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)
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)
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)
Dijkstra, E.W.: A Discipline of Programming. Prentice-Hall, Inc., Englewood Cliffs (1976)
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)
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)
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)
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)
Granvilliers, L.: RealPaver User’s Manual. Institut de Recherche en Informatique de Nantes, 0.3 edition (July 2003)
Manna, Z.: Mathematical Theory of Computation. McGraw-Hill, New York (1974)
Manna, Z., Waldinger, R.J.: Fundamentals of deductive program synthesis. IEEE Transactions on Software Engineering 18(8), 674–704 (1992)
Mayr, E., Meyer, A.: The complexity of the word problems for commutative semigroups and polynomial ideals. Advances in Mathematics 46(3), 305–329 (1982)
Necula, G.C.: Proof-carrying code. In: 24th ACM Symposium on Principles of Programming Languages, pp. 106–119. ACM Press, New York (1997)
Neumaier, A.: Interval Methods for Systems of Equations. Cambridge University Press, Cambridge (1990)
Rich, C., Waters, R.C.: Approaches to automatic programming. Advances in Computers 37, 1–57 (1993)
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)
Schrijver, A.: Theory of Linear and Integer Programming. John Wiley & Sons, Chichester (1986)
Smith, D.R.: KIDS: A semiautomatic program development system. IEEE Transactions on Software Engineering 16(9), 1024–1043 (1990)
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)
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)
Tarski, A.: A Decision Method for Elementary Algebra and Geometry. University of California Press (1951)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)