REMOVING RECURSION FROM PROGRAMS WITH ARRAYS
DOI:
https://doi.org/10.63075/kf6tnn86Keywords:
Transformational Programming, Transformation Rules, Efficient Programs, Optimized Code, Intermediate Stages, Recursion, Folding, Unfolding And Iteration.Abstract
Transformational programming is the methodology of program development which proceeds through application of successive correctness preserving transformation rules until ultimately a desired and efficient implementation is achieved. It starts from the formal specification and ends with the optimized code. During this process numerous intermediate versions are typically developed. One of the intermediate stages of the process can involve transforming a recursive algorithm into an iterative one by applying recursion removal transformational rules. In this paper, removing recursion form programs involving arrays is discussed and rules to transform the situations of arithmetic operations application on the contents of the elements and manipulating these elements are developed. Different applications of these rules are also discussed in this paper.