Towards a Modular Program Derivation via Fusion and Tupling

  • Authors:
  • Wei-Ngan Chin;Zhenjiang Hu

  • Affiliations:
  • -;-

  • Venue:
  • GPCE '02 Proceedings of the 1st ACM SIGPLAN/SIGSOFT conference on Generative Programming and Component Engineering
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 andtime efficient algorithms from naive specifications. We illustrate our approach using a well-known maximum segment sum (MSS) problem, anda less-known maximum segment product (MSP) problem. While the two problems share similar specifications, their optimisedco des 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.