Nothing Special   »   [go: up one dir, main page]

skip to main content
article
Free access

A program integration algorithm that accommodates semantics-preserving transformations

Published: 01 July 1992 Publication History

Abstract

Given a program Base and two variants, A and B, each created by modifying separate copies of Base, the goal of program integration is to determine whether the modifications interfere, and if they do not, to create an integrated program that includes both sets of changes as well as the portions of Base preserved in both variants. Text-based integration techniques, such as the one used by the Unix diff3 utility, are obviously unsatisfactory because one has no guarantees about how the execution behavior of the integrated program relates to the behaviors of Base, A, and B. The first program-integration algorithm to provide such guarantees was developed by Horwitz et al.[13]. However, a limitation of that algorithm is that it incorporates no notion of semantics-preserving transformations. This limitation causes the algorithm to be overly conservative in its definition of interference. For example, if one variant changes the way a computation is performed (without changing the values computed) while the other variant adds code that uses the result of the computation, the algorithm would classify those changes as interfering. This paper describes a new integration algorithm that is able to accommodate semantics-preserving transformations.

References

[1]
AHO, A., HOPCROFT, J. E., AND ULLMAN, J. The Destgn and Analysis of Computer Algorithms. Addison-Wesley, Reading, MA, 1974.
[2]
AHO, A., SETHI, R., AND ULLMAN, J. Compilers: Principles, Techniques and Tools. Addison- Wesley, Reading, MA, 1986.
[3]
ALLEN, F. E. AND COCKE, J.A. A catalogue of optimizing transformations. In Deszgn and Optimtzation of Compilers, R. Rustin, Ed. Prentice-Hall, Englewood Cliffs, NJ, 1972, pp. 1-30.
[4]
ALPERN, B., WEGMAN, M. N., AND ZADECK, F.K. Detecting equality of variables in programs. In Conference Record of the Fifteenth ACM Symposium on Principles of Programming Languages (San Diego, CA, Jan. 13-15, 1988), ACM, New York 1988, pp. 1-11.
[5]
BALLANCE, R. A., MACCABE, A. B. AND OTTENSTEIN, K.J. The program dependence web: A representation supporting control-, data-, and demand-driven interpretation of imperative languages. In Proceedings of the ACM SIGPLAN 90 Conference on Programming Language Design and Implementation (White Plains, NY, June 20-22, 1990). SIGPLAN Notices 25, 6 (June, 1990), 257-271.
[6]
BERZINS, V. On merging software extensions. Acta Inf. 23 (1986), 607-619.
[7]
CYTRON, R., FERRANTE, J., ROSEN, B. K., WEGMAN, M. N., AND ZADECK, K. An efficient method of computing static single assignment form. In Conference Record of the Sixteenth ACM Symposium on Prtnciples of Programming Languages (Austin, TX, Jan. 11-13, 1989), ACM, New York, NY, 1989, pp. 25-35.
[8]
DENNIS, J. B. First version of a data flow procedure language. In Programming Symposium: Proceedings, Colloque sur la Programmation, Lecture Notes in Computer Science, 19, B. Robinet, Ed. Springer-Verlag, New York, 1974, pp. 362-376.
[9]
DOWNEY, P. J. SETHI, R., AND TARJAN, R. E. Variations on the common subexpression problem. J. ACM 27, 4 (Oct. 1980), 758-771.
[10]
FEATHER, M.S. Detecting interference when merging specification evolutions. Unpublished report, Information Sciences Inst. Univ. of Southern California, Marina del Rey. CA, 1989.
[11]
FERRANTE, J., OTTENSTEIN, K., AND WARREN, J. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (July, 1987), 319-349.
[12]
HOPCROFT, j.E. An n log n algorithm for minimizing the states of a finite automaton. In The Theory of Machines and Computations, 1971, pp. 189-196.
[13]
HORWITZ, S, PmNS, J., AND RF, PS, T. Integrating non-interfering versions of programs ACM Trans. Program. Lang. Syst. 11, 3 (July, 1989), 345-387.
[14]
HORWITZ, S. AND REPS, T Efficmnt comparison of program slices. To appear in Acta Inf., 1991.
[15]
KUCK, D. J., KUHN, I%. H., LEASURE, B., PADUA, D. A, AND WOLFE, M. Dependence graphs and compiler optlmlzatlons In Conference Record of the Eighth ACM Syrnposzum on Prtnctples of Programmzng Languages (Williamsburg, VA, Jan. 26-28, 1981), ACM, New York 1981, pp 207-218.
[16]
LAKH()TIA, A AND STERLING, L. Composing recursive logic programs with clausal join. New Gen. Comput. 6, 2 (1988), 211-225
[17]
LOVEMAN, D.B. Program improvement by source-to-source transformation. J ACM 20, 1 (Jan. 1977), 121-145.
[18]
NELSON, G. AND OPPEN, D C. Fast decision procedures based on congruence closure J ACM 27, 2 (Apr. 1980), 356-364.
[19]
OTTENSTEIN, K. J. AND OTTENSTEIN, L.M. The program dependence graph in a software development environment In Proceedzngs of the ACM SIGSOFT / SIGPLAN Software Engzneering Symposium on Practical Software Development Environments (Pittsburgh, PA, Apr. 23-25, 1984), SIGPLAN Notzces 19, 5 (May, 1984), 177-184.
[20]
RAMALINGAM, G. Personal commumcabon 1989
[21]
RAMALINGAM, G. AND REPS, T. Semantics of program representation graphs. Tech Rep. 900, Dept. of Computer Sciences, Univ. of Wisconsin, Madison, Dec. 1989.
[22]
REPS, T. AND YANG, W. The semantics of program shcing. Tech. Rep. 777, Dept. of Computer Sciences, Univ. of Wisconsin, Madison, June, 1988
[23]
REPS, T. AND YANG, W. The semantics of program shcing and program mtegratmn. In Proceedzngs of the Colloquzum on Current Issues zn Programmzng Languages (Barcelona, March 13-17, 1989), pp. 360-374. Lecture Notes zn Computer Sczence 3,52, Springer-Verlag, New York, 1989.
[24]
RICH, C. Inspection methods m programmmg: chch~s and plans. A.I. Memo No. 1005, Artificial Intelhgence Laboratory, M.I T., Cambridge, MA, Dec 1987
[25]
ROSEN, B., WEGMAN, M. N., AND ZADECK, F K. Global value numbers and redundant computations. In Conference Record o/ the Fzfteenth ACM Symposium on Pmnczples of Programmzng Languages (San Diego, CA, Jan. 13-15, 1988), ACM, New York 1988, pp. 12-27
[26]
WEISER, M. Program slicing. IEEE Trans Soflw. Eng. SE-10, 4 (July, 1984), 352-357.
[27]
YANG, W., HORWlTZ, S., AND REPS, T Detecting program components w~th equivalent behaviors Tech Rep. 840, Dept of Computer Sciences, Umv. of Wisconsin, Madison, Apr. 1989.
[28]
YANG, W., HORWYrZ, S., AND REPS, T. A program integration algorithm that accommodates semanhcs-preserwng transformatmns, in Proceedings of the Fourth Syrnpos~um on So/tware Development Envzronrnents (Irvine, CA, Dec 3-5, 1990), ACM, New York, 1990, pp. 133-143
[29]
YANG, W. A new algorithm for semantics-based program integration. Ph.D. dissertation and Tech. Rep. 962, Dept of Computer Smences, Umv. of W~sconsin, Ma&son, Aug. 1990.

