Skip to main content

Transformation Rules for Logic Programs with Goals as Arguments

  • Conference paper
Logic-Based Program Synthesis and Transformation (LOPSTR 1999)

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

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Apt, K.R., Pedreschi, D.: Reasoning about termination of pure logic programs. Information and Computation 106, 109–157 (1993)

    Article  MATH  MathSciNet  Google Scholar 

  2. 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)

    Chapter  Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Google Scholar 

  8. Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, Berlin (1987)

    MATH  Google Scholar 

  9. 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)

    Google Scholar 

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

    Article  MathSciNet  Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Article  MATH  MathSciNet  Google Scholar 

  14. 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)

    Google Scholar 

  15. Sands, D.: Total correctness by local improvement in the transformation of functional programs. ACM Toplas 18(2), 175–234 (1996)

    Article  MathSciNet  Google Scholar 

  16. Sterling, L.S., Shapiro, E.: The Art of Prolog. The MIT Press, Cambridge (1986)

    MATH  Google Scholar 

  17. 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)

    Google Scholar 

  18. Wand, M.: Continuation-based program transformation strategies. Journal of the ACM 27(1), 164–180 (1980)

    Article  MATH  MathSciNet  Google Scholar 

  19. 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)

    Google Scholar 

  20. Winskel, G.: The Formal Semantics of Programming Languages: An Introduction. The MIT Press, Cambridge (1993)

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics