Abstract
There are many powerful techniques for automated termination analysis of term rewriting. However, up to now they have hardly been used for real programming languages. We present a new approach which permits the application of existing techniques from term rewriting to prove termination of most functions defined in Haskell programs. In particular, we show how termination techniques for ordinary rewriting can be used to handle those features of Haskell which are missing in term rewriting (e.g., lazy evaluation, polymorphic types, and higher-order functions). We implemented our results in the termination prover AProVE and successfully evaluated them on existing Haskell libraries.
Supplemental Material
Available for Download
Online appendix to automated termination proofs for haskell by term rewriting on article 7.
- Abel, A. 2004. Termination checking with types. RAIRO Theor. Inform. Appl. 38, 4, 277--319.Google Scholar
Cross Ref
- Alarcón, B., Gutiérrez, R., and Lucas, S. 2006. Context-Sensitive dependency pairs. In Proceedings of the Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS'06). Lecture Notes in Computer Science, vol. 4337, Springer, 298--309. Google Scholar
Digital Library
- Alarcón, B., Emmes, F., Fuhs, C., Giesl, J., Gutiérrez, R., Lucas, S., Schneider-Kamp, P., and Thiemann, R. 2008. Improving context-sensitive dependency pairs. In Proceedings of the International Conference on Logic Programming, Artificial Intelligence and Reasoning (LPAR'08). Lecture Notes in Artificial Intelligence, Springer, vol. 5330, 636--651. Google Scholar
Digital Library
- Albert, E., Arenas, P., Codish, M., Genaim, S., Puebla, G., and Zanardini, D. 2008. Termination analysis of Java bytecode. In Proceedings of the International Conference on Formal Methods for Open Object-Based Distributed Systems (FMOODS'08). Lecture Notes in Computer Science, vol. 5051, Springer, 2--18. Google Scholar
Digital Library
- Arts, T. and Giesl, J. 2000. Termination of term rewriting using dependency pairs. Theor. Comput. Sci. 236, 133--178. Google Scholar
Digital Library
- Barthe, G., Frade, M. J., Giménez, E., Pinto, L., and Uustalu, T. 2000. Type-Based termination of recursive definitions. Math. Struct. Comput. Sci. 14, 1, 1--45. Google Scholar
Digital Library
- Berdine, J., Cook, B., Distefano, D., and O'Hearn, P. 2006. Automatic termination proofs for programs with shape-shifting heaps. In Proceedings of the International Conference on Computer-Aided Verification (CAV'06). Lecture Notes in Computer Science, vol. 4144, Springer, 386--400. Google Scholar
Digital Library
- Blanqui, F. 2004. A type-based termination criterion for dependently-typed higher-order rewrite systems. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'04). Lecture Notes in Computer Science, vol. 3091, Springer, 24--39.Google Scholar
Cross Ref
- Bradley, A. R., Manna, Z., and Sipma, H. B. 2005. Termination of polynomial programs. In Proceedings of the Conference on Verification, Model-Checking and Abstract Interpretation (VMCAI'05). Lecture Notes in Computer Science, vol. 3385, Springer, 113--129. Google Scholar
Digital Library
- Brockschmidt, M., Otto, C., von Essen, C., and Giesl, J. 2010. Termination graphs for Java bytecode. In Verification, Induction, Termination Analysis. Lecture Notes in Computer Science, vol. 6463, Springer, 17--37. Google Scholar
Digital Library
- Chawdhary, A., Cook, B., Gulwani, S., Sagiv, M., and Yang, H. 2008. Ranking abstractions. In Proceedings of the European Symposium on Programming (ESOP'08). Lecture Notes in Computer Science, vol. 4960, Springer, 148--162. Google Scholar
Digital Library
- Colón, M. and Sipma, H. 2002. Practical methods for proving program termination. In Proceedings of the International Conference on Computer-Aided Verification (CAV'02). Lecture Notes in Computer Science, vol. 2034, Springer, 442--454. Google Scholar
Digital Library
- Cook, B., Podelski, A., and Rybalchenko, A. 2006. Termination proofs for systems code. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI'06). ACM Press, 415--426. Google Scholar
Digital Library
- Dershowitz, N. 1987. Termination of rewriting. J. Symb. Comput. 3, 1-2, 69--116. Google Scholar
Digital Library
- Endrullis, J., Waldmann, J., and Zantema, H. 2008. Matrix interpretations for proving termination of term rewriting. J. Autom. Reason. 40, 2-3, 195--220. Google Scholar
Digital Library
- Endrullis, J. and Hendriks, D. 2009. From outermost to context-sensitive rewriting. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'09). Lecture Notes in Computer Science, vol. 5595, Springer, 305--319. Google Scholar
Digital Library
- Falke, S. and Kapur, D. 2008. Dependency pairs for rewriting with built-in numbers and semantic data structures. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'08). Lecture Notes in Computer Science, vol. 5117, Springer, 94--109. Google Scholar
Digital Library
- Fuhs, C., Giesl, J., Plücker, M., Schneider-Kamp, P., and Falke, S. 2009. Proving termination of integer term rewriting. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'09). Lecture Notes in Computer Science, vol. 5595, Springer, 32--47. Google Scholar
Digital Library
- Geser, A., Hofbauer, D., and Waldmann, J. 2004. Match-Bounded string rewriting systems. Applic. Algebr. Engin., Comm. Comput. 15, 3, 149--171. Google Scholar
Digital Library
- Giesl, J. 1995. Termination analysis for functional programs using term orderings. In Proceedings of the International Static Analysis Symposium (SAS'95). Lecture Notes in Computer Science, vol. 983, Springer, 154--171. Google Scholar
Digital Library
- Giesl, J. and Middeldorp, A. 2004. Transformation techniques for context-sensitive rewrite systems. J. Funct. Program. 14, 4, 379--427. Google Scholar
Digital Library
- Giesl, J., Thiemann, R., and Schneider-Kamp, P. 2005a. The dependency pair framework: Combining techniques for automated termination proofs. In Proceedings of the International Conference on Logic Programming, Artificial Intelligence and Reasoning (LPAR'04). Lecture Notes in Artificial Intelligence, vol. 3452, 301--331.Google Scholar
- Giesl, J., Thiemann, R., and Schneider-Kamp, P. 2005b. Proving and disproving termination of higher-order functions. In Proceedings of the International Workshop on Frontiers of Combining Systems (FroCoS'05). Lecture Notes in Artificial Intelligence, vol. 3717, 216--231. Google Scholar
Digital Library
- Giesl, J., Swiderski, S., Schneider-Kamp, P., and Thiemann, R. 2006a. Automated termination analysis for Haskell: From term rewriting to programming languages. In Proceedings of the International Conference on Rewriting Techniques and Applidations (RTA'06). Lecture Notes in Computer Science, Springer, vol. 4098, Springer, 297--312. Google Scholar
Digital Library
- Giesl, J., Schneider-Kamp, P., and Thiemann, R. 2006b. AProVE 1.2: Automatic termination proofs in the dependency pair framework. In Proceedings of the International Conference on Automated Reasoning (IJCAR'06). Lecture Notes in Artificial Intelligence, Springer, vol. 4130, 281--286. Google Scholar
Digital Library
- Giesl, J., Thiemann, R., Schneider-Kamp, P., and Falke, S. 2006c. Mechanizing and improving dependency pairs. J. Autom. Reason. 37, 3, 155--203. Google Scholar
Digital Library
- Glenstrup, A. J. and Jones, N. D. 2005. Termination analysis and specialization-point insertion in offline partial evaluation. ACM Trans. Program. Lang. Syst. 27, 6, 1147--1215. Google Scholar
Digital Library
- Gnaedig, I. and Kirchner, H. 2008. Termination of rewriting under strategies. ACM Trans. Comput. Logic 10, 3. Google Scholar
Digital Library
- Hanus, M. 2007. Multi-paradigm declarative languages. In Proceedings of the International Conference on Logic Programming (ICLP'07). Lecture Notes in Computer Science, vol. 4670, Springer, 45--75. Google Scholar
Digital Library
- Hirokawa, N. and Middeldorp, A. 2005. Automating the dependency pair method. Inform. Comput. 199, 1-2, 172--199. Google Scholar
Digital Library
- Hirokawa, N. and Middeldorp, A. 2007. Tyrolean termination tool: Techniques and features. Inform. Comput. 205, 4, 474--511. Google Scholar
Digital Library
- Hirokawa, N., Middeldorp, A., and Zankl, H. 2008. Uncurrying for termination. In Proceedings of the International Conference on Logic Programming, Artificial Intelligence and Reasoning (LPAR'08). Lecture Notes in Artificial Intelligence, vol. 5330, 667--681. Google Scholar
Digital Library
- Jones, M. and Peterson, J. 1999. The Hugs 98 user manual. http://www.haskell.org/hugs/Google Scholar
- Kennaway, R., Klop, J. W., Sleep, M. R., and de Vries, F. J. 1996. Comparing curried and uncurried rewriting. J. Symb. Comput. 21, 1, 15--39. Google Scholar
Digital Library
- Kobayashi, N. 2009. Types and higher-order recursion schemes for verification of higher-order programs. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL'09). ACM Press, 416--428. Google Scholar
Digital Library
- Korp, M., Sternagel, C., Zankl, H., and Middeldorp, A. 2009. Tyrolean termination tool 2. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'09). Lecture Notes in Computer Science, vol. 5595, Springer, 295--304. Google Scholar
Digital Library
- Lee, C. S., Jones, N. D., and Ben-Amram, A. M. 2001. The size-change principle for program termination. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL'01). ACM Press, 81--92. Google Scholar
Digital Library
- Lucas, S. 1998. Context-Sensitive computations in functional and functional logic programs. J. Funct. Logic Program.1, 1--61.Google Scholar
- Manolios, P. and Vroon, D. 2006. Termination analysis with calling context graphs. In Proceedings of the International Conference on Computer-Aided Verification (CAV'06). Lecture Notes in Computer Science, vol. 4144, Springer, 401--414. Google Scholar
Digital Library
- Ong, C.-H. L. 2006. On model-checking trees generated by higher-order recursion schemes. In Proceedings of the Annual IEEE Symposium on Logic in Computer Science (LICS'06). IEEE, 81--90. Google Scholar
Digital Library
- Otto, C., Brockschmidt, M., von Essen, C., and Giesl, J. 2010. Automated termination analysis of Java bytecode by term rewriting. In Proceedings of the International Conference on Rewriting Techniques and Applications (RTA'10). LIPIcs, vol. 6, 259--276.Google Scholar
- Panitz, S. E. and Schmidt-Schauß, M. 1997. TEA: Automatically proving termination of programs in a non-strict higher-order functional language. In Proceedings of the International Static Analysis Symposium (SAS'97). Lecture Notes in Computer Science, vol. 1302, Springer, 345--360. Google Scholar
Digital Library
- Panitz, S. E. 1997. Generierung statischer Programminformation zur Kompilierung verzögert ausgewerteter funktionaler Programmiersprachen. Ph.D. thesis, University of Frankfurt.Google Scholar
- Peyton Jones, S. 2003. Haskell 98 Languages and Libraries: The Revised Report. Cambridge University Press.Google Scholar
- Podelski, A. and Rybalchenko, A. 2004a. A complete method for the synthesis of linear ranking functions. In Proceedings of the Conference on Verification, Model-Checking and Abstract Interpretation (VMCAI'04). Lecture Notes in Computer Science, vol. 2937, Springer, 239--251.Google Scholar
Cross Ref
- Podelski, A. and Rybalchenko, A. 2004b. Transition invariants. In Proceedings of the Annual IEEE Symposium on Logic in Computer Science (LICS'04). IEEE, 32--41. Google Scholar
Digital Library
- Raffelsieper, M. 2007. Improving efficiency and power of automated termination analysis for Haskell. Diploma thesis, RWTH Aachen. http://aprove.informatik.rwth-aachen.de/eval/Haskell/DA/Raffelsieper_DA.pdfGoogle Scholar
- Raffelsieper, M. and Zantema, H. 2009. A transformational approach to prove outermost termination automatically. In Proceedings of the International Workshop on Reduction Strategies in Rewriting and Programming (WRS'08). ENTCS, vol. 237, 3--21. Google Scholar
Digital Library
- Rondon, P. M., Kawaguchi, M., and Jhala, R. 2008. Liquid types. In Proceedings of the Conference on Programming Language Design and Implementation (PLDI'08). ACM Press, 159--169. Google Scholar
Digital Library
- Schneider-Kamp, P., Giesl, J., Serebrenik, A., and Thiemann, R. 2009. Automated termination proofs for logic programs by term rewriting. ACM Trans. Comput.Logic 11, 1. Google Scholar
Digital Library
- Schneider-Kamp, P., Giesl, J., Ströder, T., Serebrenik, A., and Thiemann, R. 2010. Automated termination analysis for logic programs with cut. Theory Pract. Logic Program. 10, 4-6, 365--381. Google Scholar
Digital Library
- Sereni, D. and Jones, N. D. 2005. Termination analysis of higher-order functional programs. In Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS'05). Lecture Notes in Computer Science, vol. 3780, Springer, 281--297. Google Scholar
Digital Library
- Sereni, D. 2007. Termination analysis and call graph construction for higher-order functional programs. In Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP'07). ACM Press, 71--84. Google Scholar
Digital Library
- Sørensen, M. H. and Glück, R. 1995. An algorithm of generalization in positive supercompilation. In Proceedings of the International Logic Programming Symposium (ILPS'95). MIT Press, 465--479.Google Scholar
- Spoto, F., Mesnard, F., and Payet, É. 2010. A termination analyser for Java Bytecode based on path length. ACM Trans. Program. Lang. Syst. 32, 3. Google Scholar
Digital Library
- Swiderski, S. 2005. Terminierungsanalyse von Haskellprogrammen. Diploma thesis, RWTH Aachen. http://aprove.informatik.rwth-aachen.de/eval/Haskell/DA/Swiderski_DA.pdfGoogle Scholar
- Telford, A. and Turner, D. 2000. Ensuring termination in ESFP. J. Universal Comput. Sci. 6, 4, 474--488.Google Scholar
- Thiemann, R. and Giesl, J. 2005. The size-change principle and dependency pairs for termination of term rewriting. Applic. Algebr. Engin., Comm. Comput. 16, 4, 229--270. Google Scholar
Cross Ref
- Thiemann, R. 2009. From outermost termination to innermost termination. In Proceedings of the Conference on Current Trends in Theory and Practice of Informatics (SOFSEM'09). Lecture Notes in Computer Science, vol. 5404, Springer, 533--545. Google Scholar
Digital Library
- Tiwari, A. 2004. Termination of linear programs. In Proceedings of the International Conference on Computer-Aided Verification (CAV'04). Lecture Notes in Artificial Intelligence, Springer, vol. 3097, 70--82.Google Scholar
Cross Ref
- Walther, C. 1994. On proving the termination of algorithms by machine. Artif. Intell. 71, 1, 101--157. Google Scholar
Digital Library
- Xi, H. 2002. Dependent types for program termination verification. Artif. Intell. 15, 1, 91--131. Google Scholar
Digital Library
- Xu, D. N., Peyton Jones, S., and Claessen, K. 2009. Static contract checking for Haskell. In Proceedings of the ACM Symposium on Principles of Programming Languages (POPL '09). ACM Press, 41--52. Google Scholar
Digital Library
- Zantema, H. 2003. Termination. In Term Rewriting Systems, Terese, Ed. Cambridge University Press, Chapter 6, 181--259.Google Scholar
Index Terms
Automated termination proofs for haskell by term rewriting
Recommendations
Automated termination proofs for logic programs by term rewriting
There are two kinds of approaches for termination analysis of logic programs: “transformational” and “direct” ones. Direct approaches prove termination directly on the basis of the logic program. Transformational approaches transform a logic program ...
Using Context-Sensitive Rewriting for Proving Innermost Termination of Rewriting
Computational systems based on reducing expressions usually have a predefined reduction strategy to break down the nondeterminism which is inherent to reduction relations. The innermost strategy corresponds to call by value or eager computation, that is,...
Relative Termination via Dependency Pairs
A term rewrite system is terminating when no infinite reduction sequences are possible. Relative termination generalizes termination by permitting infinite reductions as long as some distinguished rules are not applied infinitely many times. Relative ...








Comments