Abstract

This paper discusses a family of algorithms for transforming a recursive program into an equivalent program with a simplified recursion structure. The simplification is performed by integrating copies of certain procedures into the bodies of other procedures. This procedure integration process is analogous to macroexpansion, involving procedure calls rather than macro-operators. We measure the complexity of the recursion structure in terms of the calling graph of the program. This is a directed graph with nodes representing the procedures of the program and arcs representing the relation “calls”. We say that the recursion structure is complex if there is a high degree of cross linkage resulting in a small number of large strongly connected components in the graph; and we say it is simple, if the strongly connected regions are small, preferably containing one node each. One algorithm in our family is optimal in the sense that it finds a program with the same number of procedures and the maximum number of strongly connected regions obtainable via macroexpansion of procedure calls. We discuss suboptimal algorithms which require less running time, and we discuss open problems related to finding simplification algorithms optimal with respect to a wide range of transformations including the inverse of macroexpansion. In particular, we present a very simple open problem concerning the decidability of the word problem for certain semigroups.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call