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.
Preview
Unable to display preview. Download preview PDF.
References
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.
R. M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, January 1977.
C. Consel and S.C. Khoo. Parameterized partial evaluation. ACM Transactions on Programming Languages and Systems, 15(3):463–493, 1993.
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.
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.
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.
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall, 1993.
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.
J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, Berlin, 1987. Second Edition.
J. W. Lloyd and J. C. Shepherdson. Partial evaluation in logic programming. Journal of Logic Programming, 11:217–242, 1991.
U. W. Neumerkel. Specialization of Prolog Programs with Partially Static Goals and Binarization. PhD thesis, Technical University Wien, Austria, 1992.
R. Paige and S. Koenig. Finite differencing of computable expressions. ACM Transactions on Programming Languages and Systems, 4(3):402–454, 1982.
A. Pettorossi and M. Proietti. Transformation of logic programs: Foundations and techniques. Journal of Logic Programming, 19, 20:261–320, 1994.
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.
H. Tamaki and T. Sato. A generalized correctness proof of the unfold/fold logic program transformation. Technical Report 86-4, Ibaraki University, Japan, 1986.
Author information
Authors and Affiliations
Editor information
Rights 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