Advertisement

A technique for recursive invariance detection and selective program specialization

  • F. Giannotti
  • M. Hermenegildo
Session: Abstract Interpretation
Part of the Lecture Notes in Computer Science book series (LNCS, volume 528)

Abstract

This paper presents a technique for achieving a class of optimizations related to the reduction of checks within cycles. The technique uses both Program Transformation and Abstract Interpretation. After a first pass of an abstract interpreter which detects simple invariants, program transformation is used to build a hypothetical situation that simplifies some predicates that should be executed within the cycle. This transformation implements the heuristic hypothesis that once conditional tests hold they may continue doing so recursively. Specialized versions of predicates are generated to detect and exploit those cases in which the invariance may hold. Abstract interpretation is then used again to verify the truth of such hypotheses and confirm the proposed simplification. This allows optimizations that go beyond those possible with only one pass of the abstract interpreter over the original program, as is normally the case. It also allows selective program specialization using a standard abstract interpreter not specifically designed for this purpose, thus simplifying the design of this already complex module of the compiler. In the paper, a class of programs amenable to such optimization is presented, along with some examples and an evaluation of the proposed techniques in some application areas such as floundering detection and reducing run-time tests in automatic logic program parallelization. The analysis of the examples presented has been performed automatically by an implementation of the technique using existing abstract interpretation and program transformation tools.

Keywords

Logic Programming Abstract Interpretation Program Transformation Program Specialization Parallel Logic Programming Cycle Invariant Detection Compile-time Optimization 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    K. Benkerimi and J. Lloyd. A partial evaluation procedure for logic programs. In Proceedings of the North American Conference on Logic Programming, pages 343–358. MIT Press, October 1990.Google Scholar
  2. [2]
    D. Bjorner, A.P. Ershov, and N.D. Jones, editors. Partial Evaluation and Mixed Computation — Proceedings of the Gammel Avernaes Workshop. Noth-Holland, October 1987.Google Scholar
  3. [3]
    M. Bruynooghe. A Framework for the Abstract Interpretation of Logic Programs. Technical Report CW62, Department of Computer Science, Katholieke Universiteit Leuven, October 1987.Google Scholar
  4. [4]
    M. Bruynooghe and G. Janssens. An Instance of Abstract Interpretation Integrating Type and Mode Inference. In 5th Int. Conf. and Symp. on Logic Prog., pages 669–683. MIT Press, August 1988.Google Scholar
  5. [5]
    M Bugliesi and F. Russo. Partial evaluation in prolog: Some improvements about cut. In 1989 North American Conference on Logic Programming. MIT Press, October 1989.Google Scholar
  6. [6]
    J.-H. Chang and Alvin M. Despain. Semi-Intelligent Backtracking of Prolog Based on Static Data Dependency Analysis. In International Symposium on Logic Programming, pages 10–22. IEEE Computer Society, July 1985.Google Scholar
  7. [7]
    P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Conf. Rec. 4th Acm Symp. on Prin. of Programming Languages, pages 238–252, 1977.Google Scholar
  8. [8]
    S. K. Debray and D. S. Warren. Detection and Optimization of Functional Computations in Prolog. In Third International Conference on Logic Programming, number 225 in Lecture Notes in Computer Science, pages 490–505. Imperial College, Springer-Verlag, July 1986.Google Scholar
  9. [9]
    J. Gallagher. Transforming logic programs by specializing interpreters. In Proc. of the 7th. European Conference on Artificial Intelligence, 1986.Google Scholar
  10. [10]
    J. Gallagher and M. Bruynooghe. The derivation of an algorithm for program specialization. In 1990 International Conference on Logic Programming, pages 732–746. MIT Press, June 1990.Google Scholar
  11. [11]
    J. Gallagher, M. Codish, and E. Shapiro. Specialisation of prolog and fcp programs using abstract interpretation. New Generation Computing, 6:159–186, 1988.Google Scholar
  12. [12]
    F. Giannotti and M. Hermenegildo. A Technique for Recursive Invariance Detection and Selective Program Specialization. Technical report, U. of Madrid (UPM), Facultad Informatica UPM, 28660-Boadilla del Monte, Madrid-Spain, 1991.Google Scholar
  13. [13]
    M. Hermenegildo and K. Greene. &-Prolog and its Performance: Exploiting Independent And-Parallelism. In 1990 International Conference on Logic Programming, pages 253–268. MIT Press, June 1990.Google Scholar
  14. [14]
    M. Hermenegildo and F. Rossi. On the Correctness and Efficiency of Independent And-Parallelism in Logic Programs. In 1989 North American Conference on Logic Programming, pages 369–390. MIT Press, October 1989.Google Scholar
  15. [15]
    M. Hermenegildo and F. Rossi. Non-Strict Independent And-Parallelism. In 1990 International Conference on Logic Programming, pages 237–252. MIT Press, June 1990.Google Scholar
  16. [16]
    D. Jacobs and A. Langen. Accurate and Efficient Approximation of Variable Aliasing in Logic Programs. In 1989 North American Conference on Logic Programming. MIT Press, October 1989.Google Scholar
  17. [17]
    D. Jacobs, A. Langen, and W. Winsborough. Multiple specialization of logic programs with run-time tests. In 1990 International Conference on Logic Programming, pages 718–731. MIT Press, June 1990.Google Scholar
  18. [18]
    N. Jones and H. Sondergaard. A semantics-based framework for the abstract interpretation of prolog. In Abstract Interpretation of Declarative Languages, chapter 6, pages 124–142. Ellis-Horwood, 1987.Google Scholar
  19. [19]
    H. Mannila and E. Ukkonen. Flow Analysis of Prolog Programs. In 4th IEEE Symposium on Logic Programming. IEEE Computer Society, September 1987.Google Scholar
  20. [20]
    A. Marien, G. Janssens, A. Mulkers, and M. Bruynooghe. The impact of abstract interpretation: an experiment in code generation. In Sixth International Conference on Logic Programming, pages 33–47. MIT Press, June 1989.Google Scholar
  21. [21]
    C.S. Mellish. Abstract Interpretation of Prolog Programs. In Third International Conference on Logic Programming, number 225 in Lecture Notes in Computer Science, pages 463–475. Imperial College, Springer-Verlag, July 1986.Google Scholar
  22. [22]
    K. Muthukumar and M. Hermenegildo. Determination of Variable Dependence Information at Compile-Time Through Abstract Interpretation. In 1989 North American Conference on Logic Programming. MIT Press, October 1989.Google Scholar
  23. [23]
    K. Muthukumar and M. Hermenegildc. Combined Determination of Sharing and Freeness of Program Variables Through Abstract Interpretation. In 1991 International Conference on Logic Programming. MIT Press, June 1991.Google Scholar
  24. [24]
    D. Sahlin. The mixtus approach to the automatic evaluation of full prolog. In Proceedings of the North American Conference on Logic Programming, pages 377–398. MIT Press, October 1990.Google Scholar
  25. [25]
    P. Sestoft. A bibliography on partial evaluation and mixed computation. In Proceedings of the Workshop on Partial Evaluation and Mixed Computation. North-Holland, October 1987.Google Scholar
  26. [26]
    W. Winsborough. Path-dependent reachability analysis for multiple specialization. In 1989 North American Conference on Logic Programming. MIT Press, October 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • F. Giannotti
    • 1
  • M. Hermenegildo
    • 2
  1. 1.CNUCE-CNRPisaItaly
  2. 2.Univ. Politécnica de Madrid (UPM) Facultad de InformáticaMadridSpain

Personalised recommendations