Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Open access

Nontermination inference of logic programs

Published: 01 March 2006 Publication History

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.]]
[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.]]
[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/.]]
[4]
Bol, R. N. 1993. Loop checking in partial deduction. J. Logic Prog. 16, 25--46.]]
[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.]]
[6]
Clark, K. L. 1979. Predicate logic as a computational formalism. Tech. Rep. Doc 79/59, Logic Programming Group, Imperial College, London.]]
[7]
Codish, M. and Taboch, C. 1999. A semantic basis for the termination analysis of logic programs. J. Logic Prog. 41, 1, 103--123.]]
[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.]]
[9]
De Schreye, D. and Decorte, S. 1994. Termination of logic programs: the never-ending story. J. Logic Prog. 19--20, 199--260.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[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.]]
[18]
Gori, R. and Levi, G. 1997. Finite failure is and-compositional. J. Logic Comput. 7, 6, 753--776.]]
[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.]]
[20]
Lindenstrauss, N. 1997. TermiLog: a system for checking termination of queries to logic programs. http://www.cs.huji.ac.il/~naomil.]]
[21]
Lloyd, J. W. 1987. Foundations of Logic Programming. Springer-Verlag.]]
[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.]]
[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.]]
[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.]]
[25]
Mesnard, F. and Neumerkel, U. 2000. cTI: a tool for inferring termination conditions of ISO-Prolog. http://www.univ-reunion.fr/~gcc.]]
[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.]]
[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.]]
[28]
O'Keefe, R. 1990. The Craft of Prolog. MIT Press.]]
[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.]]
[30]
Plümer, L. 1990. Terminations proofs for logic programs. Number 446 in LNAI. Springer-Verlag, Berlin.]]
[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.]]
[32]
Sahlin, D. 1993. Mixtus: an automatic partial evaluator for full Prolog. New Generation Computing 12, 1, 7--51.]]
[33]
Schmidt-Schauss, M. 1988. Implication of clauses is undecidable. Theoretical Computer Science 59, 287--296.]]
[34]
Shen, Y.-D. 1997. An extended variant of atoms loop check for positive logic programs. New Generation Computing 15, 2, 187--204.]]
[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.]]
[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.]]

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 28, Issue 2
March 2006
182 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/1119479
Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 March 2006
Published in TOPLAS Volume 28, Issue 2

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Logic programming
  2. nontermination analysis
  3. optimal termination condition
  4. static analysis

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)54
  • Downloads (Last 6 weeks)14
Reflects downloads up to 23 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Non-termination in Term Rewriting and Logic ProgrammingJournal of Automated Reasoning10.1007/s10817-023-09693-z68:1Online publication date: 2-Feb-2024
  • (2020)Tools in Term Rewriting for EducationElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.313.4313(54-72)Online publication date: 28-Feb-2020
  • (2019)Loop detection in term rewriting using the eliminating unfoldingsTheoretical Computer Science10.1016/j.tcs.2008.05.013403:2-3(307-327)Online publication date: 5-Jan-2019
  • (2019)Experiments with Non-Termination Analysis for Java BytecodeElectronic Notes in Theoretical Computer Science (ENTCS)10.1016/j.entcs.2009.11.016253:5(83-96)Online publication date: 5-Jan-2019
  • (2018)Termination prediction for general logic programsTheory and Practice of Logic Programming10.5555/1735396.17353989:6(751-780)Online publication date: 21-Dec-2018
  • (2018)Termination prediction for general logic programsTheory and Practice of Logic Programming10.5555/1735390.17353929:6(751-780)Online publication date: 21-Dec-2018
  • (2018)Termination prediction for general logic programsTheory and Practice of Logic Programming10.1017/S14710684099900689:6(751-780)Online publication date: 21-Dec-2018
  • (2018)A non-termination criterion for binary constraint logic programsTheory and Practice of Logic Programming10.1017/S14710684090036529:2(145-164)Online publication date: 21-Dec-2018
  • (2015)A devil's advocate against termination of direct recursionProceedings of the 17th International Symposium on Principles and Practice of Declarative Programming10.1145/2790449.2790518(103-113)Online publication date: 14-Jul-2015
  • (2014)Proving Nontermination via SafetyTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-642-54862-8_11(156-171)Online publication date: 2014
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media