Abstract
Program transformation is a promising area of software methodology. The Folding/Unfolding method proposed by Burstall/Darlington is a simple and powerful transformation method for applicative programs. The only operations used are folding and unfolding of function definitions and substitution using laws. The major drawback of this method is that only partial correctness of functions is preserved and termination may be lost. That is if functionf 1 is transformed tof n , the computation off n on an objectx will reach the same result of the computation off 1 onx, provided the computation terminates. But there may be objectsx, on which the computation off 1 terminates, butf n does not. This problem has not been solved with satisfaction. The idea of “reductive measure” of functions and “reductive” transformation is put forward here to solve the problem. It has been proved that if functions “complexity” is not increased under some reductive measure in the transformation process, termination will be preserved. The termination problem is thus solved to some extent. The most important thing is that the simplicity of the original method is fully preserved. Because with the help of FP algebraic laws, the new restriction is expressed completely syntatically. Namely, only the direction of using laws (algebraic equations) for substitution is restricted.
Similar content being viewed by others
References
J. Backus, Can programming be liberated from the Von Neumann style? a functional style and its algebra of programs.CACM,21:8 (1978).
J. Backus, The Algebra of Functional Programs; Function Level Reasoning, Linear Equations and Extended Definitions, Tech. Rept. IBM Research Lab., San Jose, California, Feb., 1981.
J. H. Williams, On the Development of the Algebra of Functional Programs. Tech. Rept., Rj2983, IBM Research Lab., San Jose, California, Oct., 1980.
R. M. Burstall and J. Darlington, A transformation system for developing recursive programs,JACM,23 1 (1977).
Huang Xuorong, Termination Preserving Problem in Program Transformation, Master's Thesis. Shanghai Jiaotong Univ., Jan., 1985.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Sun, Y., Lu, R. & Huang, X. Termination preserving problem in the transformation of applicative programs. J. of Comput. Sci. & Technol. 2, 191–201 (1987). https://doi.org/10.1007/BF02973504
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02973504