Results 1 
8 of
8
Rules and Strategies for Transforming Functional and Logic Programs
 ACM Computing Surveys
, 1996
"... We present an overview of the program transformation methodology, focusing our attention on the socalled `rules + strategies' approach in the case of functional and logic programs. The paper is intended to offer an introduction to the subject. The various techniques we present are illustrated via s ..."
Abstract

Cited by 72 (4 self)
 Add to MetaCart
We present an overview of the program transformation methodology, focusing our attention on the socalled `rules + strategies' approach in the case of functional and logic programs. The paper is intended to offer an introduction to the subject. The various techniques we present are illustrated via simple examples. A preliminary version of this report has been published in: Moller, B., Partsch, H., and Schuman, S. (eds.): Formal Program Development. Lecture Notes in Computer Science 755, Springer Verlag (1993) 263304. Also published in: ACM Computing Surveys, Vol 28, No. 2, June 1996. 3 1 Introduction The program transformation approach to the development of programs has first been advocated by [BurstallDarlington 77], although the basic ideas were already presented in previous papers by the same authors [Darlington 72, BurstallDarlington 75]. In that approach the task of writing a correct and efficient program is realized in two phases: the first phase consists in writing an in...
Generic Program Transformation
 Proc. 3rd International Summer School on Advanced Functional Programming, LNCS 1608
, 1998
"... ion versus efficiency For concreteness, let us first examine a number of examples of the type of optimisation that we wish to capture, and the kind of programs on which they operate. This will give us a specific aim when developing the machinery for automating the process, and a yardstick for evalu ..."
Abstract

Cited by 30 (5 self)
 Add to MetaCart
ion versus efficiency For concreteness, let us first examine a number of examples of the type of optimisation that we wish to capture, and the kind of programs on which they operate. This will give us a specific aim when developing the machinery for automating the process, and a yardstick for evaluating our results. 2.1 Minimum depth of a tree Consider the data type of leaf labelled binary trees: dataBtreea = Leaf a j Bin (Btree a)(Btree a) The minimum depth of such a tree is returned by the function mindepth :: Btree a ! Int : mindepth (Leaf a) = 0 mindepth (Bin s t) = min (mindepth s)(mindepth t) + 1 This program is clear, but rather inefficient. It traverses the whole tree, regardless of leaves that may occur at a small depth. A better program would keep track of the `minimum depth so far', and never explore subtrees beyond that current best solution. One possible implementation of that idea is mindepth t = md t 01 md (Leaf a)d m = mindm md (Bin s t)d m = if d 0 m then m...
Sharing of Computations
, 1993
"... This report is a revised version of my thesis of the same title, which was accepted for the Ph.D. degree in Computer Science at University of Aarhus, Denmark, in June 1993 ..."
Abstract

Cited by 15 (3 self)
 Add to MetaCart
This report is a revised version of my thesis of the same title, which was accepted for the Ph.D. degree in Computer Science at University of Aarhus, Denmark, in June 1993
Universal regular path queries
 HigherOrder and Symbolic Computation
, 2003
"... Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this proble ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this problem using relational algebra, and show how it may be implemented in Prolog. The motivation for the problem derives from a declarative framework for specifying compiler optimisations. 1 Bob Paige and IFIP WG 2.1 Bob Paige was a longstanding member of IFIP Working Group 2.1 on Algorithmic Languages and Calculi. In recent years, the main aim of this group has been to investigate the derivation of algorithms from specifications by program transformation. Already in the mideighties, Bob was way ahead of the pack: instead of applying transformational techniques to wellworn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular
Using attribute grammars to derive efficient functional programs
 IN COMPUTING SCIENCE IN THE NETHERLANDS CSN'87
, 1987
"... Two mappings from attribute grammars to lazy functional programs are defined. One of these mappings is an efficient implementation of attribute grammars. The other mapping yields inefficient programs. It is shown how some transformations of functional programs may be better understood by viewing the ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Two mappings from attribute grammars to lazy functional programs are defined. One of these mappings is an efficient implementation of attribute grammars. The other mapping yields inefficient programs. It is shown how some transformations of functional programs may be better understood by viewing the programs as inefficient implementations of attribute grammars.
Transformation in a NonStrict Language: An Approach to Instantiation
, 1989
"... A problem arises when the usual rules of fold/unfold transformation are applied in a nonstrict programming system. Case analysis by instantiation may alter strictness characteristics of the function being transformed, and hence alter the behaviour of programs. Although such behavioural changes can ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
A problem arises when the usual rules of fold/unfold transformation are applied in a nonstrict programming system. Case analysis by instantiation may alter strictness characteristics of the function being transformed, and hence alter the behaviour of programs. Although such behavioural changes can in general be quite subtle, they are all too apparent if the program is interactive, since I/O interleaving is closely tied to strictness properties. A twophase solution to the problem is proposed. It comprises a suitable form of strictness analysis to determine whether a proposed instantiation is safe, and a procedure to reformulate troublesome definitions so that, in effect, case analysis is shifted to a nearby safe context. 1. Introduction We assume a purely functional programming language in the recursion equation style[7]. Data values are generated from constants and constructor functions. Functions other than constructors may be defined by cases in a series of clauses. In each ...
Bridging the Algorithm Gap: A Lineartime Functional Program for Paragraph Formatting
 Science of Computer Programming
, 1997
"... In the constructive programming community it is commonplace to see formal developments of textbook algorithms. In the algorithm design community, on the other hand, it may be well known that the textbook solution to a problem is not the most efficient possible. However, in presenting the more eff ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
In the constructive programming community it is commonplace to see formal developments of textbook algorithms. In the algorithm design community, on the other hand, it may be well known that the textbook solution to a problem is not the most efficient possible. However, in presenting the more efficient solution, the algorithm designer will usually omit some of the implementation details, thus creating an algorithm gap between the abstract algorithm and its concrete implementation. This is in contrast to the formal development, which usually presents the complete concrete implementation of the less efficient solution. We claim that the algorithm designer is forced to omit some of the details by the relative expressive poverty of the Pascallike languages typically used to present the solution; the greater expressiveness provided by a functional language allows the whole story to be told in a reasonable amount of space. We therefore hope to bridge the algorithm gap between ab...