ACM Home Page
Please provide us with feedback. Feedback
Transformational programming: applications to algorithms and systems
Full text PdfPdf (951 KB)
Source Annual Symposium on Principles of Programming Languages archive
Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages table of contents
Austin, Texas
Pages: 73 - 87  
Year of Publication: 1983
ISBN:0-89791-090-7
Author
Robert Paige  Rutgers University, New Brunswick, NJ
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
SIGACT: ACM Special Interest Group on Algorithms and Computation Theory
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 4,   Downloads (12 Months): 39,   Citation Count: 9
Additional Information:

abstract   references   cited by   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/567067.567076
What is a DOI?

ABSTRACT

Ten years ago Cheatham and Wegbreit [4] proposed a transformational program development methodology based on notions of top-down stepwise program refinement first expressed by Dijkstra [10] and Wirth [45]. A schema describing the process of this methodology is given in fig. 1. To develop a program by transformation, we first specify the program in as high a level of abstraction and as great a degree of clarity as our programming language admits. This high level problem statement program P is proved correct semimechanically according to some standard approach (see Flovd and Hoare [15, 21]), Next, using an interactive system equipped with a library of encoded transformations, each of which maps a correct program into another equivalent program, we select and apply transformations one at a time to successive versions of the program until we obtain a concrete, low level, effecient implementation version P'. The goals of transformational programming are to reduce programming labor, improve program reliability, and upgrade program performance. In order for labor to be reduced, the effort required to obtain P, prove it correct, and derive P' by transformation should be less than the effort required to code P from scratch, and also to debug it. Program reliability will be improved if P can be certified correct, and if each transformation preserves program meaning. Finally, program performance will be upgraded if transformations are directed towards increased efficiency.

Experimental transformational systems that emphasize one or more aspects of the methodology outlined above have been implemented by Cheatham [5], Darlington [3], Loveman [27], Standish [41], Feather [14] Huet and Lang [11], and others. However, all of these systems fall short of the goals, because of a number of reasons that include,

1 inability to mechanize the checking of transformation applicability conditions

2 reliance on large, unmanageable collections of low level transformations, and long arduous derivation sequences

3 dependency on transformations whose potential for improving program performance is unpredictable

4 use of source languages insufficiently high level to accommodate perspicuous initial program specifications and powerful algorithmic transformations

Yet, convincing evidence that this new methodology will succeed has come from recent advances in verification, program transformations, syntax directed editting systems, and high level languages. These advances, discussed below, represent partial solution to the problems stated above, and could eventually be integrated into a single system

1 The transformational approach to verification was pioneered by Gerhart [19] and strengthened by the results of Schwartz [39], Scherlis [36], Broy et al [2], Koenig and Paige [26.31] Blaustein [1], and others. Due mainly to improved technology for the mechanization of proofs of enabling conditions that justify application of transformations, this approach is now at a point where it can be effectively used in a system. Such mechanization depends strongly on program analysis, and, in particular, on reanalyses after a program is modified. Attribute grammars [24] have been shown to be especially useful in facilitating program analysis [23]. Moreover, Reps [34] has discovered algorithm that reevaluates attributes in optimal time after a program undergoes syntax directed editing changes (as are allowed on the Cornell Synthesizer [43]). He has implemented his algorithm recently, and has reported initial success

2 There are encouraging indications that a transformational system can be made to depend mainly on a small but powerful collection of transformations applied top-down fashion to programs specified at various levels of abstraction from logic down to assembler. We envision such a system as a fairly conventional semiautomatic compiler which classes of transformations are selected semimechanically in a predetermined order, and are justified by predicates supplied mechanically but proved semimanually. Of particular importance is nondeterminism removal which has formulated by Sharir [40] could lead to a technique for turning naive, nondeterministic programs into deterministic programs with emergent strategies. Such programs could then be transformed automatically by finite differencing [13, 16, 17, 18, 29, 30, 31] and jamming [28, 31, 20] (which we have implemented) into programs whose data access paths are fully determined. The SETL optimizer could improve these programs further by automatically choosing efficient data structure representations and aggregations

3 Of fundamental importance to the transformations just mentioned is the fact that they can be associated with speedup predictions Fong and Ullman [16] were the first to characterize an important class of algorithmic differencing transformations in terms of accurate asymptotic speedup predictions, eg, they gave conditions under which repeated calculation of a set former {x in s|k(x)} could be computed on O(#s) + cost(k) steps. By considering stronger conditions and special cases for the boolean valued subpart k, Paige [31] later gave sharper speedup predictions (eg, either O(1) steps for each encounter of the set former or a cumulative cost of O(#s) steps for every encounter) associated with another differencing method. Both Morgenstern [28] and Paige [31] prove constant factor improvements due to their jamming transformations (implemented by Morgenstern for the improvement of file processing, and by Paige for the optimization of programs). Constant factor speedup has also been observed for data structure selection by the method of basings but a supporting analytic study has not been presented [8, 37]

4 Essential to the whole transformational process is a wide spectrum programming language (or set of languages) that can express a program at every stage of development from the initial abstract specification down to its concrete implementation realization. Since transformations applied to programs written at the highest levels of abstraction are likely to make the most fundamental algorithmic changes, it is important to stress abstract features in our language. In addition to supporting transformations, the highest level language dictions should support lucid initial specifications, verification, and even program analysts. Of special importance is SETL [38, 9], because its abstract set theoretic dictions can model data structures and algorithms easily, because its philosophy of avoiding hidden a symptotic costs facilitates program analysis, because its semantics conforms to finite set theory and can accommodate a set theoretic program logic, and because it is wide spectrum. As is evidenced by the work of Schwartz, Fong, Paige, and Sharir, SETL is also a rich medium for transformation.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Blaustein, Barbara T. Enforcing Database Assertions Techniques and Applications Tech Rept TR-21-81, Center for Research in Computing Technology, Harvard University, Aug, 1981
 
2
Broy, M, Partsch, H, Pepper, P, and Wirsing, M "Semantic Relations in Programming Languages' Information Processing 80 (1980)
3
 
4
Cheatham, T. E., and Wegbreit, Ben. A Laboratory for the Study of Automating Programming Proc AFIPS 1972 Spring Joint Computer Conf., 1972
 
5
 
6
7
8
 
9
Dewar, Robert. The SETL Programming Language. Manuscript
 
10
 
11
Donzeau-Gouge, V., Huet, G., Kahn, G., Lang. B Programming environments based on structured editors: the Mentor Experience Tech. Rept Rapport de Recherche No 26, INRIA, Rocquencourt, France, July, 1980.
12
 
13
Earley, Jay. 'High Level Iterators and a Method for Automatically Designing Data Structure Representation' Journal of Computer Languages 1 (1976), 321-342
 
14
Feather, Martin S A System for Developing Programs by Transformation. Ph.D. Th., U. of Edinburgh, 1979
 
15
Floyd, Robert W. Assigning Meaning to Programs. Proceedings of Symposia on Applied Mathematics Vol XIX, American Mathematics Society, Providence, R I., 1967
16
17
18
19
 
20
Goldberg, Allen, Paige, Robert. Loop Fusion. unpublished manuscript
21
 
22
Katzenelson, J. "Clusters and Dialogues for Set Implementations." IEEE Trans. on Software Engineering SE-5. 3 (May 1979).
 
23
Kennedy, Ken. A Survey of Complier Optimization Techniques. In Program Flow Analysis, Muchnick, S. Jones, N, Eds., Prentice Hall, 1981, pp. 5-54.
 
24
Knuth, D E "Semantics of Context-free Languages' Mathematical Systems Theory, 2. 2 (1968)
 
25
Knuth, D. E. Fundamental Algorithms. Addison-Wesley, 1968.
 
26
Koenig, Shaye. A Transformational Framework for Automatic Derived Data Control and Its Applications in an Entity-Relationship Data Model Tech Rept LCSR-TR-23, Rutgers University, Dept of Computer Science. 1981. New Brunswick, N. J
27
 
28
Morgenstern, Matthew. Automated Design and Optimization of Management Information System Software Ph.D Th., MIT, Laboratory for Computer Science, Sep 1976.
29
 
30
Paige, Robert Formal Differentiation. UMI Research Press, 1981. Revision of Ph.D. thesis, NYU. June 1979
31
 
32
Paige Robert. RAPTS - The Rutgers Abstract Program Transformation System Compiler Demonstration, Symp on Cmpiler Construction, Boston
 
33
Paige, Robert. An Efficient Implementation of Finite Differencing Dept of Computer Science, Rutgers University, Dec. 1982
34
 
35
Rosen, B. K. Degrees of Availability In Program Flow Analysis, Muchnick, S., Jones, N., Eds., Prentice Hall, 1981, pp 55 - 76.
36
37
 
38
Schwartz, J T., On Programming: An Interim Report on the SETL Project, Installments I and II. ClMS. New York Univ., NewYork, 1974.
 
39
Schwartz, J T Correct Program Technology. Tech Rept. Courant Computer Science Report Num.12. New York Unversity. Dept of Computer Science, Sep. 1977
 
40
Sharir, M Some Observations on Formal Differentiation. New, York University, Dept of Computer Science, 1980
 
41
Standish, Thomas An Example of Program Improvement Using Source-to-Source Transformations Univ. of Cal at Irvine, Dept of Information and Computer Science, Feb, 1976.
42
43
 
44
Wegbreit, B "Goal-directed program transformation" IEEE Trans. Software Engineering SE-2, 2 (June 1976)
45

CITED BY  9