Skip to main content

A Program Transformation for Backwards Analysis of Logic Programs

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

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

Abstract

The input to backwards analysis is a program together with properties that are required to hold at given program points. The purpose of the analysis is to derive initial goals or pre-conditions that guarantee that, when the program is executed, the given properties hold. The solution for logic programs presented here is based on a transformation of the input program, which makes explicit the dependencies of the given program points on the initial goals. The transformation is derived from the resultants semantics of logic programs. The transformed program is then analysed using a standard abstract interpretation. The required pre-conditions on initial goals can be deduced from the analysis results without a further fixpoint computation. For the modes backwards analysis problem, this approach gives the same results as previous work, but requires only a standard abstract interpretation framework and no special properties of the abstract domain.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

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.

Similar content being viewed by others

References

  1. Bossi, A., Gabbrielli, M., Levi, G., Martelli, M.: The s-semantics approach: Theory and applications. Journal of Logic Programming 19/20, 149–197 (1994)

    Article  MathSciNet  Google Scholar 

  2. Bancilhon, F., Maier, D., Sagiv, Y., Ullman, J.: Magic sets and other strange ways to implement logic programs. In: Proceedings of the 5th ACM SIGMOD-SIGACT Symposium on Principles of Database Systems (1986)

    Google Scholar 

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

    Google Scholar 

  4. Clark, K.: Predicate logic as a computational formalism. Technical Report DOC 79/59, Imperial College, London, Department of Computing (1979)

    Google Scholar 

  5. Comini, M., Levi, G., Meo, M.C.: A theory of observables for logic programs. Information and Computation 169(1), 23–80 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  6. Codish, M., Søndergaard, H.: Meta-circular abstract interpretation in prolog. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 109–134. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  7. Codish, M., Taboch, C.: A semantic basic for the termination analysis of logic programs. The Journal of Logic Programming 41(1), 103–123 (1999)

    Article  MATH  MathSciNet  Google Scholar 

  8. Debray, S., Ramakrishnan, R.: Abstract Interpretation of Logic Programs Using Magic Transformations. Journal of Logic Programming 18, 149–176 (1994)

    Article  MATH  MathSciNet  Google Scholar 

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

    Google Scholar 

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

    Chapter  Google Scholar 

  11. Gabbrielli, M., Giacobazzi, R.: Goal independency and call patterns in the analysis of logic programs. In: Proceedings of the 1994 ACM Symposium on Applied Computing, SAC 1994, pp. 394–399 (1994)

    Google Scholar 

  12. Gabbrielli, M., Levi, G., Meo, M.C.: Resultants semantics for Prolog. Journal of Logic and Computation 6(4), 491–521 (1996)

    Article  MATH  MathSciNet  Google Scholar 

  13. Giacobazzi, R., Scozzari, F.: A logical model for relational abstract domains. ACM Transactions on Programming Languages and Systems 20(5), 1067–1109 (1998)

    Article  Google Scholar 

  14. King, A., Lu, L.: A backward analysis for constraint logic programs. Theory and Practice of Logic Programming 2(4-5), 514–547 (2002)

    MathSciNet  Google Scholar 

  15. King, A., Lu, L.: Forward versus backward verification of logic programs. In: Palamidessi, C. (ed.) ICLP 2003. LNCS, vol. 2916, pp. 315–330. Springer, Heidelberg (2003) (to appear)

    Chapter  Google Scholar 

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

    MATH  Google Scholar 

  17. Mesnard, F.: Inferring left-terminating classes of queries for constraint logic programs. In: Maher, M.J. (ed.) Joint International Conference and Symposium on Logic Programming, pp. 7–21. MIT Press, Cambridge (1996)

    Google Scholar 

  18. Mesnard, F., Neumerkel, U.: Applying static analysis techniques for inferring termination conditions of logic programs. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, pp. 93–110. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gallagher, J.P. (2004). A Program Transformation for Backwards Analysis of Logic Programs. In: Bruynooghe, M. (eds) Logic Based Program Synthesis and Transformation. LOPSTR 2003. Lecture Notes in Computer Science, vol 3018. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-25938-1_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-25938-1_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22174-6

  • Online ISBN: 978-3-540-25938-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics