Partial evaluation of the “real thing”

  • Michael Leuschel
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 883)


In this paper we present a partial evaluation scheme for a “real life” subset of Prolog. This subset contains first-order built-in's, simple side-effects and the operational predicate if-then-else. We outline a denotational semantics for this subset of Prolog and show how partial deduction can be extended to specialise programs of this kind. We point out some of the problems not occurring in partial deduction and show how they can be solved in our setting. Finally we provide some results based on an implementation of the above.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    R. Barbuti, M. Codish, R. Giacobazzi, and M. Maher. Oracle semantics for Prolog. In H. Kirchner and G. Levi, editors, Proceedings of the Third International Conference on Algebraic and Logic Programming, Lecture Notes in Computer Science 632, pages 100–114. Springer Verlag, 1992.Google Scholar
  2. 2.
    M. Baudinet. Proving termination of Prolog programs: A semantic approach. The Journal of Logic Programming, 14(1 & 2):1–29, 1992.Google Scholar
  3. 3.
    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
  4. 4.
    D. Chan and M. Wallace. A treatment of negation during partial evaluation. In H. Abramson and M. Rogers, editors, Meta-Programming in Logic Programming, Proceedings of the Meta88 Workshop, June 1988, pages 299–318. MIT Press, 1989.Google Scholar
  5. 5.
    H. Fujita. An algorithm for partial evaluation with constraints. Technical Memorandum TM-0367, ICOT, 1987.Google Scholar
  6. 6.
    H. Fujita and K. Furukawa. A self-applicable partial evaluator and its use in incremental compilation. New Generation Computing, 6(2 & 3):91–118, 1988.Google Scholar
  7. 7.
    J. Gallagher. Tutorial on specialisation of logic programs. In Proceedings of PEPM'93, the ACM Sigplan 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.
    C. A. Gurr. A Self-Applicable Partial Evaluator for the Logic Programming Language Gdel. PhD thesis, Department of Computer Science, University of Bristol, January 1994.Google Scholar
  10. 10.
    J. Komorowksi. A Specification of an Abstract Prolog Machine and its Application to Partial Evaluation. PhD thesis, Linköping University, Sweden, 1981. Linköping Studies in Science and Technology Dissertations 69.Google Scholar
  11. 11.
    M. Leuschel. Self-applicable partial evaluation in Prolog. Master's thesis, K.U. Leuven, 1993.Google Scholar
  12. 12.
    J. W. Lloyd and J. C. Shepherdson. Partial evaluation in logic programming. The Journal of Logic Programming, 11:217–242, 1991.Google Scholar
  13. 13.
    T. Mogensen and A. Bondorf. Logimix: A self-applicable partial evaluator for Prolog. In K.-K. Lau and T. Clement, editors, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'92, pages 214–227. Springer-Verlag, 1992.Google Scholar
  14. 14.
    R. O'Keefe. On the treatment of cuts in Prolog source-level tools. In Proceedings of the Symposium on Logic Programming, pages 68–72. IEEE, 1985.Google Scholar
  15. 15.
    S. D. Prestwich. The PADDY partial deduction system. Technical Report ECRC-92-6, ECRC, Munich, Germany, 1992.Google Scholar
  16. 16.
    S. D. Prestwich. An unfold rule for full Prolog. In K.-K. Lau and T. Clement, editors, Logic Program Synthesis and Transformation. Proceedings of LOPSTR'92, Workshops in Computing, University of Manchester, 1992. Springer-Verlag.Google Scholar
  17. 17.
    M. Proietti and A. Pettorossi. Semantics preserving transformation rules for Prolog. In Proceedings of the ACM Symposium on Partial Evaluation and Semantics based Program Manipulation, PEPM'91, Sigplan Notices, Vol. 26, N. 9, pages 274–284, Yale University, New Haven, U.S.A., 1991.Google Scholar
  18. 18.
    D. Sahlin. An Automatic Partial Evaluator for Full Prolog. PhD thesis, Swedish Institute of Computer Science, Mar. 1991.Google Scholar
  19. 19.
    D. Sahlin. Mixtus: An automatic partial evaluator for full Prolog. New Generation Computing, 12(1):7–51, 1993.Google Scholar
  20. 20.
    D. A. Smith. Partial evaluation of pattern matching in constraint logic programming languages. In N. D. Jones and P. Hudak, editors, ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 62–71. ACM Press Sigplan Notices 26(9), 1991.Google Scholar
  21. 21.
    A. Takeuchi and K. Furukawa. Partial evaluation of Prolog programs and its application to meta programming. In H.-J. Kugler, editor, Information Processing 86, pages 415–420, 1986.Google Scholar
  22. 22.
    H. Tamaki and T. Sato. Unfold/fold transformations of logic programs. In S.-å. TÄrnlund, editor, Proceedings of the Second International Conference on Logic Programming, pages 127–138, Uppsala, Sweden, 1984.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Michael Leuschel
    • 1
  1. 1.Department of Computer ScienceK.U. LeuvenHeverleeBelgium

Personalised recommendations