Loop Detection by Logically Constrained Term Rewriting

  • Naoki Nishida
  • Sarah WinklerEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11294)


Logically constrained rewrite systems constitute a very general rewriting formalism that can capture simplification processes in various domains as well as computation in imperative programs. In both of these contexts, nontermination is a critical source of errors. We present new criteria to find loops in logically constrained rewrite systems which are implemented in the tool Ctrl. We illustrate the usefulness of these criteria in three example applications: to find loops in LLVM peephole optimizations, to detect looping executions of C programs, and to establish nontermination of integer transition systems.


Constrained rewriting Nontermination Loops 



The authors thank the anonymous referees for their helpful comments.


  1. 1.
    Baader, F., Nipkow, T.: Term Rewriting and All That. Cambridge University Press, Cambridge (1998)CrossRefGoogle Scholar
  2. 2.
    Borralleras, C., Brockschmidt, M., Larraz, D., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Proving termination through conditional termination. In: Legay, A., Margaria, T. (eds.) TACAS 2017. Heidelberg, vol. 10205, pp. 99–117. Springer, Cham (2017). Scholar
  3. 3.
    Brockschmidt, M., Cook, B., Ishtiaq, S., Khlaaf, H., Piterman, N.: T2: Temporal property verification. In: Chechik, M., Raskin, J.-F. (eds.) TACAS 2016. LNCS, vol. 9636, pp. 387–393. Springer, Heidelberg (2016). Scholar
  4. 4.
    Falke, S., Kapur, D.: A term rewriting approach to the automated termination analysis of imperative programs. In: Schmidt, R.A. (ed.) CADE 2009. LNCS (LNAI), vol. 5663, pp. 277–293. Springer, Heidelberg (2009). Scholar
  5. 5.
    Falke, S., Kapur, D., Sinz, C.: Termination analysis of C programs using compiler intermediate languages. In: Proceedings of the 22nd RTA, Leibniz International Proceedings in Informatics, vol. 10, pp. 41–50 (2011).
  6. 6.
    Fuhs, C., Giesl, J., Plücker, M., Schneider-Kamp, P., Falke, S.: Proving termination of integer term rewriting. In: Treinen, R. (ed.) RTA 2009. LNCS, vol. 5595, pp. 32–47. Springer, Heidelberg (2009). Scholar
  7. 7.
    Fuhs, C., Kop, C., Nishida, N.: Verifying procedural programs via constrained rewriting induction. ACM TOCL 18(2), 14:1–14:50 (2017). Scholar
  8. 8.
    Ganesh, V., Berezin, S., Dill, D.: A decision procedure for fixed-width bit-vectors. Technical report, Stanford University (2005)Google Scholar
  9. 9.
    Giesl, J., et al.: Analyzing program termination and complexity automatically with AProVE. JAR 58(1), 3–31 (2017). Scholar
  10. 10.
    Gupta, A., Henzinger, T., Majumdar, R., Rybalchenko, A., Xu, R.G.: Proving non-termination. SIGPLAN Not. 43(1), 147–158 (2008). Scholar
  11. 11.
    Hoder, K., Khasidashvili, Z., Korovin, K., Voronkov, A.: Preprocessing techniques for first-order clausification. In: Proceedings of the 12th FMCAD, pp. 44–51 (2012)Google Scholar
  12. 12.
    Kop, C., Nishida, N.: Term rewriting with logical constraints. In: Fontaine, P., Ringeissen, C., Schmidt, R.A. (eds.) FroCoS 2013. LNCS (LNAI), vol. 8152, pp. 343–358. Springer, Heidelberg (2013). Scholar
  13. 13.
    Kop, C., Nishida, N.: Constrained term rewriting tooL. In: Davis, M., Fehnker, A., McIver, A., Voronkov, A. (eds.) LPAR 2015. LNCS, vol. 9450, pp. 549–557. Springer, Heidelberg (2015). Scholar
  14. 14.
    Lopes, N., Menendez, D., Nagarakatte, S., Regehr, J.: Provably correct peephole optimizations with Alive. In: Proceedings of the 36th PLDI, pp. 22–32 (2015).
  15. 15.
    Lopes, N., Menendez, D., Nagarakatte, S., Regehr, J.: Practical verification of peephole optimizations with Alive. Commun. ACM 61(2), 84–91 (2018). Scholar
  16. 16.
    Menendez, D., Nagarakatte, S.: Termination-checking for LLVM peephole optimizations. In: Proceedings of the 38th International Conference on Software Engineering, pp. 191–202 (2016).
  17. 17.
    Nadel, A.: Bit-vector rewriting with automatic rule generation. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 663–679. Springer, Cham (2014). Scholar
  18. 18.
    Nishida, N., Sakai, M., Hattori, T.: On disproving termination of constrained term rewriting systems. In: Proceedings of the 11th WST (2010)Google Scholar
  19. 19.
    Payet, É.: Loop detection in term rewriting using the eliminating unfoldings. Theor. Comput. Sci. 403(2–3), 307–327 (2008). Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.Department of Computing and Software Systems, Graduate School of InformaticsNagoya UniversityNagoyaJapan
  2. 2.Department of Computer ScienceUniversity of InnsbruckInnsbruckAustria

Personalised recommendations