Abstract
We present the implementation of cTI, a system for universal left-termination inference of logic programs.
Termination inference generalizes termination analysis/checking. Traditionally, a termination analyzer tries to prove that a given class of queries terminates. This class must be provided to the system, requiring user annotations. With termination inference such annotations are no longer necessary. Instead, all provably terminating classes to all related predicates are inferred at once.
The architecture of cTI is described1 and some optimizations are discussed. Running times for classical examples from the termination literature in LP and for some middle-sized logic programs are given.
A preliminary version of this paper was presented at the Workshop on Parallelism and Implementation Technology for Constraint Logic Programming Languages (ed. Ines de Castro Dutra), CL’2000, London.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
K. R. Apt and D. Pedreschi. Reasoning about termination of pure Prolog programs. Information and computation, 1(106):109–157, 1993.
K. R. Apt and D. Pedreschi. Modular termination proofs for logic and pure Prolog programs. In G. Levi, editor, Advances in Logic Programming Theory, pages 183–229. Oxford University Press, 1994.
K.R. Apt. From Logic Programming to Prolog. Prentice Hall, 1997.
K.R. Apt and D. Pedreschi. Studies in pure Prolog: Termination. In J.W. Lloyd, editor, Proc. of the Symp. in Computational Logic, pages 150–176. Springer, 1990.
B. De Backer and H. Beringer. A clp language handling disjunctions of linear constraints. In Proc. of ICLP’93, pages 550–563. MIT Press, 1993.
F. Benoy and A. King. Inferring argument size relationships with CLP(R). In J. P. Gallagher, editor, Logic Program Synthesis and Transformation, volume 1207 of LNCS. Springer-Verlag, 1997.
F. Bueno, D. Cabeza, M. Carro, M. Hermenegildo, P. López-Garcia, and G. Puebla. The Ciao Prolog System. Reference Manual. The Ciao System Documentation Series-TR CLIP3/97.1, School of Computer Science, Technical University of Madrid (UPM), August 1997. System and on-line version of the manual available at http://clip.dia.fi.upm.es/Software/Ciao/.
F. Bueno, M. Garcia de la Banda, and M. Hermenegildo. Effectiveness of global analysis in strict independence-based automatic program parallelization. In Proc. of the 1994 Intl. Symp. on Logic Programming, pages 320–336. MIT Press, 1994.
M. Carlsson. Boolean constraints in SICStus Prolog. Technical Report T91:09, Swedish Institute of Computer Science, 1994.
M. Codish. Worst-case groundness analysis using positive boolean functions. Journal of Logic Programming, 41(1):125–128, 1999.
M. Codish and C. Taboch. A semantics basis for termination analysis of logic programs. Journal of Logic Programming, 41(1):103–123, 1999.
S. Colin, F. Mesnard, and A. Rauzy. Constraint logic programming and mu-calculus. ERCIM/COMPULOG Workshop on Constraints, 1997.
P. Cousot and R. Cousot. Abstract interpretation: a unifed lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. of the 4th Symp. on Principles of Programming Languages, pages 238–252. ACM, 1977.
P. Cousot and R. Cousot. Abstract interpretation and application to logic programs. Journal of Logic Programming, 13(2,3):103–179, 1992.
P. Cousot and R. Cousot. Comparing the Galois connection and widening/narrowing approaches to abstract interpretation. In Proc. of PLILP’92, volume 631 of LNCS. Springer-Verlag, 1992.
P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Proc. of the 5th Symp. on Principles of Programming Languages, pages 84–96. ACM, 1978.
S. K. Debray, P. Lopez-Garcia, M. Hermenegildo, and N.-W. Lin. Estimating the computational cost of logic programs. In B. Le Charlier, editor, LNCS, volume 864, pages 255–265. Springer-Verlag, 1994. Proc. of SAS’94.
S. Decorte. Enhancing the power of termination analysis of logic programs through types and constraints. PhD thesis, Katholieke Universiteit Leuven, 1997.
S. Decorte, D. De Schreye, and H. Vandecasteele. Constraint-based termination analysis of logic programs. ACM Transactions on Programming Languages and Systems, 21(6):1136–1195, 1999.
P. Deransart, A. Ed-Dbali, and L. Cervoni. Prolog: The standard, reference manuel. Springer-Verlag, 1996.
P. Deransart, G. Ferrand, and M. Téguia. NSTO programs (not subject to occur-check). Proc. of the Int. Logic Programming Symp., pages 533–547, 1991.
D. DeSchreye and S. Decorte. Termination of logic programs: the never-ending story. Journal of Logic Programming, 19-20:199–260, 1994.
M. Handjieva. Stan: a static analyzer for CLP(R) based on abstract interpretation. In R. Cousot and D. Schmidt, editors, Proc. of SAS’96, volume 1145 of LNCS. Springer-Verlag, 1996.
C. Holzbaur. OFAI clp(q,r) manual, edition 1.3.3. Technical Report TR-95-09, Austrian Research Institute, 1995.
J. Jaffar and J-L. Lassez. Constraint logic programming. In Proc. of the 14th Symp. on Principles of Programming Languages, pages 111–119. ACM, 1987.
J. Jaffar and M. J. Maher. Constraint logic programming: a survey. Journal of Logic Programming, 19:503–581, 1994.
K.-K. Lau, M. Ornaghi, A. Pettorossi, and M. Proietti. Correctness of logic program transformation based on existential termination. In J. W. Lloyd, editor, Proc. of the 1995 Intl. Logic Programming Symp, pages 480–494. MIT Press, 1995.
G. Levi and F. Scozzari. Contributions to a theory of existential termination for definite logic programs. In M. Alpuente and M. I. Sessa, editors, Proc. of the GULP-PRODE’95 Joint Conf. on Declarative Programming, pages 631–641, 1995.
N. Lindenstrauss and Y. Sagiv. Automatic termination analysis of logic programs. In L. Naish, editor, Proc. of the 14th Intl. Conf. on Logic Programming, pages 63–77. MIT Press, 1997.
N. Lindenstrauss, Y. Sagiv, and A. Serebrenik. Unfolding the mystery of mergesort. In N. Fuchs, editor, Proc. of LOPSTR’97, volume 1463 of LNCS. Springer-Verlag, 1998.
J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.
M. Marchiori. Proving existential termination of normal logic programs. In Proc. of AMAST, volume 1101 of LNCS, pages 375–390, 1996.
F. Mesnard. Inferring left-terminating classes of queries for constraint logic programs by means of approximations. In M. J. Maher, editor, Proc. of the 1996 Joint Intl. Conf. and Symp. on Logic Programming, pages 7–21. MIT Press, 1996.
F. Mesnard. Entailment and projection for CLP(B) and CLP(Q) in SICStus Prolog. 1st Intl. Workshop on Constraint Reasoning for Constraint Programming, 1997.
F. Mesnard and S. Ruggieri. On proving left termination of constraint logic programs. Technical report, Université de La Réunion, 2001. Submitted for publication.
U. Neumerkel. GUPU: A Prolog course environment and its programming methodology. In M. Maher, editor, Proc. of JICSLP’96, page 549. MIT Press, 1996. http://www.complang.tuwien.ac.at/ulrich/gupu/.
L. Plümer. Termination proofs for logic programs. LNAI, 446, 1990.
S. Ruggieri. Verification and Validation of Logic Programs. PhD thesis, Università di Pisa, 1999.
H. Sağlam. A Toolkit for Static Analysis of Constraint Logic Programs. PhD thesis, University of Bristol, 1997.
A. Schrijver. Theory of linear and integer programming. Wiley, 1986.
K. Sohn and A. Van Gelder. Termination detection in logic programs using argument sizes. In Proc. of the 1991 Intl. Symp. on Principles of Database Systems, pages 216–226. ACM, 1991.
Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury, an efficient purely declarative Logic Programming language. The Journal of Logic Programming, 29(1–3):17–64, 1996.
C. Speirs, Z. Somogyi, and H. Søndergaard. Termination analysis for Mercury. In P. van Hentenrick, editor, Proc. of the 1997 Intl. Symp. on Static Analysis, volume 1302 of LNCS. Springer-Verlag, 1997.
J. D. Ullman and A. Van Gelder. Efficient tests for top-down termination of logical rules. Communications of the ACM, pages 345–373, 1988.
T. Vasak and J. Potter. Characterization of terminating logic programs. In Proc. of the 1986 Intl. Symp. on Logic Programming, pages 140–147. IEEE, 1986.
K. Verschaetse. Static termination analysis for definite Horn clause programs. PhD thesis, Dept. Computer Science, K.U. Leuven, 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Mesnard, F., Neumerkel, U. (2001). Applying Static Analysis Techniques for Inferring Termination Conditions of Logic Programs. In: Cousot, P. (eds) Static Analysis. SAS 2001. Lecture Notes in Computer Science, vol 2126. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-47764-0_6
Download citation
DOI: https://doi.org/10.1007/3-540-47764-0_6
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-42314-0
Online ISBN: 978-3-540-47764-8
eBook Packages: Springer Book Archive