Skip to main content

Conjunctive partial deduction in practice

  • Conference paper
  • First Online:
Logic Program Synthesis and Transformation (LOPSTR 1996)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1207))

Abstract

Recently, partial deduction of logic programs has been extended to conceptually embed folding. To this end, partial deductions are no longer computed of single atoms, but rather of entire conjunctions; Hence the term “conjunctive partial deduction”.

Conjunctive partial deduction aims at achieving unfold/fold-like program transformations such as tupling and deforestation within fully automated partial deduction. However, its merits greatly surpass that limited context: Also other major efficiency gains can be obtained through considerably improved side-ways information propagation.

In this paper, we present a first investigation of conjunctive partial deduction in practice. We describe the concrete options used in the implementation(s), look at abstraction in a practical Prolog context, include and discuss an extensive set of benchmark results. ¿ From these, we can conclude that conjunctive partial deduction can indeed pay off in practice, beating its conventional precursor on a number of small to medium size programs. However, controlling it in a perfect way proves far from obvious, and a range of challenging open problems remain as topics for further research.

Partially supported by the HCM Network “Logic Program Synthesis and Transformation”, and partially by the Belgian GOA “Non-Standard Applications of Abstract Interpretation”.

Supported by the Belgian GOA “Non-Standard Applications of Abstract Interpretation”

Partially supported as a postdoctoral fellow by the K.U.Leuven Research Council, Belgium, and partially by the HCM Network “Logic Program Synthesis and Transformation”, contract nr. CHRX-CT-93-00414, University of Padova, Italy.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. K. Benkerimi and P. M. Hill. Supporting transformations for the partial evaluation of logic programs. Journal of Logic and Computation, 3(5):469–486, 1993.

    Google Scholar 

  2. R. Bol. Loop checking in partial deduction. Journal of Logic Programming, 16:25–46, 1993.

    Google Scholar 

  3. A. Bossi and N. Cocco. Preserving Universal Termination through Unfold/Fold. In G. Levi and M. Rodriguez-Artalejo, editors, Proc. 4th International Conference on Algebraic and Logic Programming, Lecture Notes in Computer Science 850, pages 269–286, Madrid, Spain, 1994. Springer-Verlag.

    Google Scholar 

  4. A. Bossi and N. Cocco. Replacement can Preserve Termination. In this Volume.

    Google Scholar 

  5. A. Bossi, N. Cocco and S. Etalle. Transformation of Left Terminating Programs: The Reordering Problem. In M. Proietti, editor, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'95, Lecture Notes in Computer Science 1048, pages 33–45, Utrecht, Netherlands, September 1995. Springer-Verlag.

    Google Scholar 

  6. A. Bossi and S. Etalle. Transforming Acyclic Programs. Transactions on Programming Languages and Systems, 16(4:1081–1096, 1994.

    Google Scholar 

  7. M. Bruynooghe, D. De Schreye, and B. Martens. A general criterion for avoiding infinite unfolding during partial deduction. New Generation Computing, 11(1):47–79, 1992.

    Google Scholar 

  8. R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, 1977.

    Article  Google Scholar 

  9. D. De Schreye, M. Leuschel, and B. Martens. Program specialisation for logic programs. Tutorial. Abstract in J. Lloyd, editor, Proceedings ILPS'95, pages 615–616, Portland, Oregon, December 1995, MIT Press.

    Google Scholar 

  10. D. A. de Waal and J. Gallagher. Specialisation of a Unification Algorithm. In K.-K. Lau and T. Clement, editors, Proceedings of LOPSTR'91, pages 205–220, Springer-Verlag, 1993.

    Google Scholar 

  11. D. A. de Waal and J. Gallagher. The applicability of logic program analysis and transformation to theorem proving. In A. Bundy, editor, Proceedings CADE-12, pages 207–221, Nancy, France, June/July 1994. Springer-Verlag, LNAI 814.

    Google Scholar 

  12. S. Debray and N.-W. Lin. Cost analysis of logic programs. ACM Transactions on Programming Languages and Systems, 15(5):826–875, November 1993.

    Article  Google Scholar 

  13. S. Debray, P. López García, M. Hermenegildo, and N.-W. Lin. Estimating the computational cost of logic programs. In B. Le Charlier, editor, SAS'94, LNCS 864, pages 255–265, Namur, Belgium, September 1994. Springer-Verlag.

    Google Scholar 

  14. J. Gallagher and M. Bruynooghe. Some low-level source transformations for logic programs. In M. Bruynooghe, editor, Meta'90, pages 229–244, Leuven, April 1990.

    Google Scholar 

  15. J. Gallagher and M. Bruynooghe. The derivation of an algorithm for program specialisation. New Generation Computing, 9(3 & 4):305–333, 1991.

    Google Scholar 

  16. J. Gallagher. A system for specialising logic programs. Technical Report TR-91-32, University of Bristol, November 1991.

    Google Scholar 

  17. J. Gallagher. Tutorial on specialisation of logic programs. In Proceedings PEPM'93, pages 88–98. ACM Press, 1993.

    Google Scholar 

  18. R. Glück, J. Jørgensen, B. Martens, and M.H. Sørensen. Controlling conjunctive partial deduction of definite logic programs. In H. Kuchen and S.D. Swierstra, editors, Proceedings of the International Symposium on Programming Languages: Implementations, Logics and Programs (PLILP'96), LNCS 1140, pages 152–166, Aachen, Germany, September 1996. Extended version as Technical Report CW 226, K.U. Leuven. Accessible via http://www.cs.kuleuven.ac.be/∼lpai.

    Google Scholar 

  19. T. Horváth. Experiments in partial deduction. Master's thesis, Departement Computerwetenschappen, K.U.Leuven, Leuven, Belgium, July 1993.

    Google Scholar 

  20. J. Lam and A. Kusalik. 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 

  21. M. Leuschel. Ecological partial deduction: Preserving characteristic trees without constraints. In M. Proietti, editor, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'95, Lecture Notes in Computer Science 1048, pages 1–16, Utrecht, Netherlands, September 1995. Springer-Verlag.

    Google Scholar 

  22. M. Leuschel. The ECCE partial deduction system and the DPPD library of benchmarks. Accessible via http://www.cs.kuleuven.ac.be/∼lpai.

    Google Scholar 

  23. M. Leuschel and D. De Schreye. An almost perfect abstraction operation for partial deduction using characteristic trees. Technical Report CW 215, Departement Computerwetenschappen, K.U. Leuven, Belgium, October 1995. Submitted for Publication. Accessible via http://www.cs.kuleuven.ac.be/lpai.

    Google Scholar 

  24. M. Leuschel, D. De Schreye, and A. de Waal. A conceptual embedding of folding into partial deduction: Towards a maximal integration. In Michael Maher, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming JICSLP'96, pages 319–332, Bonn, Germany, September 1996. MIT Press. Extended version as Technical Report CW 225, K.U. Leuven. Accessible via http://www.cs.kuleuven.ac.be/lpai.

    Google Scholar 

  25. M. Leuschel and D. De Schreye. Logic program specialisation: How to be more specific. In H. Kuchen and S.D. Swierstra, editors, Proceedings of the International Symposium on Programming Languages: Implementations, Logics and Programs (PLILP'96), LNCS 1140, pages 137–151, Aachen, Germany, September 1996. Extended version as Technical Report CW 232, K.U. Leuven. Accessible via http://www.cs.kuleuven.ac.be/lpai.

    Google Scholar 

  26. M. Leuschel and B. Martens. Global control for partial deduction through characteristic atoms and global trees. In Olivier Danvy, Robert Glück, and Peter Thiemann, editors, Proceedings of the 1996 Dagstuhl Seminar on Partial Evaluation, LNCS 1110, pages 263–283, Schloß Dagstuhl, 1996. Extended version as Technical Report CW 220, K.U. Leuven. Accessible via http://www.cs.kuleuven.ac.be/lpai.

    Google Scholar 

  27. M. Leuschel and M.H. Sørensen. Redundant argument filtering of logic programs. In this Volume

    Google Scholar 

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

    Google Scholar 

  29. J. W. Lloyd and J. C. Shepherdson. Partial evaluation in logic programming. The Journal of Logic Programming, 11:217–242, 1991.

    Google Scholar 

  30. B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28:89–146, 1996. Extended version as Technical Report CW180, Departement Computerwetenschappen, K.U.Leuven, October 1993, accessible via http://www.cs.kuleuven.ac.be/lpai.

    Google Scholar 

  31. B. Martens and J. Gallagher. Ensuring global termination of partial deduction while allowing flexible polyvariance. In L. Sterling, editor, Proceedings ICLP'95, pages 597–613, Kanagawa, Japan, June 1995. MIT Press. Extended version as Technical Report CSTR-94-16, University of Bristol.

    Google Scholar 

  32. A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. Journal of Logic Programming, 19 & 20:261–320, 1994.

    Google Scholar 

  33. D. L. Poole and R. Goebel. Gracefully adding negation and disjunction to Prolog. In E. Shapiro, editor, Proceedings ICLP'86, pages 635–641, London, U.K., July 1986. Springer-Verlag, LNCS 225.

    Google Scholar 

  34. S. Prestwich. The PADDY partial deduction system. Technical Report ECRC-92-6, ECRC, Munich, Germany, 1992.

    Google Scholar 

  35. M. Proietti and A. Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Proceedings PLILP'91, pages 347–358. Springer-Verlag, LNCS 528, 1991.

    Google Scholar 

  36. M. Proietti and A. Pettorossi. The loop absorption and the generalization strategies for the development of logic programs and partial deduction. Journal of Logic Programming, 16:123–161, 1993.

    Google Scholar 

  37. M. Proietti and A. Pettorossi. Completeness of some transformation strategies for avoiding unnecessary logical variables. In P. Van Hentenryck, editor, Proceedings ICLP'94, pages 714–729, Italy, June 1994. MIT Press.

    Google Scholar 

  38. D. Sahlin. Mixtus: An automatic partial evaluator for full Prolog. New Generation Computing, 12(1):7–51, 1993.

    Google Scholar 

  39. Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury: An efficient purely declarative logic programming language. The Journal of Logic Programming, 1996. To Appear.

    Google Scholar 

  40. M.H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In J. Lloyd, editor, Proceedings ILPS'95, pages 465–479, Portland, Oregon, December 1995, MIT Press.

    Google Scholar 

  41. H. Tamaki and T. Sato. Unfold/fold transformation of logic programs. In S-Å. Tärnlund, editor, Proceedings ICLP'84, pages 127–138, Uppsala, July 1984.

    Google Scholar 

  42. V.F. Turchin. The concept of a supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, 1986.

    Article  Google Scholar 

  43. V.F. Turchin. The algorithm of generalization in the supercompiler. In D. Bjørner, A.P. Ershov and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 531–549. North-Holland, 1988.

    Google Scholar 

  44. P.L. Wadler. Deforestation: Transforming programs to eliminate intermediate trees. Theoretical Computer Science, 73:231–248, 1990.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

John Gallagher

Rights and permissions

Reprints and permissions

Copyright information

© 1997 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Jørgensen, J., Leuschel, M., Martens, B. (1997). Conjunctive partial deduction in practice. In: Gallagher, J. (eds) Logic Program Synthesis and Transformation. LOPSTR 1996. Lecture Notes in Computer Science, vol 1207. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-62718-9_5

Download citation

  • DOI: https://doi.org/10.1007/3-540-62718-9_5

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-62718-0

  • Online ISBN: 978-3-540-68494-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics