Inter-procedural Two-Variable Herbrand Equalities

  • Stefan Schulze FrielinghausEmail author
  • Michael Petter
  • Helmut Seidl
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9032)


We prove that all valid Herbrand equalities can be inter-procedurally inferred for programs where all assignments are taken into account whose right-hand sides depend on at most one variable. The analysis is based on procedure summaries representing the weakest pre-conditions for finitely many generic post-conditions with template variables. In order to arrive at effective representations for all occurring weakest pre-conditions, we show for almost all values possibly computed at run-time, that they can be uniquely factorized into tree patterns and a terminating ground term. Moreover, we introduce an approximate notion of subsumption which is effectively decidable and ensures that finite conjunctions of equalities may not grow infinitely. Based on these technical results, we realize an effective fixpoint iteration to infer all inter-procedurally valid Herbrand equalities for these programs.


Constraint System Unique Factorization Variable Assignment Program Variable Ground Term 
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.


  1. 1.
    Cocke, J., Schwartz, J.T.: Programming Languages and Their Compilers: Preliminary Notes. Courant Institute of Mathematical Sciences, New York University (1970)zbMATHGoogle Scholar
  2. 2.
    Cousot, P.: Methods and logics for proving programs. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, Formal Models and Semantics, ch. 15, pp. 843–993. Elsevier Science Publishers, Amsterdam (1990)Google Scholar
  3. 3.
    Engelfriet, J.: Some open questions and recent results on tree transducers and tree languages. In: Book, R. (ed.) Formal Language Theory: Perspectives and Open Problems, pp. 241–286. Academic Press (1980)Google Scholar
  4. 4.
    Flexeder, A., Müller-Olm, M., Petter, M., Seidl, H.: Fast interprocedural linear two-variable equalities. ACM Trans. Program. Lang. Syst. 33(6), 21:1–21:33 (2011)Google Scholar
  5. 5.
    Godoy, G., Tiwari, A.: Invariant checking for programs with procedure calls. In: Palsberg, J., Su, Z. (eds.) SAS 2009. LNCS, vol. 5673, pp. 326–342. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Goldfarb, W.D.: The undecidability of the second-order unification problem. Theoretical Computer Science 13(2), 225–230 (1981)CrossRefzbMATHMathSciNetGoogle Scholar
  7. 7.
    Gulwani, S., Necula, G.C.: A polynomial-time algorithm for global value numbering. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 212–227. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  8. 8.
    Gulwani, S., Tiwari, A.: Computing procedure summaries for interprocedural analysis. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 253–267. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  9. 9.
    Hoare, C.A.R.: An axiomatic basis for computer programming. Communications of the ACM 12(10), 576–580 (1969)CrossRefzbMATHGoogle Scholar
  10. 10.
    Jeż, A.: Context unification is in PSPACE. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) ICALP 2014, Part II. LNCS, vol. 8573, pp. 244–255. Springer, Heidelberg (2014)CrossRefGoogle Scholar
  11. 11.
    Kildall, G.A.: A unified approach to global program optimization. In: 1st Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL), pp. 194–206. ACM (1973)Google Scholar
  12. 12.
    Levy, J., Veanes, M.: On the undecidability of second-order unification. Information and Computation 159(1-2), 125–150 (2000)CrossRefzbMATHMathSciNetGoogle Scholar
  13. 13.
    Müller-Olm, M., Petter, M., Seidl, H.: Interprocedurally analyzing polynomial identities. In: Durand, B., Thomas, W. (eds.) STACS 2006. LNCS, vol. 3884, pp. 50–67. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  14. 14.
    Müller-Olm, M., Seidl, H.: Precise interprocedural analysis through linear algebra. In: Jones, N.D., Leroy, X. (eds.) 31st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 330–341. ACM (January 2004)Google Scholar
  15. 15.
    Müller-Olm, M., Seidl, H.: Analysis of modular arithmetic. ACM Trans. Program. Lang. Syst. 29, 29:1–29:27 (2007)Google Scholar
  16. 16.
    Müller-Olm, M., Seidl, H.: Upper adjoints for fast inter-procedural variable equalities. In: Drossopoulou, S. (ed.) ESOP 2008. LNCS, vol. 4960, pp. 178–192. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  17. 17.
    Müller-Olm, M., Seidl, H., Steffen, B.: Interprocedural herbrand equalities. In: Sagiv, M. (ed.) ESOP 2005. LNCS, vol. 3444, pp. 31–45. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  18. 18.
    Petter, M.: Interprocedural Polynomial Invariants. PhD thesis, Institut für Informatik, Technische Universität München (September 2010)Google Scholar
  19. 19.
    Schulze Frielinghaus, S., Petter, M., Seidl, H.: Inter-procedural two-variable herbrand equalities. arXiv e-prints (2014),
  20. 20.
    Sharir, M., Pnueli, A.: Two approaches to interprocedural data flow analysis. In: Muchnick, S.S., Jones, N.D. (eds.) Program Flow Analysis: Theory and Application, pp. 189–233. Prentice-Hall (1981)Google Scholar
  21. 21.
    Steffen, B., Knoop, J., Rüthing, O.: The value flow graph: A program representation for optimal program transformations. In: Jones, N.D. (ed.) ESOP 1990. LNCS, vol. 432, pp. 389–405. Springer, Heidelberg (1990)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Stefan Schulze Frielinghaus
    • 1
    Email author
  • Michael Petter
    • 1
  • Helmut Seidl
    • 1
  1. 1.Technische Universität MünchenGarchingGermany

Personalised recommendations