Skip to main content

A theory of logic program specialization and generalization for dealing with input data properties

  • Conference paper
  • First Online:
Partial Evaluation

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

Abstract

We address the problem of specializing logic programs w.r.t. the contexts where they are used. We assume that these contexts are specified by means of computable properties of the input data. We describe a general method by which, given a program P, we can derive a specialized program P 1 such that P and P1 are equivalent w.r.t. every input data satisfying a given property. Our method extends the techniques for partial evaluation of logic programs based on Lloyd and Shepherdson's approach, where a context can only be specified by means of a finite set of bindings for the variables of the input goal. In contrast to most program specialization techniques based on partial evaluation, our method may achieve superlinear speedups, and it does so by using a novel generalization technique.

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. A. Bossi, N. Cocco, and S. Dulli. A method for specializing logic programs. ACM Transactions on Programming Languages and Systems, 12(2):253–302, April 1990.

    Google Scholar 

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

    Google Scholar 

  3. C. Consel and S.C. Khoo. Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems, 15(3):463–493, 1993.

    Google Scholar 

  4. D. A. de Waal and J. P. Gallagher. Specialization of a unification algorithm. In T. Clement and K.-K. Lau, editors, Logic Program Synthesis and Transformation, Proceedings LOPSTR '91, Manchester, U.K., Workshops in Computing, pages 205–221. Springer-Verlag, 1992.

    Google Scholar 

  5. Y. Futamura and K. Nogi. Generalized partial computation. In D. Bjørner, A. P. Ershov, and N. D. Jones, editors, Partial Evaluation and Mixed Computation, pages 133–151. North-Holland, 1988.

    Google Scholar 

  6. J. P. Gallagher and D.A. de Waal. Deletion of redundant unary type predicates from logic programs. In Proceedings of LoPSTr'92, Manchester, U.K., pages 151–167. Springer-Verlag, 1993.

    Google Scholar 

  7. N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.

    Google Scholar 

  8. M. Leuschel and B. Martens. Partial deduction of the ground representation and its application to integrity checking. In J. W. Lloyd, editor, Proceedings of the 1995 International Logic Programming Symposium (ILPS'95), pages 495–509. MIT Press, 1995.

    Google Scholar 

  9. J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, Berlin, 1987. Second Edition.

    Google Scholar 

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

    Google Scholar 

  11. U. W. Neumerkel. Specialization of Prolog Programs with Partially Static Goals and Binarization. PhD thesis, Technical University Wien, Austria, 1992.

    Google Scholar 

  12. R. Paige and S. Koenig. Finite differencing of computable expressions. ACM Transactions on Programming Languages and Systems, 4(3):402–454, 1982.

    Google Scholar 

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

    Google Scholar 

  14. W. L. Scherlis. Program improvement by internal specialization. In Proc. 8th ACM Symposium on Principles of Programming Languages, Williamsburgh, Va, pages 41–49. ACM Press, 1981.

    Google Scholar 

  15. H. Tamaki and T. Sato. A generalized correctness proof of the unfold/fold logic program transformation. Technical Report 86-4, Ibaraki University, Japan, 1986.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Olivier Danvy Robert Glück Peter Thiemann

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Pettorossi, A., Proietti, M. (1996). A theory of logic program specialization and generalization for dealing with input data properties. In: Danvy, O., Glück, R., Thiemann, P. (eds) Partial Evaluation. Lecture Notes in Computer Science, vol 1110. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61580-6_19

Download citation

  • DOI: https://doi.org/10.1007/3-540-61580-6_19

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61580-4

  • Online ISBN: 978-3-540-70589-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics