Advertisement

Redundant argument filtering of logic programs

  • Michael Leuschel
  • Morten Heine Sørensen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1207)

Abstract

This paper is concerned with the problem of removing redundant arguments from logic programs. Such arguments can be removed without affecting correctness, in a certain sense. Most program specialisation techniques, even though they filter arguments and remove clauses, fail to remove a substantial number of redundant arguments, yielding in some cases rather inefficient residual programs. We formalise the notion of a redundant argument and show that one cannot effectively remove all redundant arguments. We then give a safe, effective approximation of the notion of a redundant argument and describe several simple and efficient algorithms based on the approximative notion. We conduct extensive experiments with our algorithms on mechanically generated programs illustrating the practical benefits of our approach.

Keywords

Logic Program Logic Programming Partial Evaluation Predicate Symbol Code Size 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    A. Aho, R. Sethi, and J.D. Ullman. Compilers: Principles, Techniques, and Design. Addison-Wesley, 1986.Google Scholar
  2. 2.
    K. Benkerimi and P. M. Hill. Supporting transformations for the partial evaluation of logic programs. Journal of Logic and Computation, 3(5):469–486, October 1993.Google Scholar
  3. 3.
    W.-N. Chin. Automatic Methods for Program Transformation. PhD thesis, Imperial College, University of London, 1990.Google Scholar
  4. 4.
    B. Demoen. On the transformation of a Prolog program to a more efficient binary program. In K.-K. Lau and T.P. Clement, editors, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'92, pages 242–252. Springer Verlag.Google Scholar
  5. 5.
    D.A. de Waal. Analysis and Transformation of Proof Procedures. PhD Thesis, Department of Computer Science, University of Bristol, 1992.Google Scholar
  6. 6.
    D.A. de Waal and J. Gallagher. The applicability of logic program analysis and transformation to Theorem Proving. In A. Bundy, editor, Automated Deduction — CADE-12, pages 207–221, 1994. Springer Verlag.Google Scholar
  7. 7.
    J. Gallagher. Tutorial on specialisation of logic programs. In Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 88-98. ACM Press, 1993.Google Scholar
  8. 8.
    J. Gallagher and M. Bruynooghe. Some low-level transformations for logic programs. In M. Bruynooghe, editor, Proceedings of Meta90 Workshop on Meta Programming in Logic, pages 229–244, Leuven, Belgium, 1990.Google Scholar
  9. 9.
    J. Gallagher and D.A. de Waal. Deletion of redundant unary type predicates from logic programs. In K.-K. Lau and T.P. Clement, editors, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'92, pages 151–167. Springer Verlag.Google Scholar
  10. 10.
    R. Glück and M.H. Sørensen. Partial deduction and driving are equivalent. In M. Hermenegildo and J. Penjam, editors, Programming Language Implementation and Logic Programming. Proceedings, Lecture Notes in Computer Science 844, pages 165–181, Madrid, Spain, 1994. Springer-Verlag.Google Scholar
  11. 11.
    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, Programming Language Implementation and Logic Programming. Proceedings, Lecture Notes in Computer Science 1140, pages 152–166, Aachen, Germany, 1996. Springer-Verlag.Google Scholar
  12. 12.
    J. Hughes. Backwards analysis of functional programs. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 187–208, Amsterdam, 1988. North-Holland.Google Scholar
  13. 13.
    J. Jørgensen, M. Leuschel and B. Martens. Conjunctive partial deduction in practice. In J. Gallagher, editor, Pre-Proceedings of LOPSTR'96, pages 46–62, Stockholm, Sweden, August 1996. Extended version as Technical Report CW 242, Katholieke Universiteit Leuven, 1996.Google Scholar
  14. 14.
    J. Komorowski. Partial evaluation as a means for inferencing data structures in an applicative language: A theory and implementation in the case of Prolog. In 9th ACM Symposium on Principles of Programming Languages, pages 255–167. ACM Press, 1982.Google Scholar
  15. 15.
    M. Leuschel. Ecological partial deduction: Preserving characteristic trees without constraints. In M. Proietti, editor, Proceedings of LOPSTR'95, Lecture Notes in Computer Science 1048, pages 1–16, 1996. Springer-Verlag.Google Scholar
  16. 16.
    M. Leuschel and B. Martens. Global control for partial deduction through characteristic atoms and global trees. In O. Danvy, R. Glück, and P. Thiemann, editors, Proceedings Dagstuhl Seminar on Partial Evaluation, Lecture Notes in Computer Science 1110, pages 263–283, Schloss Dagstuhl, Germany, February 1996. Springer-Verlag.Google Scholar
  17. 17.
    M. Leuschel, D. De Schreye, and A. de Waal. A Conceptual Embedding of Folding into Partial Deduction: Towards a Maximal Integration. In M. Maher, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, JICSLP'96, pages 319–332, Bonn, Germany, September 1996. MIT Press.Google Scholar
  18. 18.
    M. Leuschel. The ECCE partial deduction system and the DPPD library of benchmarks. Accessible via http: //www.cs.kuleuven.ac.be/∼lpai.Google Scholar
  19. 19.
    J.W. Lloyd. Foundations of Logic Programming, North-Holland, New York, 1987.Google Scholar
  20. 20.
    J.W. Lloyd and J.C. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11(3–4):217–242, 1991.Google Scholar
  21. 21.
    J.W. Lloyd, editor. Logic Programming: Proceedings of the 1995 International Symposium. MIT Press, 1995.Google Scholar
  22. 22.
    K. Marriott, L. Naish, and J.-L. Lassez. Most specific logic programs. In Proceedings of the Joint International Conference and Symposium on Logic Programming, Seattle, 1988. IEEE, MIT Press.Google Scholar
  23. 23.
    B. Martens. On the Semantics of Meta-Programming and the Control of Partial Deduction in Logic programming. PhD thesis, Katholieke Universiteit Leuven, 1994.Google Scholar
  24. 24.
    B. Martens and J. Gallagher. Ensuring global termination of partial deduction while allowing flexible polyvariance. In L. Sterling, editor, Proceedings ICLP'95, pages 597–611, Shonan Village Center, Kanagawa, Japan, June 1995. MIT Press.Google Scholar
  25. 25.
    A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. Journal of Logic Programming, 19 & 20:261–320, 1994.Google Scholar
  26. 26.
    M. Proietti and A. Pettorossi. Unfolding — definition — folding, in this order for avoiding unnecessary variables in logic programs. In Programming Language Implementation and Logic Programming, Lecture Notes in Computer Science 528, pages 347–358. Springer-Verlag, 1991.Google Scholar
  27. 27.
    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
  28. 28.
    T. Reps. Program specialization via program slicing. In O. Danvy, R. Glück, and P. Thiemann, editors, Proceedings Dagstuhl Seminar on Partial Evaluation, pages 409–429, Schloss Dagstuhl, Germany, 1996. Springer-Verlag.Google Scholar
  29. 29.
    S. Schoenig and M. Ducassé. A hybrid backward slicing algorithm producing executable slices for Prolog. In Proceedings of the 7th Workshop on Logic Programming Environments, pages 41–48, Portland, USA, December 1995.Google Scholar
  30. 30.
    H. Seidl. Parameter-reduction of higher-level grammars. Theoretical Computer Science, 55:47–85, 1987.Google Scholar
  31. 31.
    M.H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In [21], pages 465–479.Google Scholar
  32. 32.
    M.H. Sørensen, R. Glück, and N.D. Jones. Towards unifying deforestation, supercompilation, partial evaluation, and generalized partial computation. In D. Sannella, editor, Programming Languages and Systems, Lecture Notes in Computer Science 788, pages 485–500. Springer-Verlag, 1994.Google Scholar
  33. 33.
    F. Tip. A survey of program slicing techniques. Journal of Programming Languages 3:121–181, 1995.Google Scholar
  34. 34.
    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
  35. 35.
    P.L. Wadler. Deforestation: Transforming programs to eliminate intermediate trees. Theoretical Computer Science, 73:231–248, 1990. Preliminary version in ESOP'88, LNCS vol. 300.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Michael Leuschel
    • 1
  • Morten Heine Sørensen
    • 2
  1. 1.Department of Computer ScienceKatholieke Universiteit LeuvenHeverleeBelgium
  2. 2.Department of Computer ScienceUniversity of CopenhagenCopenhagenDenmark

Personalised recommendations