Abstract
In this paper, we study termination properties of input-consuming derivations of moded logic programs. Input-consuming derivations can be used to model the behavior of logic programs using dynamic scheduling and employing constructs such as delay declarations. A class of logic programs called linear bounded programs is introduced and input-termination of these programs is investigated. It is proved that linear bounded programs have only input-consuming LD-derivations (i.e., under Prolog’s selection) of finite length. An attempt is then made to extend this result to all input-consuming derivations (not ncessarily under Prolog’s selection). Through a counterexample, it is shown that the above result does not hold for the whole class of linear bounded programs under arbitrary selection. However, it is proved that simply-moded linear bounded programs have only input-consuming derivations of finite length, i.e., simply-moded linear bounded programs are input-terminating with dynamic scheduling. This class contains many programs like append, delete, insert, reverse, permute, count, listsum, listproduct, insertion-sort, quick-sort on lists, various tree traversal programs and addition, multiplication, factorial, power on natural numbers. Further, it is decidable whether a given logic program is linear bounded or not, in contrast to the notions of acceptable and recurrent programs.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Apt, K.R.: Introduction to Logic Programming. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science. Formal Models and Semantics, vol. B, pp. 495–574 (1990)
Apt, K.R., Luitjes, I.: Verification of logic programs with delay declarations. In: Alagar, V.S., Nivat, M. (eds.) AMAST 1995. LNCS, vol. 936, pp. 66–90. Springer, Heidelberg (1995)
Apt, K.R., Pedreschi, D.: Reasoning about termination of pure prolog programs. Information and Computation 106, 109–157 (1993)
Bezem, M.: Characterizing termination of logic programs with level mappings. Journal of Logic Programming 15(1/2), 79–98 (1992)
Bossi, A., Cocco, N., Fabris, M.: Norms on Terms and their use in Proving Universal Termination of a Logic Program. Theoretical Computer Science 124, 297–328 (1994)
Bossi, A., Etalle, S., Rossi, S.: Properties of input–consuming derivations. Theory and Practice of Logic Programming 2, 125–154 (2002)
Bossi, A., Etalle, S., Rossi, S., Smaus, J.G.: Termination of simply-moded logic programs with dynamic scheduling. ACM Trans. Comput. Log. 15(3), 470–507 (2004)
Debray, S.K., Warren, D.S.: Automatic mode inference for logic programs. J. Logic Programming 5, 207–229 (1988)
Decorte, S., De Schreye, D., Fabris, M.: Automatic inference of norms: a missing link in automatic termination analysis. In: Ito, T., Meyer, A.R. (eds.) TACS 1991. LNCS, vol. 526, pp. 420–436. Springer, Heidelberg (1991)
Decorte, S., De Schreye, D., Vandecasteele, H.: Constraint-based termination analysis of logic programs. ACM Trans. Program. Lang. Syst. 21(6), 1137–1195 (1999)
De Schreye, D.: Personal communication (2004)
De Schreye, D., Decorte, S.: Termination of logic programs: The never-ending story. Journal of Logic Programming 19/20, 199–260 (1994)
Genaim, S., Codish, M., Gallagher, J., Lagoon, V.: Combining Norms to Prove Termination. In: Cortesi, A. (ed.) VMCAI 2002. LNCS, vol. 2294, pp. 126–138. Springer, Heidelberg (2002)
Krishna Rao, M.R.K., Kapur, D., Shyamasundar, R.K.: Transformational Methodology for Proving Termination of Logic Programs. Journal of Log. Program. 34(1), 1–41 (1998)
Lindenstrauss, N., Sagiv, Y.: Automatic termination analysis of logic programs. In: ICLP’1997, pp. 63–77 (1997)
Lagoon, V., Mesnard, F., Stuckey, P.: Termination Analysis with Types Is More Accurate. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 254–268. Springer, Heidelberg (2003)
Lloyd, J.W.: Foundations of Logic Programming. Springer, Heidelberg (1987)
Mesnard, F., Ruggieri, S.: On proving left termination of constraint logic programs. ACM Transactions on Computational Logic 4(2), 1–26 (2003)
Plümer, L.: Termination proofs for logic programs, Ph. D. thesis, University of Dortmund (1990); Also appeared: Plümer, L.: Termination Proofs for Logic Programs. LNCS, vol. 446. Springer, Heidelberg (1990)
Smaus, J.G.: Proving termination of input consuming logic programs. In: Proc. of ICLP 1999, pp. 335–349 (1999)
Smaus, J.-G., Hill, P.M., King, A.: Verifying Termination and Error-Freedom of Logic Programs with block Declarations. Theory and Practice of Logic Programming 1(4), 447–486 (2001)
Verschaetse, K., De Schreye, D.: Deriving Termination Proofs for Logic Programs, Using Abstract Procedures. In: Proc. of ICL, pp. 301–315 (1991)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Krishna Rao, M.R.K. (2005). Input-Termination of Logic Programs. In: Etalle, S. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2004. Lecture Notes in Computer Science, vol 3573. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11506676_14
Download citation
DOI: https://doi.org/10.1007/11506676_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-26655-6
Online ISBN: 978-3-540-31683-1
eBook Packages: Computer ScienceComputer Science (R0)