A theory of program modifications
The need to integrate several versions of a program into a common one arises frequently, but it is a tedious and time consuming task to merge programs by hand. The program-integration algorithm proposed by Horwitz, Prins, and Reps provides a way to create a semantics-based tool for integrating a base program with two or more variants. The integration algorithm is based on the assumption that any change in the behaviour, rather than the text, of a program variant is significant and must be preserved in the merged program. An integration system based on this algorithm will determine whether the variants incorporate interfering changes, and, if they do not, create an integrated program that includes all changes as well as all features of the base program that are preserved in all variants.
This paper studies the algebraic properties of the program-integration operation, such as whether there is a law of associativity. (For example, in this context associativity means: “If three variants of a given base are to be integrated by a pair of two-variant integrations, the same result is produced no matter which two variants are integrated first.”) Whereas an earlier work that studied the algebraic properties of program integration formalized the Horwitz-Prins-Reps integration algorithm as an operation in a Brouwerian algebra, this paper introduces a new algebraic structure in which integration can be formalized, called fmalgebra. In fm-algebra, the notion of integration derives from the concepts of a program modification and an operation for combining modifications. (Thus, while earlier work concerned an algebra of programs, this paper concerns an algebra of program modifications.)
The potential benefits of an algebraic theory of integration, such as the one developed in this paper, are actually three-fold:
It allows one to understand the fundamental algebraic properties of integration—laws that express the “essence of integration.” Such laws allow one to reason formally about the integration operation.
It provides knowledge that is useful for designing alternative integration algorithms whose power and scope are beyond the capabilities of current algorithms.
Because such a theory formalizes certain operations that are more primitive than the integration operation, an implementation of these primitive operations can form the basis for a more powerful program-manipulation system than one based on just the integration operation.
- Ferrante87.Ferrante, J., Ottenstein, K., and Warren, J., “The program dependence graph and its use in optimization,” ACM Transactions on Programming Languages and Systems 9(3) pp. 319–349 (July 1987).Google Scholar
- Horwitz89a.Horwitz, S., Pfeiffer, P., and Reps, T., “Dependence analysis for pointer variables,” Proceedings of the ACM SIGPLAN 89 Conference on Programming Language Design and Implementation, (Portland, OR, June 21–23, 1989), ACM SIGPLAN Notices, (1989).Google Scholar
- Horwitz89.Horwitz, S., Prins, J., and Reps, T., “Integrating non-interfering versions of programs,” ACM Trans. Program. Lang. Syst. 11(3) pp. 345–387 (July 1989).Google Scholar
- Horwitz90.Horwitz, S., Reps, T., and Binkley, D., “Interprocedural slicing using dependence graphs,” ACM Trans. Program. Lang. Syst. 12(1) pp. 26–60 (January 1990).Google Scholar
- Kuck81.Kuck, D.J., Kuhn, R.H., Leasure, B., Padua, D.A., and Wolfe, M., “Dependence graphs and compiler optimizations,” pp. 207–218 in Conference Record of the Eighth ACM Symposium on Principles of Programming Languages, (Williamsburg, VA, January 26–28, 1981), ACM, New York, NY (1981).Google Scholar
- McKinsey46.McKinsey, J.C.C. and Tarski, A., “On closed elements in closure algebras,” Annals of Mathematics 47(1) pp. 122–162 (January 1946).Google Scholar
- Ottenstein84.Ottenstein, K.J. and Ottenstein, L.M., “The program dependence graph in a software development environment,” Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, (Pittsburgh, PA, Apr. 23–25, 1984), ACM SIGPLAN Notices 19(5) pp. 177–184 (May 1984).Google Scholar
- Reps90.Reps, T., “Algebraic properties of program integration.,” in Proceedings of the Third European Symposium on Programming, (Copenhagen, Denmark, May 15–18, 1990), Lecture Notes in Computer Science, Vol. 432, ed. N. Jones,Springer-Verlag, New York, NY (1990).Google Scholar
- Weiser84.Weiser, M., “Program slicing,” IEEE Transactions on Software Engineering SE-10(4) pp. 352–357 (July 1984).Google Scholar
- Yang90.Yang, W., Horwitz, S., and Reps, T., “A program integration algorithm that accommodates semantics-preserving transformations,” Proceedings of the 4th ACM SIGSOFT Symposium on Software Development Environments, (Irvine, CA, December 3–5, 1990), ACM SIGSOFT Software Engineering Notes, (1990).Google Scholar