Cited By

View all
  • (2024)Lightweight Semantic Conflict Detection with Static AnalysisProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3643118(343-345)Online publication date: 14-Apr-2024
  • (2023)DeepMerge: Learning to Merge ProgramsIEEE Transactions on Software Engineering10.1109/TSE.2022.318395549:4(1599-1614)Online publication date: 1-Apr-2023
  • (2022)Semantic conflict detection with overriding assignment analysisProceedings of the XXXVI Brazilian Symposium on Software Engineering10.1145/3555228.3555242(435-445)Online publication date: 5-Oct-2022
  • Show More Cited By

Recommendations

Reviews

Peter N. van den Bosch

A program may be developed into two variants—possibly because it is available on a popular operating system and is enhanced independently and with different intent at two sites—which do not interfere in the sense that they expect a variable to have different values at the same point in an execution trace. It may be desirable to merge these versions with the original in such a way that the enhancements are present and the original semantics are otherwise preserved. The problem is undecidable, but may be conservatively satisfied: the trick is to be as liberal as possible. Textual merger programs that produce an update file (a cost-saving device for distributing versions to a large number of sites in compact form) have existed for some time, but they do not have any sense of semantics and therefore have a coarse conception of interference that may be both too liberal and too conservative, depending on the individual case. Earlier work contributed to by two of the three authors [1] used a variant of dataflow graphs, long used in program optimization, and a slicing operation on these to determine a safe superset of “changed” computations and then merged these provided they did not lead to nondeterministic data flow such as would be caused by semantic interference. The resulting algorithm was so conservative, however, that it frequently failed to integrate noninterfering variants. As in the earlier paper, the focus here is on a simplified but computationally complete programming language. The new algorithm adapts ideas from basic block optimization to detect equivalent computations and so eliminate one common source of apparent interference; program integration is also generalized from the earlier formulation so that it is now independent of the equivalence detection, which may be separately refined. The paper is long (a lengthy proof fills an appendix that accounts for more than a quarter of its length, however), but the development is well organized, going to the unusual length (for a technical paper) of providing signposts for the first-time reader by anticipating questions that may not be answered until a later section. It also has the rare virtue of being essentially self-contained: even ideas imported from what are now textbook subjects (such as fsa minimization and basic block optimization) are well documented. The scope for further work in several areas promises this paper a long life in the reference lists of computing literature. Two areas spring to mind: extending the linguistic expressiveness to procedures—probably using ideas from global optimization—and refining the equivalence detection techniques to deal with two juicy examples presented with rare candor.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 1, Issue 3
July 1992
150 pages
ISSN:1049-331X
EISSN:1557-7392
DOI:10.1145/131736
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 1992
Published in TOSEM Volume 1, Issue 3

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. coarsest partition
  2. control dependence
  3. data dependence
  4. data-flow analysis
  5. flow dependence
  6. program dependence graph
  7. program integration
  8. program representation graph
  9. static-single-assignment form

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)59
  • Downloads (Last 6 weeks)11
