A powerful strategy for deriving efficient programs by transformation
A powerful strategy for deriving efficient programs by transformation
复制标题
通过转型获得高效计划的强大策略
DOI:
10.1145/800055.802044
复制
发表时间:
1984
期刊:
影响因子:
--
通讯作者:
A. Pettorossi
中科院分区:
文献类型:
--
作者:
A. Pettorossi
We present a method for deriving efficient iterative programs by transformation from recursive equation specifications. It consists of two phases: i) the transformation of general recursive programs into linear recursive ones, and ii) the transformation of linear recursive programs into iterative ones.
In the first phase we apply the “tupling strategy” studied in [BUD77, Pet77], and implicitly used by other authors in the area of program transformation. That strategy enables us to introduce linear recursive functions, instead of the general recursive ones occurring in program specifications.
In the second phase we apply known methods for transforming linear recursion into iteration (avoiding the use of stacks) [WaS73], and equivalence results between recursive schemas and flowchart schemas.
Through various examples we show how the breaking of the transformation process into the above mentioned phases allows the derivation of efficient iterative algorithms.
Those examples include challenges by Prof. E. Dijkstra and other authors. Through our method we were also able to improve some recent results for eliminating redundant calls in recursive programs [Coh83].