• Medientyp: E-Artikel
  • Titel: Safe fusion of functional expressions II: Further improvements
  • Beteiligte: Chin, Wei-Ngan
  • Erschienen: Cambridge University Press (CUP), 1994
  • Erschienen in: Journal of Functional Programming
  • Sprache: Englisch
  • DOI: 10.1017/s0956796800001179
  • ISSN: 0956-7968; 1469-7653
  • Schlagwörter: Software
  • Entstehung:
  • Anmerkungen:
  • Beschreibung: <jats:title>Abstract</jats:title><jats:p>Large functional programs are often constructed by decomposing each big task into smaller tasks which can be performed by simpler functions. This hierarchical style of developing programs has been found to improve programmers' productivity because smaller functions are easier to construct and reuse. However, programs written in this way tend to be less efficient. Unnecessary intermediate data structures may be created. More function invocations may be required.</jats:p><jats:p>To reduce such performance penalties, Phil Wadler proposed a transformation algorithm, called <jats:italic>deforestation</jats:italic>, which could automatically <jats:italic>fuse</jats:italic> certain composed expressions together to eliminate intermediate tree-like data structures. However, his technique is currently safe (terminates with no loss of efficiency) for only a subset of first-order expressions.</jats:p><jats:p>This paper will generalise the deforestation technique to make it safe for all first-order and higher-order functional programs. Our generalisation is explained using a model for <jats:italic>safe fusion</jats:italic> which views each function as a producer and its parameters as consumers. Through this model, syntactic program properties are proposed to classify producers and consumers as either safe or unsafe. This classification is used to identify sub-terms that can be safely fused/eliminated. We present the generalised transformation algorithm, illustrate it with examples and provide a termination proof for the transformation algorithm of first-order programs. This paper also contains a suite of additional techniques to further improve the basic safe fusion method. These improvements could be viewed as enhancements to compensate for some inadequacies of the syntactic analyses used.</jats:p>
  • Zugangsstatus: Freier Zugang