Reflects downloads up to 23 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Lightweight Semantic Conflict Detection with Static AnalysisProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3643118(343-345)Online publication date: 14-Apr-2024
  • (2023)DeepMerge: Learning to Merge ProgramsIEEE Transactions on Software Engineering10.1109/TSE.2022.318395549:4(1599-1614)Online publication date: 1-Apr-2023
  • (2022)Semantic conflict detection with overriding assignment analysisProceedings of the XXXVI Brazilian Symposium on Software Engineering10.1145/3555228.3555242(435-445)Online publication date: 5-Oct-2022
  • (2020)Towards understanding and fixing upstream merge induced conflicts in divergent forksProceedings of the ACM/IEEE 42nd International Conference on Software Engineering: Software Engineering in Practice10.1145/3377813.3381362(172-181)Online publication date: 27-Jun-2020
  • (2019)Semistructured merge in JavaScript systemsProceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2019.00098(1014-1025)Online publication date: 10-Nov-2019
  • (2019)Redundancy-free analysis of multi-revision software artifactsEmpirical Software Engineering10.1007/s10664-018-9630-924:1(332-380)Online publication date: 1-Feb-2019
  • (2017)Reducing redundancies in multi-revision code analysis2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER)10.1109/SANER.2017.7884617(148-159)Online publication date: Feb-2017
  • (2016)Decompiling Boolean Expressions from Java™ BytecodeProceedings of the 9th India Software Engineering Conference10.1145/2856636.2856651(59-69)Online publication date: 18-Feb-2016
  • (2016)Delta Refactoring for Merge Conflict AvoidanceProceedings of the 9th India Software Engineering Conference10.1145/2856636.2856640(26-36)Online publication date: 18-Feb-2016
  • (2012)Clone Management for Evolving SoftwareIEEE Transactions on Software Engineering10.1109/TSE.2011.9038:5(1008-1026)Online publication date: 1-Sep-2012
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media