Skip to main content

Termination of logic programs with block declarations running in several modes

  • Conference paper
  • First Online:
Principles of Declarative Programming (ALP 1998, PLILP 1998)

Abstract

We show how termination of logic programs with delay declarations can be proven. Three features are distinctive of this work: (a) we assume that predicates can be used in several modes; (b) we show that block declarations, which are a very simple delay construct, are sufficient; (c) we take the selection rule into account, assuming it to be as in most Prolog implementations. Our method is based on identifying the so-called robust predicates, for which the textual position of an atom using this predicate is irrelevant. The method can be used to verify existing programs, and to assist in writing new programs. As a byproduct, we also show how programs can be proven to be free from occur-check and floundering.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K. R. Apt. From Logic Programming to Prolog, chapter 6. Prentice Hall, 1997.

    Google Scholar 

  2. K. R. Apt and I. Luitjes. Verification of logic programs with delay declarations. In AMAST'95, LNCS, Berlin, 1995. Springer Verlag. Invited Lecture.

    Google Scholar 

  3. K. R. Apt and A. Pellegrini. On the occur-check free Prolog programs. ACM Toplas, 16(3):687–726, 1994.

    Article  Google Scholar 

  4. R. Chadha and D.A. Plaisted. Correctness of unification without occur check in Prolog. Technical report, University of North Carolina, 1991.

    Google Scholar 

  5. Stefaan Decorte and Danny De Schreye. Automatic inference of norms: a missing link in automatic termination analysis. In D. Miller, editor, Proceedings of ILPS, pages 420–436. MIT Press, 1993.

    Google Scholar 

  6. P. M. Hill, editor. ALP Newsletter, http://www-lp.doc.ic.ac.uk/alp/, February 1998. Pages 17,18.

    Google Scholar 

  7. P. M. Hill and J. W. Lloyd. The Gödel Programming Language. MIT Press, 1994.

    Google Scholar 

  8. Intelligent Systems Laboratory, SICS, PO Box 1263, S-164 29 Kista, Sweden. SICStus Prolog User's Manual, 1997. http://www.sics.se/isl/sicstus/sicstus_toc.html.

    Google Scholar 

  9. J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.

    Google Scholar 

  10. S. Lüttringhaus-Kappel. Control generation for logic programs. In D. Warren, editor, Proceedings of ICLP, pages 478–495. MIT Press, 1993.

    Google Scholar 

  11. E. Marchiori and F. Teusink. Proving termination of logic programs with delay declarations. In J. Lloyd, editor, Proceedings of ILPS, pages 447–461. MIT Press, 1995.

    Google Scholar 

  12. K. Marriott, L. Naish, and J. L. Lassez. Most specific logic programs. Annals of mathematics and artificial intelligence, 1(2), 1990. Also in proceedings of the Fifth JICSLP.

    Google Scholar 

  13. A. Martelli and U. Montanari. An efficient unification algorithm. ACM Transactions on Programming Languages and Systems, 4:258–282, 1982.

    Article  MATH  Google Scholar 

  14. L. Naish. Automatic control of logic programs. Journal of Logic Programming, 2(3):167–183, 1985.

    Article  MATH  Google Scholar 

  15. L. Naish. Coroutining and the construction of terminating logic programs. Technical Report 92/5, University of Melbourne, 1992.

    Google Scholar 

  16. J.-G. Smaus, P. M. Hill, and A. King. Preventing instantiation errors and loops for logic programs with several modes using block declarations. In Pierre Flener, editor, Pre-proceedings of LOPSTR, number UMCS-98-6-1. University of Manchester, 1998. Extended abstract.

    Google Scholar 

  17. J.-G. Smaus, P. M. Hill, and A. King. Verification of logic programs with block declarations running in several modes. Technical Report 7-98, University of Kent at Canterbury, Canterbury, CT2 7NF, United Kingdom, July 1998.

    Google Scholar 

  18. Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming, November 1996.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Catuscia Palamidessi Hugh Glaser Karl Meinke

Rights and permissions

Reprints and permissions

Copyright information

© 1998 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Smaus, JG., Hill, P., King, A. (1998). Termination of logic programs with block declarations running in several modes. In: Palamidessi, C., Glaser, H., Meinke, K. (eds) Principles of Declarative Programming. ALP PLILP 1998 1998. Lecture Notes in Computer Science, vol 1490. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0056608

Download citation

  • DOI: https://doi.org/10.1007/BFb0056608

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-65012-6

  • Online ISBN: 978-3-540-49766-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics