Abstract
This paper describes a method for proving termination of queries to logic programs based on abstract interpretation. The method uses query-mapping pairs to abstract the relation between calls in the LD-tree associated with the program and query. Any well founded partial order for terms can be used to prove the termination. The ideas of the query-mapping pairs approach have been implemented in SICStus Prolog in a system called TermiLog, which is available on the web. Given a program and query pattern the system either answers that the query terminates or that there may be non-termination. The advantages of the method are its conceptual simplicity and the fact that it does not impose any restrictions on the programs.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Apt, K.R.: From Logic Programming to Prolog. Prentice-Hall, Englewood Cliffs (1997)
Apt, K.R., Bezem, M.: Acyclic Programs. New Generation Computing 9, 335–363 (1991)
Apt, K.R., Luitjes, I.: Verification of logic programs with delay declarations. In: Alagar, V.S., Nivat, M. (eds.) AMAST 1995. LNCS, vol. 936, pp. 66–90. Springer, Heidelberg (1995)
Apt, K.R., Pedreschi, D.: Reasoning about Termination of Pure Prolog Programs. Information and Computation 106, 109–157 (1993)
Apt, K.R., Pedreschi, D.: Modular Termination Proofs for Logic and Pure Prolog Programs. In: Advances in Logic Programming Theory, pp. 183–229. Oxford University Press, Oxford (1994)
Arts, T.: Automatically proving termination and innermost normalisation of term rewriting systems. PhD thesis, Universiteit Utrecht (1997)
Bagnara, R., Ricci, E., Zaffanella, E., Hill, P.M.: Possibly not closed convex polyhedra and the Parma Polyhedra Library. In: Hermenegildo, M.V., Puebla, G. (eds.) SAS 2002. LNCS, vol. 2477, pp. 213–229. Springer, Heidelberg (2002)
Baudinet, M.: Proving termination properties of Prolog programs: a semantic approach. Journal of Logic Programming 14, 1–29 (1992)
Benoy, F., King, A.: Inferring argument size relationships with CLPR(R). In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 204–223. Springer, Heidelberg (1997)
Benyamini, Y., Lindenstrauss, J.: Geometric Nonlinear Functional Analysis, vol. 1&48. AMS Colloquium Publications, Providence (2000)
Bezem, M.: Characterizing termination of logic programs with level mappings. In: Lusk, E.L., Overbeek, R.A. (eds.) Logic Programming, Proceedings of the North American Conference 1989, pp. 69–80. MIT Press, Cambridge (1989)
Bezem, M.: Strong termination of logic programs. J. Logic Programming 15, 79–97 (1993)
Börger, E.: Unsolvable decision problems for Prolog programs. In: Börger, E. (ed.) Computation Theory and Logic. LNCS, vol. 270, pp. 37–48. Springer, Heidelberg (1987)
Bossi, A., Cocco, N., Etalle, S., Rossi, S.: On modular termination proofs of general logic programs. Theory and Practice of Logic Programming 2(3), 263–291 (2002)
Bossi, A., Gabrielli, M., Levi, G., Martelli, M.: The s-semantics approach: theory and Applications. J. Logic Programming 19/20, 149–198 (1994)
Brodsky, A., Sagiv, Y.: Inference of monotonicity constraints in Datalog programs. In: Proceedings of the Eighth ACM SIGACT-SIGART-SIGMOD Symposium on Principles of Database Systems, pp. 190–199 (1989)
Brodsky, A., Sagiv, Y.: Inference of inequality constraints in logic programs. In: Proceedings of the Tenth ACM SIGACT-SIGART-SIGMOD Symposium on Principles of Database Systems, pp. 227–240 (1991)
Bueno, F., García de la Banda, M., Hermenegildo, M.: Effectiveness of Global Analysis in Strict Independence-Based Automatic Program Parallelization. In: International Symposium on Logic Programming, pp. 320–336. MIT Press, Cambridge (1994)
Codish, M., Bruynooghe, M., Garc´ıa de la Banda, M.J., Hermenegildo, M.V.: Exploiting Goal Independence in the Analysis of Logic Programs. Journal of Logic Programming 32(3), 247–262 (1997)
Codish, M., Demoen, B.: Analyzing Logic Programs using “Prop”-ositional Logic Programs and a Magic Wand. In: Proceedings International Logic Programming Symposium, Vancouver (1993)
Codish, M., Demoen, B.: Collection of benchmarks
Codish, M., Genaim, S., Bruynooghe, M., Gallagher, J., Vanhoof, W.: One Loop at a Time. In: 6th International Workshop on Termination (2003)
Codish, M., Taboch, C.: A semantic basis for termination analysis of logic programs. Journal of Logic Programming 41(1), 103–123
Cousot, P., Cousot, R.: Abstract interpretation and application to logic programs. J. Logic Programming 13, 103–179 (1992)
Decorte, S., De Schreye, D.: Automatic Inference of Norms: a Missing Link in Automatic Termination Analysis. In: Miller, D. (ed.) Logic Programming: Proceedings of the 1993 International Symposium, MIT Press, Cambridge (1993)
Decorte, S., De Schreye, D.: Demand-driven and constraint-based automatic left-termination analysis for Logic Programs. In: Proceedings of the 1997 International Conference on Logic Programming, MIT Press, Cambridge (1997)
Decorte, D., De Schreye, D., Vandecasteele, H.: Constraint-based termination analysis of logic programs. ACM TOPLAS 21(6), 1137–1195 (1999)
Dershowitz, N.: Orderings for term-rewriting systems. Theoretical Computer Science 17, 279–301 (1982)
Dershowitz, N., Lindenstrauss, N., Sagiv, Y., Serebrenik, A.: A general framework for automatic termination analysis of logic programs. Applicable Algebra in Engineering, Communication and Computing 12, 1–2 (2001)
De Schreye, D., Decorte, S.: Termination of Logic Programs: the Never-Ending Story. J. Logic Programming 19/20, 199–260 (1994)
De Schreye, D., Serebrenik, A.: Acceptability with general orderings. Computational Logic. In: Kakas, A.C., Sadri, F. (eds.) Computational Logic: Logic Programming and Beyond. LNCS (LNAI), vol. 2407, pp. 187–210. Springer, Heidelberg (2002)
De Schreye, D., Verschaetse, K., Bruynooghe, M.: A framework for analyzing the termination of definite logic programs with respect to call patterns. In: Proc. of the Int. Conf. on Fifth Generation Computer Systems, pp. 481–488. IOS Press, Amsterdam (1992)
Devienne, P., Lebègue, P., Routier, J.C.: Halting problem of one binary Horn clause is undecidable. In: Enjalbert, P., Wagner, K.W., Finkel, A. (eds.) STACS 1993. LNCS, vol. 665, pp. 48–57. Springer, Heidelberg (1993)
Falaschi, M., Levi, G., Palamidessi, C.: Declarative modeling of the operational behavior of logic languages. Theoretical Computer Science 69, 289–318 (1989)
Fischer, J.: Termination analysis for Mercury using convex constraints. Master’s thesis, University of Melbourne, Department of Computer Science and Software Engineering (2002)
García de la Banda, M.J., Mariott, K., Stuckey, P., Søndergaard, H.: Differential methods in logic programming analysis. Journal of Logic Programming 35(1), 1–38 (1998)
Genaim, S., Codish, M.: Inferring termination conditions for logic programs using backwards analysis. In: Nieuwenhuis, R., Voronkov, A. (eds.) LPAR 2001. LNCS (LNAI), vol. 2250, pp. 685–694. Springer, Heidelberg (2001)
Gori, R.: An abstract interpretation approach to termination of logic programs. In: Parigot, M., Voronkov, A. (eds.) LPAR 2000. LNCS (LNAI), vol. 1955, pp. 362–380. 1955, Heidelberg (2000)
Graham, R.L.: Rudiments of Ramsey theory. Regional conference series in mathematics, vol. 45. American Mathematical Society, Providence (1980)
Krishna Rao, M., Kapur, D., Shyamansundar, R.: Transformational methology for proving termination of logic programs. Journal of Logic Programming 34, 1–41 (1998)
Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The Size-Change Principle for Program Termination. In: ACM Symposium on Principles of Programming Languages 2001, pp. 81–92 (2001)
Lindenstrauss, N.: Homepage, http://www.cs.huji.ac.il/~naomil
Lindenstrauss, N., Sagiv, Y.: Checking Termination of Queries to Logic Programs (1996), http://www.cs.huji.ac.il/~~naomil/
Lindenstrauss, N., Sagiv, Y.: Automatic Termination Analysis of Logic Programs. In: Naish, L. (ed.) Proceedings of the 14th International Conference on Logic Programming, pp. 63–77. MIT Press, Cambridge (1997)
N. Lindenstrauss and Y. Sagiv. Automatic Termination Analysis of Logic Programs — version with Appendix. http://www.cs.huji.ac.il/~naomil/
N. Lindenstrauss, Y. Sagiv and A. Serebrenik. TermiLog: A System for Checking Termination of Queries to Logic Programs. In Computer Aided Verification, 9th International Conference, ed. O. Grumbach, LNCS 1254, 63–77, Springer Verlag, 1997.
Lindenstrauss, N., Sagiv, Y., Serebrenik, A.: Unfolding the Mystery of Mergesort. In: Fuchs, N.E. (ed.) LOPSTR 1997. LNCS, vol. 1463, pp. 206–225. Springer, Heidelberg (1998)
Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Heidelberg (1987)
Marchiori, M.: Proving existential termination of normal logic programs. In: Nivat, M., Wirsing, M. (eds.) AMAST 1996. LNCS, vol. 1101, pp. 375–390. Springer, Heidelberg (1996)
Mesnard, F., Bagnara, R.: cTI: A constraint-based termination inference tool for ISO-Prolog. In: TPLP (2004) (to appear)
Mesnard, F., Neumerkel, U.: Applying static analysis techniques for inferring termination conditions of logic programs. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, pp. 93–110. Springer, Heidelberg (2001)
Mesnard, F., Ruggieri, S.: On proving left termination of constraint logic programs. ACM Transactions on Computational Logic 4(2), 207–259 (2003)
Muthukumar, K., Bueno, F., Garc´ıa de la Banda, M.J., Hermenegildo, M.V.: Automatic compile-time parallelization of logic programs for restricted, goal level, independent and parallelism. Journal of Logic Programming 38(2), 165–218 (1999)
Nilsson, N.J.: Principles of Artificial Intelligence. Tioga Publishing Company (1980)
Ohlebusch, E., Claves, C., Marché, C.: TALP: A tool for the termination analysis of logic programs. In: Bachmair, L. (ed.) RTA 2000. LNCS, vol. 1833, pp. 270–273. Springer, Heidelberg (2000)
O’Keefe, R.A.: The Craft of Prolog. MIT Press, Cambridge (1990)
Pedreschi, D., Ruggieri, S., Smaus, J.-G.: Classes of terminating logic programs. Theory and Practice of Logic Programming 2(3), 369–418 (2002)
Plümer, L.: Termination Proofs for Logic Programs. LNCS (LNAI), vol. 446. Springer, Heidelberg (1990)
Plümer, L.: Automatic Termination Proofs for Prolog Programs Operating on Nonground Terms. In: International Logic Programming Symposium, MIT Press, Cambridge (1991)
Ramakrishnan, R., Bancilhon, F., Silberschatz, A.: Safety of recursive Horn clauses with infinite relations. In: Proceedings of the ACM SIGACT-SIGMODSIGART Symposium on Principles of Database Systems (1987)
Ramkumar, B., Kalé, L.V.: Compiled execution of the reduce-OR process model on multiprocessors. In: Lusk, E.L., Overbeek, R.A. (eds.) Logic Programming, Proceedings of the North American Conference, pp. 313–331. MIT Press, Cambridge (1989)
Ramsey, F.P.: On a Problem of Formal Logic. Proc. of London Math. Soc. 30, 264–286 (1928)
Reddy, U.S.: Transformation of logic programs into functional programs. In: Proceedings of the 1984 International Conference on Logic Programming, pp. 187–196. IEEE-CS, Los Alamitos (1984)
Ruggieri, S.: Decidability of logic program semantics and application to testing. Journal of Logic Programming 46(1-2), 103–137 (2000)
Ruggieri, S.: ∃-universal termination of logic programs. Theoretical Computer Science 254(1-2), 273–296 (2001)
Sagiv, Y.: A termination test for logic programs. In: International Logic Programming Symposium, MIT Press, Cambridge (1991)
Santos Costa, V., Warren, D.H.D., Yang, R.: Andorra-I: A parallel Prolog system that transparently exploits both And- and Or-parallelism. In: Proceedings of the Third ACM SIGPLAN Symposium on Principles & Practice of Parallel Programming (PPOPP), pp. 83–93. ACM Press, New York (1991)
SICStus Prolog User’s Manual. Swedish Institute of Computer Science
Smaus, J.-G.: Modes and Types in Logic Programming. PhD thesis,University of Kent at Canterbury (1999)
Smaus, J.-G.: Proving termination of input-consuming logic programs. In: De Schreye, D. (ed.) Proceedings of the International Conference on Logic Programming, pp. 335–349. MIT Press, Cambridge (1999)
Sohn, K., Van Gelder, A.: Termination Detection in Logic Programs using Argument Sizes. In: Proceedings of the Tenth ACM SIGACT-SIGART-SIGMOD Symposium on Principles of Database Systems, pp. 216–226 (1991)
Speirs, C., Somogyi, Z., Søndergaard, H.: Termination Analysis for Mercury. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 157–171. Springer, Heidelberg (1997)
Sterling, L., Shapiro, E.: The Art of Prolog. MIT Press, Cambridge (1986)
Tick, E., Banerjee, C.: Performance evaluation of Monaco compiler and runtime kernel. In: Warren, D.S. (ed.) Proceedings of the Tenth International Conference on Logic Programming, pp. 757–773 (1993)
Ullman, J.D., Van Gelder, A.: Efficient tests for top-down termination of logical rules. JACM 35(2), 345–373 (1988)
Van Emden, M.H.: An Interpretation Algorithm for Prolog Programs. In: Campbell, J.A. (ed.) Implementations of Prolog (1984)
Van Gelder, A.: Deriving constraints among argument sizes in logic programs. Annals of Mathematics and Artificial Intelligence 3, 361–392 (1991)
Van Gelder, A.: Personal communication
Vasak, T., Potter, J.: Characterisation of terminating logic programs. In: Proceedings of the 1986 Symposium on Logic Programming, pp. 140–147 (1986)
Verschaetse, K.: Static termination analysis for definite Horn clause programs. PhD thesis, Department of Computer Science, K. U. Leuven, Belgium (1992)
Verschaetse, K., Decorte, S., De Schreye, D.: Automatic Termination Analysis. In: LOPSTR, pp. 168–183 (1992)
Verschaetse, K., De Schreye, D.: Deriving Termination Proofs for Logic Programs, using Abstract Procedures. In: Proc. of the 8th ICLP, pp. 301–315 (1991)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Lindenstrauss, N., Sagiv, Y., Serebrenik, A. (2004). Proving Termination for Logic Programs by the Query-Mapping Pairs Approach. In: Bruynooghe, M., Lau, KK. (eds) Program Development in Computational Logic. Lecture Notes in Computer Science, vol 3049. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-25951-0_14
Download citation
DOI: https://doi.org/10.1007/978-3-540-25951-0_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-22152-4
Online ISBN: 978-3-540-25951-0
eBook Packages: Springer Book Archive