skip to main content
article
Free Access

Nontermination inference of logic programs

Published:01 March 2006Publication History
Skip Abstract Section

Abstract

We present a static analysis technique for nontermination inference of logic programs. Our framework relies on an extension of the subsumption test, where some specific argument positions can be instantiated while others are generalized. We give syntactic criteria to statically identify such argument positions from the text of a program. Atomic left looping queries are generated bottom-up from selected subsets of the binary unfoldings of the program of interest. We propose a set of correct algorithms for automating the approach. Then, nontermination inference is tailored to attempt proofs of optimality of left termination conditions computed by a termination inference tool. An experimental evaluation is reported and the analyzers can be tried online at http://www.univ-reunion.fr/~gcc. When termination and nontermination analysis produce complementary results for a logic procedure, then with respect to the leftmost selection rule and the language used to describe sets of atomic queries, each analysis is optimal and together, they induce a characterization of the operational behavior of the logic procedure.

References

  1. Apt, K. R. 1997. From Logic Programming to Prolog. Prentice Hall.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Apt, K. R. and Pedreschi, D. 1994. Modular termination proofs for logic and pure Prolog programs. In Advances in Logic Programming Theory, G. Levi, Ed. Oxford University Press, 183--229.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Arts, T. and Zantema, H. 1996. Termination of logic programs using semantic unification. In Logic Program Synthesis and Transformation. Lecture Notes in Computer Science, vol. 1048. Springer-Verlag, Berlin. TALP can be used online at http://bibiserv.techfak.uni.biekefeld.de/talp/.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bol, R. N. 1993. Loop checking in partial deduction. J. Logic Prog. 16, 25--46.]]Google ScholarGoogle ScholarCross RefCross Ref
  5. Bol, R. N., Apt, K. R., and Klop, J. W. 1991. An analysis of loop checking mechanisms for logic programs. Theor. Comput. Sci. 86, 35--79.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Clark, K. L. 1979. Predicate logic as a computational formalism. Tech. Rep. Doc 79/59, Logic Programming Group, Imperial College, London.]]Google ScholarGoogle Scholar
  7. Codish, M. and Taboch, C. 1999. A semantic basis for the termination analysis of logic programs. J. Logic Prog. 41, 1, 103--123.]]Google ScholarGoogle ScholarCross RefCross Ref
  8. De Schreye, D., Bruynooghe, M., and Verschaetse, K. 1989. On the existence of nonterminating queries for a restricted class of Prolog-clauses. Artificial Intelligence 41, 237--248.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. De Schreye, D. and Decorte, S. 1994. Termination of logic programs: the never-ending story. J. Logic Prog. 19--20, 199--260.]]Google ScholarGoogle Scholar
  10. De Schreye, D., Verschaetse, K., and Bruynooghe, M. 1990. A practical technique for detecting non-terminating queries for a restricted class of Horn clauses, using directed, weighted graphs. In Proceedings of ICLP'90. The MIT Press, 649--663.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Deransart, P. and Ferrand, G. 1987. Programmation en logique avec négation: Présentation formelle. Tech. Rep. 87/3, Laboratoire d'Informatique, Département de Mathématiques et d'Informatique, Université d'Orleans.]]Google ScholarGoogle Scholar
  12. Dershowitz, N., Lindenstrauss, N., Sagiv, Y., and Serebrenik, A. 2001. A general framework for automatic termination analysis of logic programs. Applicable Algebra in Engineering,Communication and Computing 12, 1/2, 117--156.]]Google ScholarGoogle Scholar
  13. Devienne, P. 1988. Weighted graphs, a tool for expressing the behavious of recursive rules in logic programming. I. for New Generation Computer Technology (ICOT), Ed. OHMSHA Ltd. Tokyo and Springer-Verlag, 397--404. Proceedings of the International Conference on Fifth Generation Computer Systems 88, Tokyo, Japan.]]Google ScholarGoogle Scholar
  14. Devienne, P. 1990. Weighted graphs: A tool for studying the halting problem and time complexity in term rewriting systems and logic programming. Theor. Comput. Sci. 75, 2, 157--215.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Devienne, P., Lebègue, P., and Routier, J.-C. 1993. Halting problem of one binary Horn clause is undecidable. In LNCS. Vol. 665. Springer-Verlag, 48--57. Proceedings of STACS'93.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Gabbrielli, M. and Giacobazzi, R. 1994. Goal independency and call patterns in the analysis of logic programs. In Proceedings of the ACM Symposium on Applied Computing. ACM Press, 394--399.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Genaim, S. and Codish, M. 2001. Inferring termination condition for logic programs using backwards analysis. In Proceedings of Logic for Programming, Artificial intelligence and Reasoning. Lecture Notes in Computer Science. Springer-Verlag, Berlin. TerminWeb can be used online from http://www.cs.bgu.ac.il/~codish.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Gori, R. and Levi, G. 1997. Finite failure is and-compositional. J. Logic Comput. 7, 6, 753--776.]]Google ScholarGoogle ScholarCross RefCross Ref
  19. Jaffar, J. and Lassez, J. L. 1987. Constraint logic programming. In Proceedings of the ACM Symposium on Principles of Programming Languages. ACM Press, 111--119.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Lindenstrauss, N. 1997. TermiLog: a system for checking termination of queries to logic programs. http://www.cs.huji.ac.il/~naomil.]]Google ScholarGoogle Scholar
  21. Lloyd, J. W. 1987. Foundations of Logic Programming. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Falaschi, M., Levi, G., Martelli, M., and Palamidessi, C. 1993. A model-theoretic reconstruction of the operational semantics of logic programs. Information and Computation 102, 1, 86--113.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Mesnard, F. 1996. Inferring left-terminating classes of queries for constraint logic programs by means of approximations. In Proceedings of the 1996 Joint International Conference and Symposium on Logic Programming, M. J. Maher, Ed. MIT Press, 7--21.]]Google ScholarGoogle Scholar
  24. Mesnard, F. and Bagnara, R. 2004. cTI: a constraint-based termination inference tool for ISO-Prolog. Theory and Practice of Logic Programming. To appear.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Mesnard, F. and Neumerkel, U. 2000. cTI: a tool for inferring termination conditions of ISO-Prolog. http://www.univ-reunion.fr/~gcc.]]Google ScholarGoogle Scholar
  26. Mesnard, F. and Neumerkel, U. 2001. Applying static analysis techniques for inferring termination conditions of logic programs. In Static Analysis Symposium, P. Cousot, Ed. Lecture Notes in Computer Science, vol. 2126. Springer-Verlag, Berlin, 93--110.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Mesnard, F., Payet, E., and Neumerkel, U. 2002. Detecting optimal termination conditions of logic programs. In Proceedings of the 9th International Symposium on Static Analysis, M. Hermenegildo and G. Puebla, Eds. Lecture Notes in Computer Science, vol. 2477. Springer-Verlag, Berlin, 509--525.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. O'Keefe, R. 1990. The Craft of Prolog. MIT Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Payet, E. and Mesnard, F. 2004. nontermination inference of logic programs. In Proceedings of the 11th International Symposium on Static Analysis, R. Giacobazzi, Ed. Lecture Notes in Computer Science, vol. 3148. Springer-Verlag, Berlin.]]Google ScholarGoogle Scholar
  30. Plümer, L. 1990. Terminations proofs for logic programs. Number 446 in LNAI. Springer-Verlag, Berlin.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Sahlin, D. 1990. The mixtus approach to automatic partial evaluation of full Prolog. In Proceedings of the 1990 North American Conference on Logic Programming, S. Debray and M. Hermenegildo, Eds. MIT Press, Cambridge, MA, 377--398.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Sahlin, D. 1993. Mixtus: an automatic partial evaluator for full Prolog. New Generation Computing 12, 1, 7--51.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Schmidt-Schauss, M. 1988. Implication of clauses is undecidable. Theoretical Computer Science 59, 287--296.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Shen, Y.-D. 1997. An extended variant of atoms loop check for positive logic programs. New Generation Computing 15, 2, 187--204.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Shen, Y.-D., You, J.-H., Yuan, L.-Y., Shen, S., and Yang, Q. 2003. A dynamic approach to characterizing termination of general logic programs. ACM Trans. Comput. Logic 4, 4, 417--434.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Shen, Y.-D., Yuan, L.-Y., and You, J.-H. 2001. Loops checks for logic programs with functions. Theoretical Computer Science 266, 1--2, 441--461.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Nontermination inference of logic programs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!