The authors make a contribution to software reusability through the use of program transformation tools. The idea is, given the specification and implementation for a software component or an entire program, to help restructure the implementation through a technique called specialization. When a software module with a particular functionality is needed, a library of reusable modules of generalized functionality is searched for a suitable module. In general, candidate modules will require some transformation. For example, their functionalities must be restricted in order to improve efficiency, that is, they must be specialized for a particular application. Suppose that the generalized module P is a function mapping its domain D P to its range R P and that the desired module M will have the same functionality as P but with a domain D M ⊂ D P, then the aim of the specialization will be to transform P into a P′ that is more efficient than P. For example, if P contains the statement “if C then S 1 else S 2,” and D M ⊂ D P implies that C is always true, the statement may be transformed into S 1. In this paper, the authors discuss specialization through symbolic execution.
The paper describes the process of symbolic execution and simplification used for the specialization of a program; this process is defined formally using denotational semantics. Other specialization steps such as loop refolding and the application of conventional source-level optimization techniques are described. A complete specialization environment for Ada programs and a complete example are also presented. Finally, the authors assess the work and discuss further developments and applications, particularly in the area of object-oriented languages.