Abstract
The current state of the art for ensuring finite unfolding of logic programs consists of a number of online techniques where unfolding decisions are made at specialisation time. Introduction of a static termination analysis phase into a partial deduction algorithm permits unfolding decisions to be made offline, before the actual specialisation phase itself. This separation improves specialisation time and facilitates the automatic construction of compilers and compiler generators. The main contribution of this paper is how this separation may be achieved in the context of logic programming, while providing non-trivial support for partially static datastructures.
The paper establishes a solid link between the fields of static termination analysis and partial deduction enabling existing termination analyses to be used to ensure finiteness of the unfolding process. This is the first offline technique which allows arbitrarily partially instantiated goals to be sufficiently unfolded to achieve good specialisation results. Furthermore, it is demonstrated that an offline technique such as this one can be implemented very efficiently and, surprisingly, yield even better specialisation than a (pure) online technique. It is also, to our knowledge, the first offline approach which passes the KMP test (i.e., obtaining an efficient Knuth-Morris-Pratt pattern matcher by specialising a naive one).
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
M. Bruynooghe, D. De Schreye, and B. Martens. A general criterion for avoiding infinite unfolding during partial deduction of logic programs. In Proceedings of ILPS’91, pages 117–131. MIT Press, 1991.
M. Bruynooghe, D. De Schreye, and B. Martens. A general criterion for avoiding infinite unfolding during partial deduction. New Generation Computing, 11(1):47–79, 1992.
M. Bruynooghe, M. Leuschel, and K. Sagonas. A polyvariant binding-time analysis for off-line partial deduction. In C. Hankin, editor, Proceedings of ESOP’98, LNCS 1381, pages 27–41. Springer-Verlag, April 1998.
D. De Schreye and S. Decorte. Termination of logic programs: The never-ending story. The Journal of Logic Programming, 19 & 20:199–260, May 1994.
D. De Schreye, R. Glück, J. Jørgensen, M. Leuschel, B. Martens, and M. H. Sørensen. Conjunctive partial deduction: Foundations, control, algorithms and experiments. The Journal of Logic Programming, 41(2 & 3):231–277, 1999.
N. Dershowitz. Termination of rewriting. Journal of Symbolic Computation, 3:69–116, 1987.
N. Dershowitz and Z. Manna. Proving termination with multiset orderings. Communications of the ACM, 22(8):465–476, 1979.
A. Ershov. On Futamura projections. BIT (Japan), 12(14):4–5, 1982. In Japanese.
J. Gallagher. Tutorial on specialisation of logic programs. In Proceedings of PEPM’93, pages 88–98. ACM Press, 1993.
R. Glück, J. Jørgensen, B. Martens, and M. H. Sørensen. Controlling conjunctive partial deduction of definite logic programs. In H. Kuchen and S. Swierstra, editors, Proceedings of PLILP’96, LNCS 1140, pages 152–166, Aachen, Germany, September 1996. Springer-Verlag.
C. A. Gurr. A Self-Applicable Partial Evaluator for the Logic Programming Language Gödel. PhD thesis, Dept. of Computer Science, University of Bristol, 1994.
J. Jørgensen and M. Leuschel. Efficiently generating efficient generating extensions in Prolog. In O. Danvy, R. Glück, and P. Thiemann, editors, Proceedings of the Dagstuhl Seminar on Partial Evaluation, LNCS 1110, pages 238–262, 1996.
M. Leuschel. The ECCE partial deduction system and the DPPD library of benchmarks. Obtainable via http://www.cs.kuleuven.ac.be/~dtai, 1996.
M. Leuschel. Advanced Techniques for Logic Program Specialisation. PhD thesis, K.U. Leuven, May 1997. Accessible via http://www.ecs.soton.ac.uk/~mal.
M. Leuschel. Improving homeomorphic embedding for online termination. In P. Flener, editor, Proceedings of LOPSTR’98, LNCS 1559, pages 199–218, Manchester, UK, June 1998. Springer-Verlag.
M. Leuschel. On the power of homeomorphic embedding for online termination. In G. Levi, editor, Proceedings of SAS’98, LNCS 1503, pages 230–245, Pisa, Italy, September 1998. Springer-Verlag.
M. Leuschel, D. De Schreye, and A. de Waal. A conceptual embedding of folding into partial deduction: Towards a maximal integration. In M. Maher, editor, Proceedings of JICSLP’96, pages 319–332, Bonn, Germany, September 1996. MIT Press.
M. Leuschel, B. Martens, and D. De Schreye. Controlling generalisation and polyvariance in partial deduction of normal logic programs. ACM Transactions on Programming Languages and Systems, 20(1):208–258, January 1998.
J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.
J. W. Lloyd and J. C. Shepherdson. Partial evaluation in logic programming. The Journal of Logic Programming, 11(3& 4):217–242, 1991.
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28(2):89–146, 1996.
B. Martens, D. De Schreye, and T. Horváth. Sound and complete partial deduction with unfolding based on well-founded measures. Theoretical Comput. Sci., 122(12):97–117, 1994.
J. Martin and A. King. Generating Efficient, Terminating Logic Programs. In TAPSOFT’97. Springer-Verlag, 1997.
J. Martin and M. Leuschel. Sonic partial deduction. Technical Report DSSETR-99-3, Dept. of Electronics and Computer Science, University of Southampton, February 1999.
T. Mogensen and A. Bondorf. Logimix: A self-applicable partial evaluator for Prolog. In K.-K. Lau and T. Clement, editors, Proceedings of LOPSTR’92, pages 214–227. Springer-Verlag, 1992.
S. A. Romanenko. A compiler generator produced by a self-applicable specializer can have a surprisingly natural and understandable structure. In D. Bjørner, A. P. Ershov, and N. D. Jones, editors, Partial Evaluation and Mixed Computation, pages 445–463. North-Holland, 1988.
M. H. Sørensen and R. Glück. An algorithm of generalization in positive supercompilation. In J. W. Lloyd, editor, Proceedings of ILPS’95, pages 465–479, Portland, USA, December 1995. MIT Press.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Martin, J., Leuschel, M. (2000). Sonic Partial Deduction. In: Bjøner, D., Broy, M., Zamulin, A.V. (eds) Perspectives of System Informatics. PSI 1999. Lecture Notes in Computer Science, vol 1755. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46562-6_9
Download citation
DOI: https://doi.org/10.1007/3-540-46562-6_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67102-2
Online ISBN: 978-3-540-46562-1
eBook Packages: Springer Book Archive