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.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, R. Sethi, J. D. Ullman, Compilers. Principles, Techniques, and Tools, Addison-Wesley, 1986.
L. O. Andersen. Partial Evaluation of C and Automatic Compiler Generation. Lecture Notes in Computer Science, v. 641, 1992, 251–257.
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.
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.
F. Bourdoncle. Abstract Debugging of Higher-Order Imperative Languages. Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, 1993, 47–55.
M. A. Bulyonkov. Polyvariant Mixed Computation for Analyzer Programs. Acta Informatica, v. 21, 1984, 473–484.
P.R. Carini, M. Hind. Flow-Sensitive Interprocedural Constant Propagation. Proceedings of the SIGPLAN Symposium on Programming Language Design and Implementation, 1995, 23–31.
C.-L. Chang, R. C.-T. Lee. Symbolic Logic and Mechanical Theorem Proving, Academic Press, 1973.
C. Consel, S.C. Khoo. Parameterized Partial Evaluation. ACM Transactions on Programming Languages and Systems, v. 15, 1993, #3, 463–493.
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.
C.N. Fisher, R.J. LeBlanc, Jr. Crafting A Compiler, Benjamin/Cummings, 1988.
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.
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.
M.S. Hecht. Flow Analysis of Computer Programs, Elsevier North-Holland, 1977.
H. Johnson. Data Flow Analysis for ‘Intractable’ System Software. Proceedings of the ACM SICPLAN Conference on Programming Language Design and Implementation, 1986, 109–117.
N. Jones. The Essence of Program Transformation by Partial Evaluation and Driving. Lecture Notes in Computer Science, v. 792, 1994, 206–224.
N.D. Jones, C. K. Gomard, P. Sestoft. Partial Evaluation and Automatic Program Generation, Prentice Hall, 1993.
J.B. Kam, J.D. Ullman. Monotone Data Flow Analysis Frameworks. Acta Informatica, v. 7, 1977, 305–317.
D.E. Knuth, P.B. Bendix. Simple Word Problems in Universal Algebras. In: Computational Problems in Abstract Algebra (J. Leech, Ed.), Pergamon Press, 1970.
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.
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.
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.
S. Sagiv et al. A Logic-Based Approach to Data Flow Analysis Problems. Lecture Notes in Computer Science, v. 456, 1990, 52–65.
A. Sakharov. Propagation of Constants and Assertions. SIGPLAN Notices, v. 29, 1994, #5, 3–6.
B. Wegbreit. Property Extraction in Well-Founded Property Sets. IEEE Transactions on Software Engineering, v. 1, 1977, #3, 270–285.
M.N. Wegman, F.K. Zadeck. Constant Propagation with Conditional Branches. ACM Transactions on Programming Languages and Systems, v. 13, 1991, #2, 181–210.
Author information
Authors and Affiliations
Editor information
Rights 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