Skip to main content

Regular approximation of computation paths in logic and functional languages

  • Conference paper
  • First Online:
Partial Evaluation

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

Abstract

The aim of this work is to compute descriptions of successful computation paths in logic or functional program executions. Computation paths are represented as terms, built from special constructor symbols, each constructor symbol corresponding to a specific clause or equation in a program. Such terms, called trace-terms, are abstractions of computation trees, which capture information about the control flow of the program. A method of approximating trace-terms is described, based on well-established methods for computing regular approximations of terms. The special function symbols are first introduced into programs as extra arguments in predicates or functions. Then a regular approximation of the program is computed, describing the terms occurring in some set of program executions. The approximation of the extra arguments (the trace-terms) can then be examined to see what computation paths were followed during the computation. This information can then be used to control both off-line or on-line specialisation systems.

A key aspect of the analysis is the use of suitable widening operations during the regular approximation, in order to preserve information on determinacy and branching structure of the computation. This method is applicable to both logic and functional languages, and appears to offer appropriate control information in both formalisms.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. M. Bruynooghe and G. Janssens. Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming, 13(2&3):205–258, 1992.

    Google Scholar 

  2. D.A. de Waal and J. Gallagher. The applicability of logic program analysis and transformation to theorem proving. In Proceedings of the 12th International Conference on Automated Deduction (CADE-12), Nancy, 1994.

    Google Scholar 

  3. T. Frühwirth, E. Shapiro, M.Y. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Proceedings of the IEEE Symposium on Logic in Computer Science, Amsterdam, July 1991.

    Google Scholar 

  4. J. Gallagher. Transforming logic programs by specialising interpreters. In Proceedings of the 7th European Conference on Artificial Intelligence (ECAI-86), Brighton, pages 109–122, 1986.

    Google Scholar 

  5. J. Gallagher and M. Bruynooghe. The derivation of an algorithm for program specialisation. New Generation Computing, 9(1991):305–333, 1991.

    Google Scholar 

  6. J. Gallagher and D.A. de Waal. Fast and precise regular approximation of logic programs. In P. Van Hentenryck, editor, Proceedings of the International Conference on Logic Programming (ICLP'94), Santa Margherita Ligure, Italy, MIT Press, 1994.

    Google Scholar 

  7. Robert Glück and Andrei V. Klimov. Occam's razor in metacomputation: the notion of a perfect process tree. In G. Filè P.Cousot, M.Falaschi and A. Rauzy, editors, Static Analysis. Proceedings, pages 112–123, Springer-Verlag, 1993.

    Google Scholar 

  8. Robert Glück and Morten Heine Sørensen. Partial deduction and driving are equivalent. In M. Hermenegildo and J. Penjam, editors, Programming Language Implementation and Logic Programming, pages 165–181, Springer-Verlag, 1994.

    Google Scholar 

  9. P. Van Hentenryck, A. Cortesi, and B. Le Charlier. Type analysis of prolog using type graphs. Journal of Logic Programming, (to appear).

    Google Scholar 

  10. N. Heintze. Practical aspects of set based analysis. In K. Apt, editor, Proceedings of the Joint International Symposium and Conference on Logic Programming, pages 765–769, MIT Press, 1992.

    Google Scholar 

  11. N. Jones and A. Mycroft. Dataflow analysis of applicative programs using minimal function graphs. In Proceedings of Principle of Programming Languages (POPL'86), ACM Press, 1986.

    Google Scholar 

  12. N. Jones. Flow analysis of lazy higher order functional programs. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, Ellis-Horwood, 1987.

    Google Scholar 

  13. M. Leuschel. Ecological partial deduction: preserving characteristic trees without constraints. In M. Proietti, editor, Proceedings of the 5th International Workshop on Logic Program Synthesis and Transformation, Springer-Verlag (to appear), 1995.

    Google Scholar 

  14. J.W. Lloyd. The Programming Language Escher. Technical Report CSTR-95-013, Dept. of Computer Science, University of Bristol, 1995.

    Google Scholar 

  15. M. Leuschel and B. Martens. Global control for partial deduction through characteristic atoms and global trees. In O. Danvy, R. Glück, and P. Thiemann, editors, Proc. of the Dagstuhl Seminar on Partial Evaluation, Springer-Verlag, 1996.

    Google Scholar 

  16. B. Martens and J. Gallagher. Ensuring global termination of partial deduction while allowing flexible polyvariance. In L. Sterling, editor, Proc. International Conference on Logic Progrmaming, (ICLP'95), Tokyo, MIT Press, 1995.

    Google Scholar 

  17. H. Saglam and J. Gallagher. Approximating Constraint Logic Programs Using Polymorphic Types and Regular Descriptions. Technical Report CSTR-95-17, University of Bristol, Department of Computer Science, 1995.

    Google Scholar 

  18. Morten Heine Sørensen and Robert Glück. An algorithm of generalization in positive supercompilation. In J. W. Lloyd, editor, International Logic Programming Symposium, page to appear, MIT Press, 1995.

    Google Scholar 

  19. Morten Heine Sørensen, Robert Glück, and Neil D. Jones. Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In ESOP, Springer-Verlag, 1994.

    Google Scholar 

  20. E.Y. Shapiro. Or-parallel prolog in flat concurrent prolog. In E.Y. Shapiro, editor, Concurrent Prolog: Collected Papers (Volume 2), MIT Press, 1987.

    Google Scholar 

  21. H. Tamaki and T. Sato. OLDT resolution with tabulation. In E.Y. Shapiro, editor, Proc. 3rd ICLP, London, Springer-Verlag, 1986.

    Google Scholar 

  22. V. Turchin. The algorithm of generalization in the supercompiler. In D. Bjørner, A.P. Ershov, and N.D. Jones, editors, Proc. of the IFIP TC2 Workshop, Partial Evaluation and Mixed Computation, pages 531–549, North-Holland, 1988.

    Google Scholar 

  23. V. Turchin. Program transformation with metasystem transitions. Journal of Functional Programming, 3(3):283–313, 1993.

    Google Scholar 

  24. V. Turchin. Metacomputation: MST plus SCP. In O. Danvy, R. Glück, and P. Thiemann, editors, Proc. of the Dagstuhl Seminar on Partial Evaluation, Springer-Verlag, 1996.

    Google Scholar 

  25. E. Yardeni and E.Y. Shapiro. A type system for logic programs. Journal of Logic Programming, 10(2):125–154, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Olivier Danvy Robert Glück Peter Thiemann

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Gallagher, J., Lafave, L. (1996). Regular approximation of computation paths in logic and functional languages. In: Danvy, O., Glück, R., Thiemann, P. (eds) Partial Evaluation. Lecture Notes in Computer Science, vol 1110. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61580-6_7

Download citation

  • DOI: https://doi.org/10.1007/3-540-61580-6_7

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61580-4

  • Online ISBN: 978-3-540-70589-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics