Skip to main content

Specialization of imperative programs through analysis of relational expressions

  • Conference paper
  • First Online:
Partial Evaluation

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

  • 130 Accesses

Abstract

An inter-procedural data flow analysis operating on control flow graphs and collecting information about program expressions is described in this paper. The following relational and other expressions are analyzed: equivalences between program expressions and constants; linear-ordering inequalities between program expressions and constants; equalities originating from some program assignments; atomic constituents of controlling expressions of program branches. Analysis is executed by a worklist-based fixpoint algorithm which interprets conditional branches and incorporates a rule-based inference procedure. Two variants of the polyvariant program point specialization using results of the analysis are presented. The both specializations are done at the level of control flow graphs. The variants differ in terms of the size of residual programs.

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. A.V. Aho, R. Sethi, J. D. Ullman, Compilers. Principles, Techniques, and Tools, Addison-Wesley, 1986.

    Google Scholar 

  2. L. O. Andersen. Partial Evaluation of C and Automatic Compiler Generation. Lecture Notes in Computer Science, v. 641, 1992, 251–257.

    Google Scholar 

  3. R. Baier, R. Glueck, R. Zochling. Partial Evaluation of Numerical Programs in Fortran. Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, 1994, 119–132.

    Google Scholar 

  4. S. Blazy, P. Facon. Partial Evaluation for The Understanding of Fortran Programs. International Journal of Software Engineering and Knowledge Engineering, v. 4, 1994, #4, 535–559.

    Google Scholar 

  5. F. Bourdoncle. Abstract Debugging of Higher-Order Imperative Languages. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1993, 47–55.

    Google Scholar 

  6. M. A. Bulyonkov. Polyvariant Mixed Computation for Analyzer Programs. Acta Informatica, v. 21, 1984, 473–484.

    Google Scholar 

  7. P.R. Carini, M. Hind. Flow-Sensitive Interprocedural Constant Propagation. Proceedings of the SIGPLAN Symposium on Programming Language Design and Implementation, 1995, 23–31.

    Google Scholar 

  8. C.-L. Chang, R. C.-T. Lee. Symbolic Logic and Mechanical Theorem Proving, Academic Press, 1973.

    Google Scholar 

  9. C. Consel, S.C. Khoo. Parameterized Partial Evaluation. ACM Transactions on Programming Languages and Systems, v. 15, 1993, #3, 463–493.

    Google Scholar 

  10. P. Cousot, R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. Proceedings of the ACM Symposium on Principles of Programming Languages, 1977, 238–252.

    Google Scholar 

  11. C.N. Fisher, R.J. LeBlanc, Jr. Crafting A Compiler, Benjamin/Cummings, 1988.

    Google Scholar 

  12. Y. Futamura, K. Nogi. Generalized partial computation. In: Partial Evaluation and Mixed Computation (D. Bjorner, A.P. Ershov, N.D. Jones, Eds.), North-Holland, 1988.

    Google Scholar 

  13. R. Glueck, A. V. Klimov. Occam's Razor in Metacomputation: the Notion of a Perfect Process Tree. Lecture Notes in Computer Science, v. 724, 1993, 112–123.

    Google Scholar 

  14. M.S. Hecht. Flow Analysis of Computer Programs, Elsevier North-Holland, 1977.

    Google Scholar 

  15. H. Johnson. Data Flow Analysis for ‘Intractable’ System Software. Proceedings of the ACM SICPLAN Conference on Programming Language Design and Implementation, 1986, 109–117.

    Google Scholar 

  16. N. Jones. The Essence of Program Transformation by Partial Evaluation and Driving. Lecture Notes in Computer Science, v. 792, 1994, 206–224.

    Google Scholar 

  17. N.D. Jones, C. K. Gomard, P. Sestoft. Partial Evaluation and Automatic Program Generation, Prentice Hall, 1993.

    Google Scholar 

  18. J.B. Kam, J.D. Ullman. Monotone Data Flow Analysis Frameworks. Acta Informatica, v. 7, 1977, 305–317.

    Google Scholar 

  19. D.E. Knuth, P.B. Bendix. Simple Word Problems in Universal Algebras. In: Computational Problems in Abstract Algebra (J. Leech, Ed.), Pergamon Press, 1970.

    Google Scholar 

  20. W. Landi, B.G. Ryder. A Safe Approximate Algorithm for Interprocedural Pointer Aliasing. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1992, 235–248.

    Google Scholar 

  21. U. Meyer. Techniques for Partial Evaluation of Imperative Languages. Proceedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, 1991, 94–105.

    Google Scholar 

  22. F. Mueller, D.B. Whalley. Avoiding Conditional Branches by Code Replication. Proceedings of the SIGPLAN Symposium on Programming Language Design and Implementation, 1995, 56–66.

    Google Scholar 

  23. S. Sagiv et al. A Logic-Based Approach to Data Flow Analysis Problems. Lecture Notes in Computer Science, v. 456, 1990, 52–65.

    Google Scholar 

  24. A. Sakharov. Propagation of Constants and Assertions. SIGPLAN Notices, v. 29, 1994, #5, 3–6.

    Google Scholar 

  25. B. Wegbreit. Property Extraction in Well-Founded Property Sets. IEEE Transactions on Software Engineering, v. 1, 1977, #3, 270–285.

    Google Scholar 

  26. M.N. Wegman, F.K. Zadeck. Constant Propagation with Conditional Branches. ACM Transactions on Programming Languages and Systems, v. 13, 1991, #2, 181–210.

    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

Sakharov, A. (1996). Specialization of imperative programs through analysis of relational expressions. 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_21

Download citation

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

  • 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