Abstract
We introduce a logic language where predicate symbols may have both terms and goals as arguments. We define its operational semantics by extending SLD-resolution with the leftmost selection rule, and we propose a set of transformation rules for manipulating programs written in that language. These transformation rules are shown to be correct in the sense that they preserve the chosen operational semantics. This logic language has higher order capabilities which turn out to be very powerful for the derivation of efficient logic programs. In particular, in our language we can avoid the problem of goal rearrangement which is often encountered during program transformation. Moreover, goals as arguments allow us to perform on logic programs transformation steps similar to the ones performed on functional programs when using higher order generalizations and continuation arguments.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Apt, K.R., Pedreschi, D.: Reasoning about termination of pure logic programs. Information and Computation 106, 109–157 (1993)
Bertolino, M., Etalle, S., Palamidessi, C.: The replacement operation for CCP programs. In: Bossi, A. (ed.) LOPSTR 1999. LNCS, vol. 1817, pp. 216–233. Springer, Heidelberg (2000)
Bossi, A., Cocco, N.: Preserving universal termination through unfold/fold. In: Rodríguez-Artalejo, M., Levi, G. (eds.) ALP 1994. LNCS, vol. 850, pp. 269–286. Springer, Heidelberg (1994)
Bossi, A., Cocco, N., Etalle, S.: Transforming left-terminating programs: The reordering problem. In: Proietti, M. (ed.) LOPSTR 1995. LNCS, vol. 1048, pp. 33–45. Springer, Heidelberg (1996)
Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. Journal of the ACM 24(1), 44–67 (1977)
Hill, P.M., 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 University Press, Oxford (1998)
Jørgensen, J., Leuschel, M., Martens, B.: Conjunctive partial deduction in practice. In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 59–82. Springer, Heidelberg (1997)
Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Berlin (1987)
Nadathur, G., Miller, D.A.: Higher-order 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. 499–590. Oxford University Press, Oxford (1998)
Pettorossi, A., Proietti, M.: Transformation of logic programs: Foundations and techniques. Journal of Logic Programming 19(20), 261–320 (1994)
Pettorossi, A., Proietti, M.: Flexible continuations in logic programs via unfold/ fold transformations and goal generalization. In: Danvy, O. (ed.) Proceedings of the 2nd ACM SIGPLAN Workshop on Continuations, ENS, Paris (France), Aahrus, Denmark, January 14, BRICS Notes Series, N6-93-13, pp. 9.1–9.22 (1997)
Pettorossi, A., Skowron, A.: Higher order generalization in program derivation. In: Ehrig, H., Levi, G., Montanari, U. (eds.) TAPSOFT 1987 and CFLP 1987. LNCS, vol. 250, pp. 182–196. Springer, Heidelberg (1987)
Proietti, M., Pettorossi, A.: Unfolding-definition-folding, in this order, for avoiding unnecessary variables in logic programs. Theoretical Computer Science 142(1), 89–124 (1995)
Proietti, M., Pettorossi, A.: Transforming inductive definitions. In: De Schreye, D. (ed.) Proceedings of the 1999 International Conference on Logic Programming, pp. 486–499. MIT Press, Cambridge (1999)
Sands, D.: Total correctness by local improvement in the transformation of functional programs. ACM Toplas 18(2), 175–234 (1996)
Sterling, L.S., Shapiro, E.: The Art of Prolog. The MIT Press, Cambridge (1986)
Tamaki, H., Sato, T.: Unfold/fold transformation of logic programs. In: Tärnlund, S.Å. (ed.) Proceedings of the Second International Conference on Logic Programming, Uppsala, Sweden, pp. 127–138. Uppsala University (1984)
Wand, M.: Continuation-based program transformation strategies. Journal of the ACM 27(1), 164–180 (1980)
Warren, D.H.D.: Higher-order extensions to Prolog: are they needed? In: Pao, Y.-H., Hayes, J.E., Michie, D. (eds.) Machine Intelligence, Chichester, vol. 10, pp. 441–454. Ellis Horwood Ltd. (1982)
Winskel, G.: The Formal Semantics of Programming Languages: An Introduction. The MIT Press, Cambridge (1993)
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
Pettorossi, A., Proietti, M. (2000). Transformation Rules for Logic Programs with Goals as Arguments. In: Bossi, A. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 1999. Lecture Notes in Computer Science, vol 1817. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10720327_11
Download citation
DOI: https://doi.org/10.1007/10720327_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67628-7
Online ISBN: 978-3-540-45148-8
eBook Packages: Springer Book Archive