Skip to main content
Log in

The derivation of an algorithm for program specialisation

  • Special Issue
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

In this paper we develop an algorithm, based on abstract interpretation, for source specialisation of logic programs. This approach is more general than partial evaluation, another technique for source specialisation, and can perform some source specialisations that cannot be done by partial evaluation; examples are specialisations that use information from infinite computations. Our algorithm for program specialisation usesminimal function graphs as a basis. Previous work on minimal function graphs is extended by describing a scheme for constructing a minimal function graph for a simple functional language, and then using that to define a minimal function graph constructor for Prolog. We show how to compute a more precise approximation to the minimal function graph than was obtained in previous work. The efficient computation of minimal function graphs is also discussed. An abstract interpretation based on unfolding paths is then developed for Prolog program specialisation.

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. Abramsky, S. and Hankin, C., eds.:Abstract Interpretation of Declarative Languages, Ellis Horwood, 1987.

  2. Benkerimi, K. and Lloyd, J. W., “A Procedure for Partial Evaluation of Logic Programs,”Proceedings of the North American Conference on Logic Programming, November 1990, Austin, Texas (S. Debray and M. Hermenegildo, eds.), MIT Press, 1990.

  3. Bruynooghe, M., “A Practical Framework for the Abstract Interpretation of Logic Programs,” to appear inJournal of Logic Programming.

  4. Codish, M., Gallagher, J. and Shapiro, E., “Using Safe Approximations of Fixed Points for Analysis of Logic Programs,” inMeta-Programming in Logic Programming (H. Abramson and M. Rogers, eds.), MIT Press, 1989.

  5. Gallagher, J. and Codish, M. and Shapiro, E., “Specialisation of Prolog and FCP Programs Using Abstract Interpretation,”New Generation Computing, 6, pp. 159–186, 1988.

    Article  MATH  Google Scholar 

  6. Gallagher, J. and Bruynooghe, M., “Some Low-Level Source Transformations for Logic Programs,”Proceedings of Meta 90 Workshop on Meta Programming in Logic, Leuven, Belgium, April 1990.

  7. Jones, N. D. and Søndergaard, H., “A Semantics-Based Framework for the Abstract Interpretation of Prolog,”Interpretation of Declarative Language Abstruct (S. Abramsky and C. Hankin, eds.), Ellis Horwood, 1987.

  8. Jones, N. D. and Mycroft, A., “Dataflow Analysis of Applicative Programs Using Minimal Function Graphs,”Proceedings of Principles of Programming Languages, 1986.

  9. Komorowski, H. J., “Partial Evaluation as a Means for Inferencing Data Structures in an Applicative Language: A Theory and Implementation in the Case of Prolog,” in9th ACM Symposium on Principles of Programming Languages, Albuquerque, New Mexico, pp. 255–267, 1982.

  10. Lloyd, J. W.,Foundations of Logic Programming, 2nd Edition, Springer-Verlag, 1987.

  11. Lloyd, J. W. and Shepherdson, J. C., “Partial Evaluation in Logic Programming,”Technical Report, TR-87-09, Department of Computer Science, University of Bristol, 1987 (revised 1989), to appear inJournal of Logic Programming.

  12. Marriott, K. and Søndergaard, H., “Semantics-Based Dataflow Analysis of Logic Programs,” inInformation Processing 89 (G. Ritter, ed.), North-Holland, 1989.

  13. Mellish, C. S., “Abstract Interpretation of Prolog Programs,”Proc. 3rd ICLP, LNCS 225, Springer-Verlag, 1986; also Chapter 8 in 1).

  14. Plotkin, G., “A Note on Inductive Generalisation,” inMachine Intelligence, Vol. 5 (B. Meltzer and D. Michie, eds.), Edinburgh University Press, 1974.

  15. Reynolds, J. C., “Transformational Systems and the Algebraic Structure of Atomic Formulas,” inMachine Intelligence, Vol. 5 (B. Meltzer and D. Michie, eds.), Edinburgh University Press, 1974.

  16. Safra, S., “partial Evaluation of Concurrent Prolog and Its Implications,”Masters thesis, Technical Report, CS86-24, Dept. of Computer Science, Weizmann Institute, 1986.

  17. Sestoft, P., “A Bibliography on Partial Evaluation and Mixed Computation,” inProceedings of Workshop on Partial Evaluation and Mixed Computation, Denmark, Oct. 1987.

  18. Tamaki, H. and Sato, T., “OLD Resolution with Tabulation,”Proc. 3rd ICLP, LNCS 225, Springer-Verlag, 1986.

  19. Winsborough, W., “A Minimal Function Graph Semantics for Logic Programs,”Technical Report, 711, Computer Sciences Dept., University of Wisconsin-Madison, Aug. 1987.

  20. Winsborough, W., “Path-Dependent Reachability Analysis for Multiple Specialization,Proceedings of the North American Conference on Logic Programming, Cleveland, MIT Press, Oct. 1989.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Work performed in ESPRIT Basic Research Action project COMPULOG (3012).

About this article

Cite this article

Gallagher, J., Bruynooghe, M. The derivation of an algorithm for program specialisation. New Gener Comput 9, 305–333 (1991). https://doi.org/10.1007/BF03037167

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation