New Generation Computing

, Volume 11, Issue 1, pp 47–79 | Cite as

A general criterion for avoiding infinite unfolding during partial deduction

  • Maurice Bruynooghe
  • Danny De Schreye
  • Bern Martens
Regular Papers


Well-founded orderings are a commonly used tool for proving the termination of programs. We introduce related concepts specialised to SLD-trees. Based on these concepts, we formulate formal and practical criteria for controlling the unfolding during the construction of SLD-trees that form the basis of a partial deduction. We provide algorithms that allow to use these criteria in a constructive way. In contrast to the many ad hoc techniques proposed in the literature, our technique provides both a formal and practically applicable framework.


Logic Programming Partial Deduction Termination 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1).
    Apt, K. R. and Pedreschi, D., “Studies in Pure Prolog: Termination,”Proc. Esprit Symposium on Computational Logic (J. W. Lloyd, ed.), pp. 150–176, 1990.Google Scholar
  2. 2).
    Benkerimi, K. and Lloyd, J. W., “A Procedure for the Partial Evaluation of Logic Programs,”Technical Report, TR-89-04, Department of Computer Science, University of Bristol, Great-Britain, 1989.Google Scholar
  3. 3).
    Benkerimi, K. and Lloyd, J. W., “A Procedure for the Partial Evaluation of Logic Programs,”Proc. NACLP90 (S. Debray and M. Hermenegildo, eds.), pp. 343–358, 1990.Google Scholar
  4. 4).
    Bezem, M., “Characterising Termination of Logic Programs with Level Mappings,”Proc. NACLP89 (E. L. Lusk and R. A. Overbeek, eds.), pp. 69–80, 1989. Revised version will appear inJournal of Logic Programming.Google Scholar
  5. 5).
    Bol, R. N., “Loop Checking in Logic Programming,”Ph.D. thesis, CWI, Amsterdam, 1991.Google Scholar
  6. 6).
    Bruynooghe, M., De Schreye, D. and Krekels, B., “Compiling Control,”Journal of Logic Programming, pp. 135–162, 1989.Google Scholar
  7. 7).
    Burt, A. D., Hill, P. M. and Lloyd, J. W., “Preliminary Report on the Logic Programming Language Gödel,”Technical Report, TR-90-02, Computer Science Department, University of Bristol, March 1990. Revised Oct. 1990.Google Scholar
  8. 8).
    Cavedon, L., “Continuity, Consistency, and Completeness Properties for Logic Programs,”Proc. ICLP89 (G. Levi and M. Martelli, eds.), pp. 571–584, 1989.Google Scholar
  9. 9).
    Chan, D. and Wallace, M., “A Treatment of Negation during Partial Evaluation,” inMeta-Programming in Logic Programming (H. D. Abramson and M. H. Rogers, eds.),Proc. Meta88, MIT Press, pp. 299–318, 1989.Google Scholar
  10. 10).
    De Schreye, D. and Bruynooghe, M., “On the Transformation of Logic Programs with Instantiation Based Computation Rules,”J. Symbolic Computation, pp. 125–154, 1989.Google Scholar
  11. 11).
    De Schreye, D., Verschaetse, K. and Bruynooghe, M., “A Framework for Analysing the Termination of Definite Logic Programs,” inProc. FGCS92, 1992.Google Scholar
  12. 12).
    Dershowitz, N. and Manna, Z., “Proving Termination with Multiset Orderings,”Communications of the ACM,22,8, Aug. 1979.Google Scholar
  13. 13).
    Dershowitz, N., “Termination of Rewriting,”Journal of Symbolic Computation, 3, pp. 69–116, 1987.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14).
    Fitting, M.First-Order Logic and Automated Theorem Proving, Springer-Verlag, New York, 1990.zbMATHGoogle Scholar
  15. 15).
    Floyd, R. W., “Assigning Meanings to Programs,”Proc. Symp. in Applied Math., 19, Amer. Math. Soc., Providence, R. I., pp. 19–32, 1967.Google Scholar
  16. 16).
    Fujita, H. and Furukawa, K., “A Self-Applicable Partial Evaluator and Its Use in Incremental Compilation,”New Generation Computing, 6, 2–3, pp. 91–118, 1988.zbMATHCrossRefGoogle Scholar
  17. 17).
    Gallagher, J., “Transforming Logic Programs by Specializing Interpreters,”Proc. 7th European Conference on Artificial Intelligence, pp. 109–122, 1986.Google Scholar
  18. 18).
    Gallagher, J. and Bruynooghe, M., “The Derivation of an Algorithm for Program Specialization,” inProc. ICLP90 (D. H. D. Warren and P. Szeredi, eds.), pp. 732–746, 1990. Revised version inNew Generation Computing, 9, 3–4, pp. 305–334, 1991.Google Scholar
  19. 19).
    Jones, N. D., Sestoft, P. and Sondergaard, H., “MIX: A Self-Applicable Partial Evaluator for Experiments in Compiler Generation,”Lisp and Symbolic Computation 2, pp. 9–50, 1989.CrossRefGoogle Scholar
  20. 20).
    Komorowski, H. J., “A Specification of an Abstract Prolog Machine and Its Application to Partial Evaluation,”Technical Report, LSST69, Linkoping University, 1981.Google Scholar
  21. 21).
    Komorowski, H. J., “Synthesis of Programs in the Framework of Partial Deduction,”Ser. A, No. 81, Departments of Computer Science and Mathematics, Abo Akademi, Finland, 1989.Google Scholar
  22. 22).
    Lakhotia, A. and Sterling, L., “Development of a Prolog Partial Evaluation System,” inThe Practice of Prolog (L. Sterling, ed.), MIT Press, 1990.Google Scholar
  23. 23).
    Levi, G. and Sardu, G., “Partial Evaluation of Metaprograms in a Multiple Worlds Logic Language,”New Generation Computing, 6, 2–3, pp. 227–247, 1988.zbMATHCrossRefGoogle Scholar
  24. 24).
    Lloyd, J. W. and Shepherdson, J. C., “Partial Evaluation in Logic Programming,”J. Logic Programming, 11, 3–4, pp. 217–242, 1991.zbMATHCrossRefMathSciNetGoogle Scholar
  25. 25).
    Manna, Z. and Ness, S., “On the Termination of Markov Algorithms,” inProc. 3rd Hawaii Int. Conf. on Syst. Sci., Honolulu, Hawaii, pp. 784–792, 1970.Google Scholar
  26. 26).
    Martens, B., De Schreye, D. and Bruynooghe, M., “Sound and Complete Partial Deduction with Unfolding Based on Well-Founded Measures,” inProc. FGCS92, 1992.Google Scholar
  27. 27).
    Plümer, L., “Termination Proofs of Logic Programs,”LNCS446, Springer-Verlag, 1990.Google Scholar
  28. 28).
    Safra, S. and Shapiro, E., “Meta Interpreters for Real,”Proceedings of IFIP86 (H.-J. Kugler, ed.), pp. 271–278, 1986.Google Scholar
  29. 29).
    Sahlin, D., “The Mixtus Approach to Automatic Partial Evaluation of Full Prolog,”Proc. NACLP90 (S. Debray and M. Hermenegildo, eds.), pp. 377–398, 1990.Google Scholar
  30. 30).
    Smith, D. A. and Hickey, T. J., “Partial Evaluation of a CLP Language,”Proc. NACLP90 (S. Debray and M. Hermenegildo, eds.), pp. 119–138, 1990.Google Scholar
  31. 31).
    Sterling, L. and Beer, R. D., “Incremental Flavor-Mixing of Meta-Interpreters for Expert System Construction,”Proc. 1986 Symp. on Logic Programming, IEEE Comp. Society Press, pp. 20–27, 1986.Google Scholar
  32. 32).
    Sterling, L. and Beer, R. D., “Metainterpreters for Expert System Construction,”J. Logic Programming, 6, 1–2, pp. 163–178, 1989.CrossRefGoogle Scholar
  33. 33).
    Takeuchi, A. and Furukawa, K., “Partial Evaluation of Prolog Programs and Its Application to Metaprogramming,”Proceedings of IFIP86 (H.-J. Kugler, ed.), pp. 415–420, 1986.Google Scholar
  34. 34).
    Ullman, J. D. and Van Gelder, A., “Efficient Tests for Top-Down Termination of Logical Rules,”J. ACM, 35, 2, pp. 345–373, 1988.CrossRefGoogle Scholar
  35. 35).
    Van Harmelen, F., “The Limitations of Partial Evaluation,” inLogic-Based Knowledge Representation (P. Jackson, H. Reichgelt and F. Van Harmelen, eds.), MIT Press, 1989.Google Scholar
  36. 36).
    Venken, R., “A Prolog. Meta Interpreter for Partial Evaluation and Its Application to Source to Source Transformation and Query Optimization,” inECAI-84: Advances in Artificial Intelligence, North-Holland, Pisa, pp. 91–100, 1984.Google Scholar
  37. 37).
    Venken, R. and Demoen, B., “A Partial Evaluation System for Prolog: Some Practical Considerations,”New Generation Computing, 6, 2–3, pp. 279–290, 1988.CrossRefGoogle Scholar
  38. 38).
    Yalcinalp, L. U., Sterling, L., Lakhotia, A. and Bansal, A., “The COMPOSERS’ Guide to Meta-Programming,” inInternal report, Department of Computer Engineering and Science, Case Western Reserve University, Cleveland, Ohio, USA, 1990.Google Scholar

Copyright information

© Ohmsha, Ltd. and Springer 1992

Authors and Affiliations

  • Maurice Bruynooghe
    • 1
  • Danny De Schreye
    • 1
  • Bern Martens
    • 1
  1. 1.Department of Computer ScienceKatholieke Universiteit LeuvenHeverleeBelgium

Personalised recommendations