Towards a Modular Program Derivation via Fusion and Tupling
نویسندگان
چکیده
We show how programming pearls can be systematically derived via fusion, followed by tupling transformations. By focusing on the elimination of intermediate data structures (fusion) followed by the elimination of redundant calls (tupling), we systematically realise both space and time efficient algorithms from naive specifications. We illustrate our approach using a well-known maximum segment sum (MSS) problem, and a less-known maximum segment product (MSP) problem. While the two problems share similar specifications, their optimised codes are significantly different. This divergence in the transformed codes do not pose any difficulty. By relying on modular techniques, we are able to systematically reuse both code and transformation in our derivation. This paper has been presented at The First ACM SIGPLAN Conference on Generators and Components, Affiliated with PLI 2002, Pittsburgh, PA, USA, October 6-8, 2002.
منابع مشابه
A Modular Derivation Strategy via Fusion and Tupling
We show how programming pearls can be systematically derived via fusion, followed by tupling transformations. By focusing on the elimination of intermediate data structures (fusion) followed by the elimination of redundant calls (tupling), we can systematically realise both space and time e cient algorithms from naive speci cations. We illustrate our approach using a well-known maximum segment ...
متن کاملA Case Study on a Modular Transformation Strategy
Transformational programming is a well-known methodology to derive both correct and e cient programs. But it often requires deep insights to make major jumps during derivation, and so it remains unclear how general a derivation for one problem can be applied to others, particularly to those whose e cient algorithms are unknown. In this paper, we show that it is possible to minimize these deep i...
متن کاملFormal Derivation of Parallel Program for 2-Dimensional Maximum Segment Sum Problem
It has been attracting much attention to make use of list homomorphisms in parallel programming because they ideally suit the divide-and-conquer parallel paradigm. However, they have been usually treated rather informally and ad-hoc in the development of e cient parallel programs. This paper reports a case study on systematic and formal development of a new parallel program for the 2-dimensiona...
متن کاملRedundant Call Elimination via Tupling
Redundant call elimination has been an important program optimisation process as it can produce super-linear speedup in optimised programs. In this paper, we investigate use of the tupling transformation in achieving this optimisation over a first-order functional language. Standard tupling technique, as described in [6], works excellently in a restricted variant of the language; namely, functi...
متن کاملCalculating risk in functional programming
In the trend towards tolerating hardware unreliability, accuracy is exchanged for cost savings. Running on less reliable machines, “functionally correct” code becomes risky and one needs to know how risk propagates so as to mitigate it. Risk estimation, however, seems to live outside the average programmer’s technical competence and core practice. In this paper we propose that risk be construct...
متن کامل