Abstract
Offline partial evaluation techniques rely on an annotated version of the source program to control the specialisation process. These annotations guide the specialisation and ensure the termination of the partial evaluation. We present an algorithm for generating these annotations automatically. The algorithm uses state-of-the-art termination analysis techniques, combined with a new type-based abstract interpretation for propagating the binding types. This algorithm has been implemented as part of the logen partial evaluation system, along with a graphical annotation visualiser and editor, and we report on the performance of the algorithm for a series of benchmarks.
Work supported in part by European Framework 5 Project ASAP (IST-2001-38059).
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Benoy, F., King, A., Mesnard, F.: Computing Convex Hulls with a Linear Solver. Theory and Practice of Logic Programming (January 2004)
Boulanger, D., Bruynooghe, M.: A systematic construction of abstract domains. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864, pp. 61–77. Springer, Heidelberg (1994)
Boulanger, D., Bruynooghe, M., Denecker, M.: Abstracting s-semantics using a model-theoretic approach. In: Penjam, J. (ed.) PLILP 1994. LNCS, vol. 844, pp. 432–446. Springer, Heidelberg (1994)
Bruynooghe, M., Janssens, G.: An instance of abstract interpretation integrating type and mode inferencing. In: Kowalski, R., Bowen, K. (eds.) Proceedings of ICLP/SLP, pp. 669–683. MIT Press, Cambridge (1988)
Bruynooghe, M., Leuschel, M., Sagonas, K.: A polyvariant binding-time analysis for off-line partial deduction. In: Hankin, C. (ed.) ESOP 1998. LNCS, vol. 1381, pp. 27–41. Springer, Heidelberg (1998)
Codish, M., Demoen, B.: Analysing logic programs using “Prop”-ositional logic programs and a magic wand. In: Miller, D. (ed.) Proceedings of the 1993 International Symposium on Logic Programming, Vancouver. MIT Press, Cambridge (1993)
Codish, M., Demoen, B.: Deriving type dependencies for logic programs using multiple incarnations of Prop. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864. Springer, Heidelberg (1994)
Codish, M., Lagoon, V.: Type dependencies for logic programs using ACI-unification. Theoretical Computer Science 238(1-2), 131–159 (2000)
Codish, M., Taboch, C.: A semantic basic for the termination analysis of logic programs. The Journal of Logic Programming 41(1), 103–123 (1999)
Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree Automata Techniques and Applications (1999), http://www.grappa.univ-lille3.fr/tata
Decorte, S., De Schreye, D., Leuschel, M., Martens, B., Sagonas, K.: Termination analysis for tabled logic programming. In: Fuchs, N.E. (ed.) LOPSTR 1997. LNCS, vol. 1463, pp. 111–127. Springer, Heidelberg (1998)
Gallagher, J., Boulanger, D., Sağlam, H.: Practical model-based static analysis for definite logic programs. In: Lloyd, J.W. (ed.) Proc. of International Logic Programming Symposium, pp. 351–365 (1995)
Gallagher, J.P., Henriksen, K.: Abstract domains based on regular types. In: Lifschitz, V., Demoen, B. (eds.) ICLP 2004. LNCS, vol. 3132, pp. 27–42. Springer, Heidelberg (2004)
Genaim, S., Codish, M.: Inferring termination conditions of logic programs by backwards analysis. In: Nieuwenhuis, R., Voronkov, A. (eds.) LPAR 2001. LNCS (LNAI), vol. 2250, pp. 681–690. Springer, Heidelberg (2001)
Hill, P., Gallagher, J.: Meta-programming in logic programming. In: Gabbay, D.M., Hogger, C.J., Robinson, J.A. (eds.) Handbook of Logic in Artificial Intelligence and Logic Programming, vol. 5, pp. 421–497. Oxford Science Publications, Oxford University Press, Oxford (1998)
Horiuchi, K., Kanamori, T.: Polymorphic type inference in prolog by abstract interpretation. In: Furukawa, K., Fujisaki, T., Tanaka, H. (eds.) Logic Programming 1987. LNCS, vol. 315, pp. 195–214. Springer, Heidelberg (1988)
Lagoon, V., Mesnard, F., Stuckey, P.J.: Termination analysis with types is more accurate. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 254–268. Springer, Heidelberg (2003)
Leuschel, M.: The ecce partial deduction system and the dppd library of benchmarks (1996-2002). Obtainable via, http://www.ecs.soton.ac.uk/~mal
Leuschel, M., Craig, S.-J., Bruynooghe, M., Vanhoof, W.: Specializing interpreters using offline partial deduction. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 341–376. Springer, Heidelberg (2004)
Leuschel, M., Jørgensen, J., Vanhoof, W., Bruynooghe, M.: Offline specialisation in Prolog using a hand-written compiler generator. Theory and Practice of Logic Programming 4(1), 139–191 (2004)
Martens, B., De Schreye, D.: Two semantics for definite meta-programs, using the non-ground representation. In: Apt, K.R., Turini, F. (eds.) Meta-logics and Logic Programming, pp. 57–82. MIT Press, Cambridge (1995)
Martens, B., Gallagher, J.: Ensuring global termination of partial deduction while allowing flexible polyvariance. In: Sterling, L. (ed.) Proceedings ICLP1995, Kanagawa, Japan, June 1995, pp. 597–613. MIT Press, Cambridge (1995)
Mogensen, T., Bondorf, A.: Logimix: A self-applicable partial evaluator for Prolog. In: Lau, K.-K., Clement, T. (eds.) Logic Program Synthesis and Transformation. Proceedings of LOPSTR1992, pp. 214–227. Springer, Heidelberg (1992)
Vanhoof, W.: Binding-time analysis by constraint solving: a modular and higher-order approach for Mercury. In: Parigot, M., Voronkov, A. (eds.) LPAR 2000. LNCS (LNAI), vol. 1955, pp. 399–416. Springer, Heidelberg (2000)
Vanhoof, W., Bruynooghe, M.: Binding-time analysis for Mercury. In: De Schreye, D. (ed.) Proceedings of the International Conference on Logic Programming ICLP1999, pp. 500–514. MIT Press, Cambridge (1999)
Vanhoof, W., Bruynooghe, M.: Binding-time annotations without binding-time analysis. In: Nieuwenhuis, R., Voronkov, A. (eds.) LPAR 2001. LNCS (LNAI), vol. 2250, pp. 707–722. Springer, Heidelberg (2001)
Vanhoof, W., Bruynooghe, M.: When size does matter. In: Pettorossi, A. (ed.) LOPSTR 2001. LNCS, vol. 2372, pp. 129–147. Springer, Heidelberg (2002)
Vanhoof, W., Bruynooghe, M., Leuschel, M.: Binding-time analysis for mercury. In: Bruynooghe, M., Lau, K.-K. (eds.) Program Development in Computational Logic. LNCS, vol. 3049, pp. 189–232. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Craig, SJ., Gallagher, J.P., Leuschel, M., Henriksen, K.S. (2005). Fully Automatic Binding-Time Analysis for Prolog. In: Etalle, S. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2004. Lecture Notes in Computer Science, vol 3573. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11506676_4
Download citation
DOI: https://doi.org/10.1007/11506676_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-26655-6
Online ISBN: 978-3-540-31683-1
eBook Packages: Computer ScienceComputer Science (R0)