Skip to main content

A semantic basis for termination analysis of logic programs and its realization using symbolic norm constraints

  • Functional and Logic Programming
  • Conference paper
  • First Online:
Algebraic and Logic Programming (ALP 1997, HOA 1997)

Abstract

This paper presents a declarative semantics which exhibits the termination properties of a logic program. The semantics associates a program with its binary unfoldings — a possibly infinite set of binary clauses. Termination of a program P and goal G is indicated by the absence of an infinite chain in the binary unfoldings of P starting with G. The main contribution is a formal semantic basis for the termination analysis of logic programs which facilitates both design and implementation. As an implementation vehicle we propose a simple meta-interpreter for binary unfoldings and the use of an abstract domain based on symbolic norm constraints. Many of the recently proposed termination analyses for logic programs can be expressed concisely within our approach. To demonstrate our approach we have reformulated the analysis originally described in [13]. The implementation uses a standard library for linear equations over the recels. The combination of binary unfoldings and a constraint solver is shown to significantly simplify the design of the analysis.

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. F. Benoy and A. King. Inferring argument size relationships with CLP(R). In Sixth International Workshop on Logic Program Synthesis and Transformation (LOPSTR'96), 1996.

    Google Scholar 

  2. A. Bossi, N. Cocco, and M. Fabris. Proving Termination of Logic Programs by Exploiting Term Properties. In S. Abramsky and T. Maibaum, editors, Proc. TAPSOFT'91, volume 494 of Lecture Notes in Computer Science, pages 153–180. Springer-Verlag, Berlin, 1991.

    Google Scholar 

  3. M. Codish and B. Demoen. Analysing logic programs using “prop”-ositional logic programs and a magic wand. The Journal of Logic Programming, 25(3):249–274, December 1995.

    Google Scholar 

  4. M. Codish, M. Falaschi, and K. Marriott. Suspension analyses for concurrent logic programs. ACM Transactions on Programming Languages and Systems, 16(3):649–686, May 1994.

    Google Scholar 

  5. A. Cortesi, G. Filé, and W. Winsborough. Prop revisited: Propositional formula as abstract domain for groundness analysis. In Proceedings, Sixth AnnualIEEE Symposium on Logic in Computer Science, pages 322–327, Amsterdam, The Netherlands, July 15–18 1991. IEEE Computer Society Press.

    Google Scholar 

  6. P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proceedings of the Fourth ACM Symposium on Principles of Programming Languages, pages 238–252, Jan. 1977.

    Google Scholar 

  7. P. Cousot and R. Cousot. Comparing the Galois Connection and Widening/Narrowing Approaches to Abstract Interpretation. In M. Bruynooghe and M. Wirsing, editors, Proc. of PLILP'92, volume 631 of Lecture Notes in Computer Science, pages 269–295. Springer-Verlag, Berlin, 1992.

    Google Scholar 

  8. P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Proceedings of the Fifth Annual ACM Symposium on Principles of Programming Languages, pages 84–96, Jan. 1978.

    Google Scholar 

  9. M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. Declarative modeling of the operational behavior of logic languages. Theoretical Computer Science, 69(3):289–318, 1989.

    Google Scholar 

  10. M. Gabbrielli and R. Giacobazzi. Goal independency and call patterns in the analysis of logic programs. In Proceedings of the ACM Symposium on Applied Computing. ACM Press, 1994.

    Google Scholar 

  11. R. Giacobazzi, S. K. Debray, and G. Levi. Generalized semantics and abstract interpretation for constraint logic programs. Journal of Logic Programming, 25(3):191–247, Dec. 1995.

    Google Scholar 

  12. J. Jaffar and M. J. Maher. Constraint logic programming: A survey. The Journal of Logic Programming, 19 & 20:503–582, May 1994.

    Google Scholar 

  13. N. Lindenstrauss and Y. Sagiv. Automatic termination analysis of logic programs. Technical report, Hebrew University, 1996. To appear in Proceedings ICLP97.

    Google Scholar 

  14. J. Lloyd. Foundations of Logic Programming. Springer-Verlag, 2nd edition, 1987.

    Google Scholar 

  15. Y. Sagiv. A termination test for logic programs. In V. Saraswat and K. Ueda, editors, Logic Programming, Proceedings of the 1991 International Symposium, pages 518–532, San Diego, USA, 1991. The MIT Press.

    Google Scholar 

  16. A. van Gelder. Deriving constraints among argument sizes in logic programs. Annals of Mathematics and Artificial Intelligence, 3, 1991.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Michael Hanus Jan Heering Karl Meinke

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Codish, M., Taboch, C. (1997). A semantic basis for termination analysis of logic programs and its realization using symbolic norm constraints. In: Hanus, M., Heering, J., Meinke, K. (eds) Algebraic and Logic Programming. ALP HOA 1997 1997. Lecture Notes in Computer Science, vol 1298. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0027001

Download citation

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

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-63459-1

  • Online ISBN: 978-3-540-69555-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics