skip to main content
article

Termination of simply moded logic programs with dynamic scheduling

Published:01 July 2004Publication History
Skip Abstract Section

Abstract

In logic programming, dynamic scheduling indicates the feature by means of which the choice of the atom to be selected at each resolution step is done at runtime and does not follow a fixed selection rule such as the left-to-right one of Prolog. Input-consuming derivations were introduced to model dynamic scheduling while abstracting from the technical details. In this article, we provide a sufficient and necessary criterion for termination of input-consuming derivations of simply moded logic programs. The termination criterion we propose is based on a denotational semantics for partial derivations which is defined in the spirit of model-theoretic semantics previously proposed for left-to-right derivations.

References

  1. Apt, K. R. 1990. Logic Programming. In Handbook of Theoretical Computer Science, J. van Leeuwen, Ed. Vol. B: Formal Models and Semantics. Elsevier and The MIT Press, Amsterdam, The Netherlands, and Cambridge, MA, 495--574.]] Google ScholarGoogle Scholar
  2. Apt, K. R. 1997. From Logic Programming to Prolog. Prentice Hall, London, U.K.]] Google ScholarGoogle Scholar
  3. Apt, K. R. and Etalle, S. 1993. On the unification free Prolog programs. In Proceedings of the Conference on Mathematical Foundations of Computer Science (MFCS'93), A. Borzyszkowski and S. Sokolowski, Eds. Lecture Notes in Computer Science, vol. 711. Springer-Verlag, Berlin, Germany, 1--19.]] Google ScholarGoogle Scholar
  4. Apt, K. R. and Luitjes, I. 1995. Verification of logic programs with delay declarations. In Proceedings of the 4th International Conference on Algebraic Methodology and Software Technology (AMAST'95), V. Alagar and M. Nivat, Eds. Lecture Notes in Computer Science, vol. 936. Springer-Verlag, Berlin, Germany, 66--90.]] Google ScholarGoogle Scholar
  5. 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, Oxford, U.K., 183--229.]] Google ScholarGoogle Scholar
  6. Bossi, A., Etalle, S., and Rossi, S. 2000. Semantics of well-moded input-consuming logic programs. Comput. Lang. 26, 1, 1--25.]] Google ScholarGoogle Scholar
  7. Bossi, A., Etalle, S., and Rossi, S. 2002. Properties of input-consuming derivations. Theor. Pract. Logic Programm. 2, 2, 125--154.]] Google ScholarGoogle Scholar
  8. Bossi, A., Etalle, S., Rossi, S., and Smaus, J.-G. 2001. Semantics and termination of simply moded logic programs with dynamic scheduling. In Proceedings of the European Symposium on Programming (Genoa, Italy), D. Sands, Ed. Lecture Notes in Computer Science, vol. 2028. Springer-Verlag, Berlin, Germany, 402--416.]] Google ScholarGoogle Scholar
  9. Bossi, A., Gabrielli, M., Levi, G., and Martelli, M. 1994. The S-semantics approach: Theory and applications. J. Logic Programm. 19 & 20, 149--198.]]Google ScholarGoogle Scholar
  10. Boye, J. 1996. Directional types in logic programming. Ph.D. dissertation, Linköpings Universitet, Linköping, Sweden]]Google ScholarGoogle Scholar
  11. de Boer, F. and Palamidessi, C. 1991. A fully abstract model for concurrent constraint programming. In Proceedings of the International Joint Conference on Theory and Practice of Software Development (TAPSOFT/CAAP), S. Abramsky and T. Maibaum, Eds. Lecture Notes in Computer Science, vol. 493. Springer-Verlag, Berlin, Germany, 296--319.]] Google ScholarGoogle Scholar
  12. Etalle, S., Bossi, A., and Cocco, N. 1999. Termination of well-moded programs. J. Logic Programm. 38, 2, 243--257.]]Google ScholarGoogle Scholar
  13. Etalle, S., Gabbrielli, M., and Meo, M. C. 2002. Transformations of ccp programs. ACM Trans. Programm. Lang. Syst. 23, 3, 304--395.]] Google ScholarGoogle Scholar
  14. Falaschi, M., Gabbrielli, M., Marriott, K., and Palamidessi, C. 1997. Constraint logic programming with dynamic scheduling: a semantics based on closure operators. Inform. Computat. 137, 1, 41--67.]] Google ScholarGoogle Scholar
  15. Kowalski, R. A. 1979. Algorithm = logic + control. Commun. ACM 22, 7, 424--436.]] Google ScholarGoogle Scholar
  16. Lloyd, J. W. 1987. Foundations of Logic Programming, 2nd ed. Symbolic Computation---Artificial Intelligence Series. Springer-Verlag, Berlin, Berlin, Germany.]] Google ScholarGoogle Scholar
  17. Lüttringhaus-Kappel, S. 1993. Control generation for logic programs. In Proceedings of the 10th International Conference on Logic Programming (Budapest, Hungary), D. Warren, Ed. The MIT Press, Cambridge, MA. 478--495.]] Google ScholarGoogle Scholar
  18. Marchiori, E. and Teusink, F. 1999. Termination of logic programs with delay declarations. J. Logic Programm. 39, 1--3, 95--124.]]Google ScholarGoogle Scholar
  19. Martin, J. C. and King, A. M. 1997. Generating efficient, terminating logic programs. In Proceedings of the 7th International Joint Conference on Theory and Practice of Software Development (Lille, France), M. Bidoit and M. Dauchet, Eds. Lecture Notes in Computer Science, vol. 1214. Springer-Verlag, Berlin, Germany, 273--184.]] Google ScholarGoogle Scholar
  20. Naish, L. 1982 (Revised July 1983). An introduction to MU-Prolog. Tech. rep. 82/2, Department of Computer Science, University of Melbourne, Melbourne, Australia.]]Google ScholarGoogle Scholar
  21. Naish, L. 1986. Negation and Control in Prolog. Lecture Notes in Computer Science, vol. 238. Springer-Verlag, New York.]] Google ScholarGoogle Scholar
  22. Naish, L. 1988. Parallelizing NU-Prolog. In Proceedings of the 5th International Conference/Symposium on Logic Programming (Seattle, Washington), K. A. Bowen and R. A. Kowalski, Eds. The MIT Press, Cambridge, MA, 1546--1564.]]Google ScholarGoogle Scholar
  23. Naish, L. 1993. Coroutining and the construction of terminating logic programs. Australian Comput. Sci. Commun. 15, 1, 181--190.]]Google ScholarGoogle Scholar
  24. Pedreschi, D., Ruggieri, S., and Smaus, J.-G. 2002. Classes of terminating logic programs. Theor. Pract. Logic Programm. 3, 2, 369--418.]] Google ScholarGoogle Scholar
  25. Ruggieri, S. 1997. Termination of constraint logic programs. In Proceedings of the 24th International Colloquium on Automata, Languages and Programming (ICALP'97), Bologna, Italy. Lecture Notes in Computer Science, vol. 1256. Springer-Verlag, Berlin, Germany, 838--848.]] Google ScholarGoogle Scholar
  26. Saraswat, V. A. and Rinard, M. 1990. Concurrent constraint programming. In Proceedings of the 17th ACM Symposium on Principles of Programming Languages (San Francisco, California). ACM, New York, NY, 232--245.]] Google ScholarGoogle Scholar
  27. Smaus, J.-G. 1999a. Modes and types in logic programming. Ph.D. dissertation, University of Kent at Canterbury, Canterbury, U.K. Available online from http://www.cs.ukc.ac.uk/pubs/1999/986/.]]Google ScholarGoogle Scholar
  28. Smaus, J.-G. 1999b. Proving termination of input-consuming logic programs. In Proceedings of the 16th International Conference on Logic Programming (Las Cruces, NM), D. De Schreye, Ed. The MIT Press, Cambridge, MA, 335--349.]] Google ScholarGoogle Scholar
  29. Smaus, J.-G., Hill, P. M., and King, A. M. 1998. Termination of logic programs with block declarations running in several modes. In Proceedings of the 10th Symposium on Programming Language Implementations and Logic Programming (Pisa, Italy), C. Palamidessi, Ed. Lecture Notes in Computer Science, vol. 1490. Springer-Verlag, Berlin, Germany, 73--88.]] Google ScholarGoogle Scholar
  30. Smaus, J.-G., Hill, P. M., and King, A. M. 2001. Verifying termination and error-freedom of logic programs with block declarations. Theor. Pract. Logic Programm. 1, 4, 447--486.]] Google ScholarGoogle Scholar
  31. Sterling, L. and Shapiro, E. 1986. The Art of Prolog. The MIT Press, Cambridge, MA.]]Google ScholarGoogle Scholar
  32. Ueda, K. and Furukawa, K. 1988. Transformation rules for GHC Programs. In Proceedings of the International Conference on Fifth Generation Computer Systems. Institute for New Generation Computer Technology, Tokyo, OHMSHA Ltd, Tokyo, and Springer-Verlag, Tokyo, Japan, 582--591.]]Google ScholarGoogle Scholar
  33. Ueda, K. and Morita, M. 1994. Moded flat GHC and its message-oriented implementation technique. New Gen. Comput. 13, 1, 3--43.]] Google ScholarGoogle Scholar
  34. van Emden, M. H. and de Lucena, G. J. 1982. Predicate logic as a language for parallel programming. In Logic Programming, K. Clark and S.-A. Tärnlund, Eds. Academic Press, London, U.K.]]Google ScholarGoogle Scholar

Index Terms

  1. Termination of simply moded logic programs with dynamic scheduling

          Recommendations

          Reviews

          Robert Kolter

          Many Prolog systems search for solutions by using a fixed rule to choose an atom to carry out a derivation step. This approach is not always adequate, since termination cannot be guaranteed, even if the program under consideration has a solution. Dynamic scheduling is concerned with the issue of choosing the atom to be selected at runtime, without using a fixed selection rule. In order to model and analyze this topic, the class of input consuming derivations is introduced and analyzed. This paper is concerned with two central topics: the semantics of partial derivations, and the termination of these derivations. While the first topic is modeled by defining a slight modified immediate consequence operator, the termination criterion derived here relies on several techniques, such as input terminating programs (programs that only produce finite input consuming derivations, given certain queries as inputs) and level mappings. The key result is that the property of being simply acceptable is a sufficient and necessary criterion for input termination. The paper is written formally, and is clear and easily readable. What is most important, in my opinion, is that the authors have included many illustrative examples, which make the key concepts clear. For example, the Quicksort example from section 5.2 is more than one page long, and explains everything in detail. Another section (section 6) is devoted to additional examples demonstrating the usefulness of the concepts described in the text. Online Computing Reviews Service

          Access critical reviews of Computing literature here

          Become a reviewer for Computing Reviews.

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader