Skip to main content
Log in

Constrained partial deduction and the preservation of characteristic trees

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Partial deduction strategies for logic programs often use an abstraction operator to guarantee the finiteness of the set of goals for which partial deductions are produced. Finding an abstraction operator which guarantees finiteness and does not lose relevant information is a difficult problem. In earlier work Gallagher and Bruynooghe proposed to base the abstraction operator oncharacteristic paths andtrees, which capture the structure of the generated incomplete SLDNF-tree for a given goal.

In this paper we exhibit the advantages of characteristic trees over purely syntactical measures: if characteristic trees can be preserved upon generalisation, then we obtain an almost perfect abstraction operator, providing just enough polyvariance to avoid any loss of local specialisation. Unfortunately, the abstraction operators proposed in earlier work do not always preserve the characteristic trees upon generalisation. We show that this can lead to important specialisation losses as well as to non-termination of the partial deduction algorithm. Furthermore, this problem cannot be adequately solved in the ordinary partial deduction setting.

We therefore extend the expressivity and precision of the Lloyd and Shepherdson partial deduction framework by integrating constraints. We provide formal correctness results for the so obtained generic framework ofconstrained partial deduction. Within this new framework we are, among others, able to overcome the above mentioned problems by introducing an alternative abstraction operator, based on so calledpruning constraints. We thus present a terminating partial deduction strategy which, for purely determinate unfolding rules, induces no loss of local specialisation due to the abstraction while ensuring correctness of the specialised programs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Apt, K. R., “Introduction to Logic Programming,” inHandbook of Theoretical Computer Science (J. van Leeuwen, ed.), North-Holland, Amsterdam, chapter 10, pp. 495–574, 1990.

    Google Scholar 

  2. Benkerimi, K. and Hill, P. M., “Supporting Transformations for the Partial Evaluation of Logic Programs,”Journal of Logic and Computation, 3, 5, pp. 469–486, October 1993.

    Article  MATH  MathSciNet  Google Scholar 

  3. Benkerimi, K. and Lloyd, J. W., “A Partial Evaluation Procedure for Logic Programs,” inProceedings of the North American Conference on Logic Programming (S. Debray and M. Hermenegildo, eds.), MIT Press, pp. 343–358, 1990.

  4. Bol, R., “Loop Checking in Partial Deduction,”Journal of Logic Programming, 16, 1–2, pp. 25–46, 1993.

    Article  MATH  MathSciNet  Google Scholar 

  5. Bossi, A., Cocco, N., and Dulli, S., “A Method for Specialising Logic Programs,”ACM Transactions on Programming Languages and Systems, 12, 2, pp. 253–302, 1990.

    Article  Google Scholar 

  6. Bruynooghe, M., De Schreye, D., and Martens, B., “A General Criterion for Avoiding Infinite Unfolding during Partial Deduction,”New Generation Computing, 11, 1, pp. 47–79, 1992.

    MATH  Google Scholar 

  7. Chan, D., “Constructive Negation Based on the Completed Database,” inProceedings of the Joint International Conference and Symposium on Logic Programming, Seattle, 1988, IEEE, MIT Press, pp. 111–125, 1988.

  8. Chan, D. and Wallace, M., “A Treatment of Negation during Partial Evaluation,” inMeta-Programming in Logic Programming, Proceedings of the Meta88 Workshop (H. Abramson and M. Rogers, eds.), June 1988, MIT Press, pp. 299–318, 1989.

  9. Clark, K. L., “Negation as Failure,” inLogic and Data Bases (H. Gallaire and J. Minker, eds.), Plenum Press, pp. 293–322, 1978.

  10. De Schreye, D. and Decorte, S., “Termination of Logic Programs: The Never Ending Story,”The Journal of Logic Programming, 19–20, pp. 199–260, May 1994.

    Google Scholar 

  11. de Wall, D. A. and Gallagher, J., “Specialisation of a Unification Algorithm,” inLogic Program Synthesis and Transformation (T. Clement and K.-K. Lau, eds.),Proceedings of LOPSTR’91, Manchester, UK, pp. 205–220, 1991.

  12. de Waal, D. A. and Gallagher, J., “The Applicability of Logic Program Analysis and Transformation to Theorem Proving,” inAutomated Deduction — CADE-12 (A. Bundy, ed.), Springer-Verlag, pp. 207–221, 1994.

  13. Dershowitz, N. and Manna, Z., “Proving Termination with Multiset Orderings,”Communications of the ACM, 22, 8, pp. 465–476, 1979.

    Article  MATH  MathSciNet  Google Scholar 

  14. Doets, K., “Levationis laus,”Journal of Logic and Computation, 3, 5, pp. 487–516, 1993.

    Article  MATH  MathSciNet  Google Scholar 

  15. Drabent W., “What Is Failure? An Apporach to Constructive Negation,”Acta Informatica, 32, pp. 27–59, 1995.

    Article  MATH  MathSciNet  Google Scholar 

  16. Etalle, S. and Gabbrielli, M., “A Transformation System for Modular CLP Programs,” inProceedings of the 12th International Conference on Logic Programming (L. Sterling, ed.), MIT Press, pp. 681–695, 1995.

  17. Gallagher, J., “A System for Specialising Logic Programs,”Technical Report, TR-91-32, University of Bristol, November 1991.

  18. Gallagher, J., “Tutorial on Specialisation of Logic Programs,” inProceedings of PEPM’93, the ACM Sigplan Symposium on Partial Evaluation and Semantics-Based Program Manipulation, ACM Press, pp. 88–98, 1993.

  19. Gallagher, J. and Bruynooghe, M., “Some Low-Level Transformations for Logic Programs,” inProceedings of Meta90 Workshop on Meta Programming in Logic (M. Bruynooghe, ed.), Leuven, Belgium, pp. 229–244, 1990.

  20. Gallagher, J. and Bruynooghe, M., “The Derivation of an Algorithm for Program Specialisation,”New Generation Computing, 9, 3–4, pp. 305–333, 1991.

    Article  Google Scholar 

  21. Gallagher, J. and de Waal, D. A., “Deletion of Redundant Unary Type Predicates from Logic Programs,” inLogic Program Synthesis and Transformation (K.-K. Lau and T. Clement, eds.),Proceedings of LOPSTR’92, Manchester, UK, pp. 151–167, 1992.

  22. Glück, R., Jørgensen, J., Martens, B. and Sørensen, M. H., “Controlling Conjunctive Partial Deduction of Definite Logic Programs,” inProceedings of the International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP’96) LNCS 1140 (H. Kuchen and Swierstra, eds.), Aachen, Germany, September 1996, Springer-Verlag, pp. 152–166, 1996.

  23. Hill, P. and Gallagher, J., “Meta-Programming in Logic Programming,”Technical Report, 94.22, School of Computer Studies, University of Leeds, 1994. To be published inHandbook of Logic in Artificial Intelligence and Logic Programming, Vol. 5, Oxford Science Publications, Oxford University Press.

  24. Jaffar, J. and Maher, M. J., “Constraint Logic Programming: A Survey,”The Journal of Logic Programming, 19–20, pp. 503–581, 1994.

    Article  MathSciNet  Google Scholar 

  25. Jones, N. D., Gomard, C. K., and Sestoft, P.,Partial Evaluation and Automatic Program Generation, Prentice Hall, 1993.

  26. Jørgensen, J., Leuschel, M., and Martens, B. “Conjunctive Partial Deduction in Practice,” inProceedings of the International Workshop on Logic Program Synthesis and Transformation (LOPSTR ’96), LNCS 1207 (J. Gallagher, ed.), Stockholm, Sweden, August 1996, Springer-Verlag, pp. 59–82, 1996. Also in theProceedings of BENELOG’96, extended version asTechnical Report, CW 242, K.U. Leuven.

  27. Ko, H.-P. and Nadel, M. E., “Substitution and Refutation Revisited,” inLogic Programming: Proceedings of the Eighth International Conference (K. Furukawa, ed.), MIT Press, pp. 679–692, 1991.

  28. Komorowksi, J., “A Specification of an Abstract Prolog Machine and Its Application to Partial Evaluation,”Ph.D thesis, Linköping University, Sweden, 1981, Linköping Studies in Science and Technology Dissertations 69.

    Google Scholar 

  29. Komorowski, J., “An Introduction to Partial Deduction,” inProceedings Meta’92, LNCS 649 (A. Pettorossi, ed.), Springer-Verlag, pp. 49–69, 1992.

  30. Kunen, K., “Answer Sets and Negation as Failure,” inProceedings of the 4th International Conference on Logic Programming, (J.-L. Lassez, ed.), MIT Press, pp. 219–228, 1987.

  31. Lam, J. and Kusalik, A., “A Comparative Analysis of Partial Deductors for Pure Prolog”Technical Report, Department of Computational Science, University of Saskatchewan, Canada, May 1990, Revised April 1991.

    Google Scholar 

  32. Lassez, J.-L., Maher, M., and Marriott, K., “Unification Revisited,” inFoundations of Deductive Databases and Logic Programming (J. Minker, ed.), Morgan-Kaufmann pp. 587–625, 1988.

  33. Leuschel, M., “Partial Evaluation of the “Real Thing”,”, inLogic Program Synthesis and Transformation — Meta-Programming in Logic (L. Fribourg and F. Turini, eds.),Proceedings of LOPSTR’94 and META’94, LNCS 883, Pisa, Italy, June 1994. Springer-Verlag, pp. 122–137, 1994.

  34. Leuschel, M., “Ecological Partial Deduction: Preserving Characteristic Trees without Constraints,” inLogic Program Synthesis and Transformation (M. Proietti, ed.),Proceedings of LOPSTR’95, LNCS 1048, Utrecht, Netherlands, September 1995, Springer-Verlag, pp. 1–16, 1995.

  35. Leuschel, M., “Advanced Techniques for Logic Program Specialisation,”Ph.D. thesis, K.U. Leuven, May 1997. Available at http://www.cs.kuleuven.ac.be/∼michael.

  36. Leuschel, M. and De Schreye, D., “An Almost Perfect Abstraction Operation for Partial Deduction,”Technical Report, CW 199, Departement Computerwetenschappen, K.U. Leuven, Belgium, December 1994.

    Google Scholar 

  37. Leuschel, M. and De Schreye, D., “An Almost Perfect Abstraction Operation for Partial Deduction Using Characteristic Trees,”Technical Report, CW 215, Departement Computerwetenschappen, K.U. Leuven, Belgium, October 1995.

    Google Scholar 

  38. Leuschel, M. and De Schreye, D., “Towards Creating Specialised Integrity Checks through Partial Evaluation of Meta-Interpreters,” inProceedings of PEPM’95, the ACM Sigplan Symposium on Partial Evaluation and Semantics-Based Program Manipulation, La Jolla, California, June 1995, ACM Press, pp. 253–263, 1995.

  39. Leuschel, M., De Schreye, D., and de Waal, A., “A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration,” inProceedings of the Joint International Conference and Symposium on Logic Programming JICSLP’96 (M. Maher, ed.), Bonn, Germany, September 1996, MIT Press, pp. 319–332, 1996. Extended version asTechnical Report, CW 225, K.U. Leuven. Available at http://www.cs. kuleuven.ac.be/∼lpai.

  40. Leuschel, M. and Martens, B., “Global Control for Partial Deduction through Characteristic Atoms and Global Trees,” inProceedings of the 1996 Dagstuhl Seminar on Partial Evaluation (O. Danvy, R. Glück, and P. Thiemann, eds.),LNCS 1110, Schloß Dagstuhl, 1996, Springer-Verlag, pp. 263–283, 1996. Extended version as Technical Report, CW 220, K. U. Leuven. Available at http://www.cs.kuleuven.ac.be/∼lpai.

  41. Leuschel, M. and Sørensen, M. H., “Redundant Argument Filtering of Logic Programs,” inProceedings of the International Workshop on Logic Program Synthesis and Transformation (LOPSTR’96), LNCS 1207, (J. Gallagher, ed.), Stockholm, Sweden, August 1996, Springer-Verlag, pp. 83–103, 1996. Extended version asTechnical Report, CW 243, K. U. Leuven.

  42. Lloyd, J. W.,Foundations of Logic Programming, Springer-Verlag, 1987.

  43. Lloyd, J. W. and Shepherdson, J. C., “Partial Evaluation in Logic Programming,”Journal of Logic Programming, 11, 3–4, pp. 217–242, 1991.

    Article  MATH  MathSciNet  Google Scholar 

  44. Maher, M., “A Logic Programming View of CLP,” inProceedings of the 10th International Conference on Logic Programming (D. S. Warren, ed.), MIT Press, pp. 737–753, 1993.

  45. Maluszyński, J. and Näslund, T., “Fail Substitutions for Negation as Failure,” inLogic Programming: Proceedings of the North American Conference, (E. L. Lusk and R. A. Overbeek, eds.), MIT Press, pp. 461–476, 1989.

  46. Martens, B., “On the Semantics of Meta-Programming and the Control of Partial Deduction in Logic Programming,”Ph.D. thesis, K.U. Leuven, February 1994.

  47. Martens, B. and De Schreye, D., “Two Semantics for Definite Meta-Programs, Using the Non-Ground Representation,” inMeta-logics and Logic Programming (K. R. Apt and F. Turini, eds.), MIT Press, pp. 57–82, 1995.

  48. Martens, B. and De Schreye, D., “Why Untyped Non-Ground Meta-Pogramming Is Not (Much of) a Problem,”Journal of Logic Programming, 22, 1, pp. 47–99, 1995.

    Article  MATH  MathSciNet  Google Scholar 

  49. Martens, B. and De Schreye, D., “Automatic Finite Unfolding Using Well-Founded Measures,”Journal of Logic Programming, 28, 2, pp. 89–146, August 1996.

    Article  MATH  MathSciNet  Google Scholar 

  50. Martens, B., De Schreye, D., and Horváth, T., “Sound and Complete Partial Deduction with Unfolding Based on Well-Founded Measures,”Theoretical Computer Science, 122, 1–2, pp. 97–117, 1994.

    Article  MATH  MathSciNet  Google Scholar 

  51. Martens, B. and Gallagher, J., “Ensuring Global Termination of Partial Deduction while Allowing Flexible Polyvariance,” inProceedings ICLP’95 (L. Sterling, ed.), Kanagawa, Japan, June 1995, MIT Press, pp. 597–613, 1995. Extended version asTechnical Report, CSTR-94-16, University of Bristol.

  52. Owen, S., “Issues in the Partial Evaluation of Meta-Interpreters,” inMeta-Programming in Logic Programming, Proceedings of the Meta88 Workshop (H. Abramson and M. Rogers, eds.), June 1988, MIT Press, pp. 319–339, 1989.

  53. Pettorossi, A. and Proietti, M., “Transformation of Logic Programs: Foundations and Techniques,”Journal of Logic Programming, 19–20, pp. 261–320, May 1994.

    Article  MathSciNet  Google Scholar 

  54. Proietti, M. and Pettorossi, A., “The Loop Absorption and the Generalization Strategies for the Development of Logic Programs and Partial Deduction,”Journal of Logic Programming, 16, 1–2, pp. 123–162, May 1993.

    Article  MATH  MathSciNet  Google Scholar 

  55. Przymusinksi, T. C., “On the Declarative and Procedural Semantics of Logic Programs,”Journal of Automated Reasoning, 5, 2, pp. 167–205, 1989.

    MathSciNet  Google Scholar 

  56. Puebla, G. and Hermenegildo, M., “Implementation of Multiple Specialization in Logic Programs,” inProceedings of PEPM’95, the ACM Sigplan Symposium on Partial Evaluation and Semantics-Based Program Manipulation, La Jolla, California, June 1995, ACM Press, pp. 77–87, 1995.

  57. Sahlin, D., “An Automatic Partial Evaluator for Full Prolog,”Ph.D. thesis, Swedish Institute of Computer Science, March 1991.

  58. Sahlin, D., “Mixtus: An Automatic Partial Evaluator for Full Prolog,”New Generation Computing, 12, 1, pp. 7–51, 1993.

    Article  MATH  Google Scholar 

  59. Shepherdson, J. C., “Language and Equality Theory in Logic Programming,”Technical Report, PM-91-02, University of Bristol, 1991.

  60. Smith, D. A., “Constraint Operations for CLP (FT),” inLogic Programming: Proceedings of the Eighth International Conference (K. Furukawa, ed.), MIT Press, pp. 760–774, 1991.

  61. Smith, D. A., “Partial Evaluation of Pattern Matching in Constraint Logic Programming Languages,” inACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, ACM Press Sigplan Notices 26, 9 (N. D. Jones and P. Hudak, eds.), pp. 62–71, 1991.

  62. Smith, D. A. and Hickey, T., “Partial Evaluation of a CLP Language,” inProceedings of the North American Conference on Logic Programming (S. Debray and M. Hermenegildo, eds.), MIT Press, pp. 119–138, 1990.

  63. Sørensen, M. H. and Glück, R., “An Algorithm of Generalization in Positive Supercompilation,” inProceedings of ILPS’95 (J. W. Lloyd, ed.), the International Logic Programming Symposium, Portland, USA, December 1995, MIT Press, pp. 465–479, 1995.

  64. Sterling, L. and Beer, R. D., “Metainterpreters for Expert System Construction,”Journal of Logic Programming, 6, 1–2, pp. 163–178, 1989.

    Article  Google Scholar 

  65. Stuckey, P. J., “Constructive Negation for Constraint Logic Programming,” inProceedings of Sixth Annual IEEE Symposium on Logic in Computer Science, Amesterdam, Netherlands, July 1991, IEEE Computer Society Press, pp. 328–339, 1991.

  66. Stuckey, P. J., “Negation and Constraint Logic Programming,”Information and Computation, 118, 1, pp. 12–33, April 1995.

    Article  MATH  MathSciNet  Google Scholar 

  67. Turchin, V. F., “The Concept of a Supercompiler,”ACM Transactions on Programming Languages and Systems, 8, 3, pp. 292–325, 1986.

    Article  MATH  MathSciNet  Google Scholar 

  68. Turchin, V. F., “Program Transformation with Metasystem Transitions,”Journal of Functional Programming, 3, 3, pp. 283–313, 1993.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

Michael Leuschel, Ph.D.: He currently works as a postdoctoral researcher at the Department of Computer Science of the Katholieke Universiteit Leuven. His present research focuses on program transformation and specialisation for declarative programming languages. Other research interests include abstract interpretation, optimised integrity checking and meta-programming. He received his degree (“Licence”) in Computer Science from the Université Libre de Bruxelles in 1990 and a Master of Artificial Intelligence from the Katholieke Universiteit Leuven in 1993, where he also received his Ph.D in 1997.

Danny De Schreye, Ph.D: He is a professor at the Department of Computer Science of the Katholieke Universiteit Leuven and a senior research associate of the Belgian National Fund for Scientific Research. He obtained his Ph.D from K.U. Leuven in 1983, on the topic of operator algebras. His research interests are in the field of Logic Programming, and include program transformation and termination, knowledge representation and reasoning, and constraint programming.

About this article

Cite this article

Leuschel, M., de Schreye, D. Constrained partial deduction and the preservation of characteristic trees. New Gener Comput 16, 283–342 (1998). https://doi.org/10.1007/BF03037483

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation