Skip to main content
Log in

Towards efficient partial evaluation in logic programming

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

Abstract

Partial evaluation is a symbolic manipulation technique used to produce efficient algorithms when part of the input to the algorithm is known. Other applications of partial evaluators such as universal compilation and compiler generation are also known to be possible. A partial evaluator receives as input a program and partially known input to that program, and outputs a residual program which should run at least as efficient as the input program with restricted input.

In this paper we study the case where both the input and residual programs are logic programs, being the partial evaluator itself a logic program. Up to now, partial evaluators have failed to process large “non=toy” examples. Here we present extensions to partial evaluators whic will allow us to produce more efficient residual programs using less computing resources, during partial evaluation.

First, the introduced extensions allow the processing of large examples, which is not possible with the previous techniques. This is now possible since the extensions use less CPU time and memory consumption during the partial evaluation process. Second, the extended partial evaluator produces smaller residual programs, producing important CPU time optimizing effects. With the standard techniques, a partial evaluator will most probably act as a pessimizer, not as an optimizer. Examples are given.

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. Abrahams, P., “Compiler Pessimization,”Datamation, 17, 7, pp. 32–33, 1971.

    Google Scholar 

  2. Abramsky S. and Hankin, C. (eds.),Abstract Interpretation of Declarative Languages, Wiley, 1987.

  3. Bulyonkov, M. A., “From Partial Evaluation to Mixed Computation,”Theoretical Computer Science, 90, Elsevier, pp. 47–60, 1991.

    Article  MATH  Google Scholar 

  4. Chan, D. and Wallace, M., “A Treatment of Negation During Partial Evaluation,” inMeta-Programming in Logic Programming (H. Abramson and M. Rogers, eds.), MIT Press, London, chapter 16, 1989.

    Google Scholar 

  5. Ershov, A. P., “On the Essence of Compliation,” inFormal Description of Programming Concepts (E. J. Neuhold, ed.), North-Holland, pp. 391–418, 1978.

  6. Fuller, D. and Abramsky, S., “Mixed Computations of Prolog Programs,”New Generation Computing, 6, Ohmsha/Springer-Verlag, Tokyo, 1988.

    Google Scholar 

  7. Fuller, D., “Partial Evaluation and Mix Computation in Logic Programming,”Ph.D thesis, Department of Computing, Imperial College of Science and Technology, London, U.K., 1989.

    Google Scholar 

  8. Fuller, D., “Replacing the Loop Detection Scheme in Partial Evaluation of Logic Programs,” inTechnical Report CS-93/14, Computer Science Dept., Pontificia Universidad Católica de Chile, 1993.

  9. Fuller, D. and Bocic S., “Extending Partial Evaluation in Logic Programming,” inComputer Science: Research and Applications (R. Baeza-Yates and U. Manber, eds.), Plenum Press, NY, pp. 95–107, 1992.

    Google Scholar 

  10. Futamura, Y., “Partial Evaluation of Computation Process—An Approach to a Compiler-Compiler,”Systems, Computers, Control, 2, 5, pp. 41–67, 1971.

    Google Scholar 

  11. Hoppe, U., “An Analysis of EBG and Its Relation to Partial Evaluation: Lessons Learned,”Technical Report, No. 572, GMD-IPSI, Darmstadt, Germany, 1991.

    Google Scholar 

  12. Jones, N., Sestoft, P., and Søndergaard, H., “An Experiment in Partial Evaluation: The Generation of a Compiler Generator,” inRewriting Techniques and Applications (J. P. Jouannaud, ed.),Lecture Notes in Computer Science, No. 202, Springer-Verlag, pp. 124–140, 1985.

  13. Jones, N. D., “Static Semantics, Types, and Binding Time Analysis,”Theoretical Computer Science, 90, Elsevier, pp. 95–118, 1991.

    Article  MATH  Google Scholar 

  14. Jones, N. D., Sestoft, P., and Søndergaard, H., “MIX: A Self-Applicable Partial Evaluator for Experiments in Compiler Generator,”J. LISP Symbolic Computation, 1992.

  15. Levi, G. and Sardu, G., “Partial Evaluation of Metaprograms in a “Multiple Words” Logic Language,”New Generation Computing, 6, Springer-Verlag, Tokyo, 1988.

    Google Scholar 

  16. Lloyd, J. W. and Shepherdson, J. C., “Partial Evaluation in Logic Programming,”Technical Report, Department of Computing and Mathematics, University of Bristol, U.K., 1991.

    Google Scholar 

  17. Mellish, C., “Abstract Interpretation of PROLOG Programs,” in 2) Abramsky, S. and Hankin, C. (eds.),Abstract Interpretation of Declarative Languages, Wiley, pp. 181–198, 1987.

  18. Mendelzon, A., “Logic and Databases,”VIII Conference of the Chilean Computer Science Society, Santiago, 1988.

  19. Mitchell, T. M., Keller R. M., and Kedar-Cabelli, S. T., “Explanation-Based Generalization: A Unifying View,” inMachine Learning, Vol I, 1986.

  20. Sterling, L. and Beer, R., “Incremental Flavor-Mixing of Meta-Interpreters for Expert System Construction,”Technical Report, TR 103-86, Center for Automation and Intelligent Systems Research, Case Western Reserve University, 1986.

  21. Pottosin, I. V., “Analysis of Program Optimization Possibilities and Further Development,”Theoretical Computer Science, 90, Elsevier, pp. 17–36, 1991.

    Article  MATH  Google Scholar 

  22. Takeuchi, A. and Furukawa, K., “Partial Evaluation of PROLOG Programs and Its Application to Meta-Programming,”Information Processing 86 (H. Kugler, ed.),Proc. IFIP 86 Conference, North-Holland, 1986.

  23. van Harmelen, F. and Bundy, A., “Explanation-Based Generalization=Partial Evaluation,”Artificial Intelligence, 36, pp. 401–412, 1988.

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

David A. Fuller, Ph.D.: He received the B.S. degree in Electrical Engineering from the Pontificia Universidad Católica de Chile in 1982, the M.S. degree in Computer Science from the University of California at Los Angeles in 1984, and the Ph.D. degree in Computer Science from Imperial College of Science and Technology in 1989. He worked as a research assistant at Imperial College in the HOPE project. Currently he is an Assistant Professor of Computer Science at the Pontificia Universidad Católica de Chile where he directs a Research Lab. on Computer Supported Cooperative Work. His research interests include symbolic computation and intelligent cooperative systems.

Sacha Bocic, M.S.: He received the B.S. and the M.S. degree in Computer Science from the Pontificia Universidad Católica de Chile in 1991 and 1992, resp. He is currently a Manager of the Core Technology Group at Oracle Chile. His current interests include symbolic computation, distributed data base systems and multimedia.

Leopoldo E. Bertossi, Dr.: He received a Doctor in Exact Sciences (Mathematics) degree from the Pontificia Universidad Católica de Chile in 1988. He received a DAAD Scholarship (University of Freiburg, Abteilung fuer mathematische Logic und Grundlagen der Mathematik, Germany), and has been visiting Assistant Professor at the Department of Computer Science, University of Toronto, and the Department of Electrical Engineering and Computer Science of the University of Wisconsin-Milwaukee. Since 1992 he is an Associate Professor at the Pontificia Universidad Católica de Chile. His current research interests are knowledge representation, deductive databases, logic programming and foundations of probability and statistics.

About this article

Cite this article

Fuller, D.A., Bocic, S.A. & Berstossi, L.E. Towards efficient partial evaluation in logic programming. New Gener Comput 14, 237–259 (1996). https://doi.org/10.1007/BF03037500

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation