Mechanical elimination of commutative redundancy
A technique to eliminate computational redundancy from a large and automatically detectable class of non-linear functions is introduced. It combines the advantages of existing memoisation and source-to-source program transformation techniques whilst greatly reducing the major disadvantages that are commonly associated with these two approaches. The method presented here uses a variant of memo-functions in which, regardless of the size of the memo-tables, the cost of table insertion and lookup operations are almost entirely eliminated. When compared to contemporary program transformation schemes, the technique presented achieves comparable improvements in efficiency whilst being mechanical. In addition, this technique is more generally applicable and require less compile-time deductive capacity than the corresponding program transformation schemes.
More precisely, the paper outlines a new technique for eliminating commutative redundancy from bilinear functions using local transient memo-lists instead of global memo-tables. Function evaluation is carried out in a bottom-up manner in which the results of inner nodes of the dependency graph are calculated first, and then only passed to those nodes higher-up in the graph that require them. In this way memo-lists “ripple” out from the inner nodes, and are subsequently used to generate new memo-lists for the next ripple. This technique overcomes the management cost of memo-tables, since table insertions and look-ups are now replaced by a single list cons and head operations respectively. Furthermore, it has some scope for parallel evaluation.
Keywordsfunction level reasoning memoisation program transformation
Unable to display preview. Download preview PDF.
- 2.J W Backus. The algebra of functional programs: function level reasoning, linear equations and extended definitions, volume 107, chapter 1, pages 1–43. Springer-Verlag, 1981.Google Scholar
- 3.R Bailey, A J Field, and H Khoshnevisan. Efficient implementation of functional programs. Research Report, Imperial College, 1986.Google Scholar
- 5.R S Bird. Improving programs by the introduction of recursion. Communications of the ACM, 20(1):856–863, 77.Google Scholar
- 6.R M Burstall and J D Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1), 1977.Google Scholar
- 8.J Darlington. A synthesis of several sorting programs. Acta Informatica, 11(1), 1978.Google Scholar
- 12.H Khoshnevisan. Efficient memo-table management strategies. Acta Informatica, 28:43–81, 1990.Google Scholar
- 13.M S Paterson, and C E Hewitt. Comparative schematology, record of project mac. In Proceedings: Conference on Concurrent Systems and Parallel Computation, Woods Hole, Mass, pages 119–127, June 1970.Google Scholar