We present a method for the synthesis of polynomial lasso programs. These programs consist of a program stem, a set of transitions, and an exit condition, all in the form of algebraic assertions (conjunctions of polynomial equalities). Central to this approach is the discovery of non-linear (algebraic) loop invariants. We extend Sankaranarayanan, Sipma, and Manna’s template-based approach and prove a completeness criterion. We perform program synthesis by generating a constraint whose solution is a synthesized program together with a loop invariant that proves the program’s correctness. This constraint is non-linear and is passed to an SMT solver. Moreover, we can enforce the termination of the synthesized program with the support of test cases.


Invariance Condition Polynomial Ideal Synthesis Problem Nonlinear Constraint Abstract Domain 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Non-linear loop invariant generation using Gröbner bases. In: POPL (2004)Google Scholar
  2. 2.
    Solar-Lezama, A., Tancau, L., Bodík, R., Saraswat, V., Seshia, S.: Combinatorial sketching for finite programs. In: ASPLOS (2006)Google Scholar
  3. 3.
    Gulwani, S., Jha, S., Tiwari, A., Venkatesan, R.: Synthesis of loop-free programs. In: PLDI (2011)Google Scholar
  4. 4.
    Tiwari, A.: An algebraic approach for the unsatisfiability of nonlinear constraints. In: Ong, L. (ed.) CSL 2005. LNCS, vol. 3634, pp. 248–262. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  5. 5.
    Collins, G.E.: Quantifier elimination for real closed fields by cylindrical algebraic decompostion. In: Brakhage, H. (ed.) GI-Fachtagung 1975. LNCS, vol. 33, pp. 134–183. Springer, Heidelberg (1975)Google Scholar
  6. 6.
    Stengle, G.: A Nullstellensatz and a Positivstellensatz in semialgebraic geometry. Math. Ann. 207 (1974)Google Scholar
  7. 7.
    Parrilo, P.A.: Semidefinite programming relaxations for semialgebraic problems. Mathematical Programming Ser. B 96(2) (2003)Google Scholar
  8. 8.
    Müller-Olm, M., Seidl, H.: Computing polynomial program invariants. Inf. Process. Lett. 91(5) (2004)Google Scholar
  9. 9.
    Karr, M.: Affine relationships among variables of a program. Acta Informatica 6, 133–151 (1976)CrossRefzbMATHMathSciNetGoogle Scholar
  10. 10.
    Seidl, H., Flexeder, A., Petter, M.: Analysing all polynomial equations in \({\mathbb Z_{2^w}}\). In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 299–314. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  11. 11.
    Rodríguez-Carbonell, E., Kapur, D.: Automatic generation of polynomial loop invariants: Algebraic foundations. In: ISSAC. ACM (2004)Google Scholar
  12. 12.
    Rodríguez-Carbonell, E., Kapur, D.: Program verification using automatic generation of invariants. In: Liu, Z., Araki, K. (eds.) ICTAC 2004. LNCS, vol. 3407, pp. 325–340. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  13. 13.
    Colón, M.A.: Polynomial approximations of the relational semantics of imperative programs. Sci. Comput. Program. 64(1) (2007)Google Scholar
  14. 14.
    Cachera, D., Jensen, T., Jobin, A., Kirchner, F.: Inference of polynomial invariants for imperative programs: A farewell to Gröbner bases. In: Miné, A., Schmidt, D. (eds.) SAS 2012. LNCS, vol. 7460, pp. 58–74. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  15. 15.
    Bradley, A.R., Manna, Z., Sipma, H.B.: Polyranking for polynomial loops (2005)Google Scholar
  16. 16.
    Colón, M.A.: Schema-guided synthesis of imperative programs by constraint solving. In: Etalle, S. (ed.) LOPSTR 2004. LNCS, vol. 3573, pp. 166–181. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  17. 17.
    Srivastava, S., Gulwani, S., Foster, J.S.: From program verification to program synthesis. In: POPL 2010, pp. 313–326 (2010)Google Scholar
  18. 18.
    Cox, D., Little, J., O’Shea, D.: Ideals, Varieties and Algorithms: An Introduction to Computational Algebraic Geometry and Commutative Algebra. Springer (1991)Google Scholar
  19. 19.
    Neuhaus, R.: Computation of real radicals of polynomial ideals – ii. Journal of Pure and Applied Algebra 124(1-3), 261–280 (1998)CrossRefzbMATHMathSciNetGoogle Scholar
  20. 20.
    Jovanović, D., de Moura, L.: Solving non-linear arithmetic. In: Gramlich, B., Miller, D., Sattler, U. (eds.) IJCAR 2012. LNCS, vol. 7364, pp. 339–354. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  21. 21.
    Rebiha, R., Matringe, N., Moura, A.V.: Endomorphisms for non-trivial non-linear loop invariant generation. In: Fitzgerald, J.S., Haxthausen, A.E., Yenigun, H. (eds.) ICTAC 2008. LNCS, vol. 5160, pp. 425–439. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  22. 22.
    Adams, W.W., Loustaunau, P.: An Introduction to Gröbner Bases. American Mathematical Society (1994)Google Scholar
  23. 23.
    Bachmair, L., Tiwari, A.: D-bases for polynomial ideals over commutative noetherian rings. In: Comon, H. (ed.) RTA 1997. LNCS, vol. 1232, pp. 113–127. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  24. 24.
    Dijkstra, E.W.: A Discipline of Programming. Prentice-Hall (1976)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Jan Leike
    • 1
  • Ashish Tiwari
    • 2
  1. 1.University of FreiburgGermany
  2. 2.SRI InternationalUSA

Personalised recommendations