Results 1 -
9 of
9
Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire
, 1991
"... We develop a calculus for lazy functional programming based on recursion operators associated with data type definitions. For these operators we derive various algebraic laws that are useful in deriving and manipulating programs. We shall show that all example functions in Bird and Wadler's "Introdu ..."
Abstract
-
Cited by 274 (11 self)
- Add to MetaCart
We develop a calculus for lazy functional programming based on recursion operators associated with data type definitions. For these operators we derive various algebraic laws that are useful in deriving and manipulating programs. We shall show that all example functions in Bird and Wadler's "Introduction to Functional Programming" can be expressed using these operators. 1 Introduction Among the many styles and methodologies for the construction of computer programs the Squiggol style in our opinion deserves attention from the functional programming community. The overall goal of Squiggol is to calculate programs from their specification in the way a mathematician calculates solutions to differential equations, or uses arithmetic to solve numerical problems. It is not hard to state, prove and use laws for well-known operations such as addition, multiplication and ---at the function level--- composition. It is, however, quite hard to state, prove and use laws for arbitrarily recursively ...
Tupling Calculation Eliminates Multiple Data Traversals
- In ACM SIGPLAN International Conference on Functional Programming
, 1997
"... Tupling is a well-known transformation tactic to obtain new efficient recursive functions by grouping some recursive functions into a tuple. It may be applied to eliminate multiple traversals over the common data structure. The major difficulty in tupling transformation is to find what functions are ..."
Abstract
-
Cited by 31 (18 self)
- Add to MetaCart
Tupling is a well-known transformation tactic to obtain new efficient recursive functions by grouping some recursive functions into a tuple. It may be applied to eliminate multiple traversals over the common data structure. The major difficulty in tupling transformation is to find what functions are to be tupled and how to transform the tupled function into an efficient one. Previous approaches to tupling transformation are essentially based on fold/unfold transformation. Though general, they suffer from the high cost of keeping track of function calls to avoid infinite unfolding, which prevents them from being used in a compiler. To remedy this situation, we propose a new method to expose recursive structures in recursive definitions and show how this structural information can be explored for calculating out efficient programs by means of tupling. Our new tupling calculation algorithm can eliminate most of multiple data traversals and is easy to be implemented. 1 Introduction Tupli...
Make it Practical: A Generic Linear-Time Algorithm for Solving Maximum-Weightsum Problems
- In Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming (ICFP'00
, 2000
"... In this paper we propose a new method for deriving a practical linear-time algorithm from the specification of a maximum-weight sum problem: From the elements of a data structure x, find a subset which satisfies a certain property p and whose weightsum is maximum. Previously proposed methods for aut ..."
Abstract
-
Cited by 11 (8 self)
- Add to MetaCart
In this paper we propose a new method for deriving a practical linear-time algorithm from the specification of a maximum-weight sum problem: From the elements of a data structure x, find a subset which satisfies a certain property p and whose weightsum is maximum. Previously proposed methods for automatically generating linear-time algorithms are theoretically appealing, but the algorithms generated are hardly useful in practice due to a huge constant factor for space and time. The key points of our approach are to express the property p by a recursive boolean function over the structure x rather than a usual logical predicate and to apply program transformation techniques to reduce the constant factor. We present an optimization theorem, give a calculational strategy for applying the theorem, and demonstrate the effectiveness of our approach through several nontrivial examples which would be difficult to deal with when using the methods previously available.
The essence of the Iterator pattern
- McBride, Conor, & Uustalu, Tarmo (eds), Mathematically-structured functional programming
, 2006
"... The ITERATOR pattern gives a clean interface for element-by-element access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that ..."
Abstract
-
Cited by 11 (6 self)
- Add to MetaCart
The ITERATOR pattern gives a clean interface for element-by-element access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that McBride and Paterson’s idioms, and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the ITERATOR pattern. We present some axioms for traversal, and illustrate with a simple example, the repmin problem.
Iterative-Free Program Analysis
- In Proc. of Intl. Conference on Functional Programming
, 2003
"... flow analyses are reduced to the problem of finding a fixed point in a certain transition system, and such fixed point is commonly computed through an iterative procedure that repeats tracing until convergence. ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
flow analyses are reduced to the problem of finding a fixed point in a certain transition system, and such fixed point is commonly computed through an iterative procedure that repeats tracing until convergence.
Towards a Modular Program Derivation via Fusion and Tupling
- The First ACM SIGPLAN Conference on Generators and Components, Lecture
, 2002
"... 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 algo ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
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.
A Calculational Framework for Parallelization of Sequential Programs
- In International Symposium on Information Systems and Technologies for Network Society
, 1997
"... this paper, we propose ..."
Calculating linear time algorithms for solving maximum weightsum problems
- Computer Software
, 2001
"... In this paper, we propose a new method to derive practical linear time algorithms for maximum weightsum problems. A maximum weightsum problem is specified as follows: given a recursive data x, find an optimal subset of elements of x which not only satisfies certain property p but also maximizes the ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
In this paper, we propose a new method to derive practical linear time algorithms for maximum weightsum problems. A maximum weightsum problem is specified as follows: given a recursive data x, find an optimal subset of elements of x which not only satisfies certain property p but also maximizes the sum of the weight of elements of the subset. The key point of our approach is to describe the property p as a functional program. This enables us to use program transformation techniques. Based on this approach, we present the optimization theorem, with which we construct a systematic framework to calculate efficient linear time algorithms for maximum weightsum problems on recursive data structures. We demonstrate effectiveness of our approach through several interesting and non-trivial examples, which would be difficult to solve by known approaches.
Generation of Efficient Algorithms for Maximum Marking Problems
"... In existing work on graph algorithms, it is known that a linear time algorithm can be derived mechanically from a logical formula for a class of optimization problems. But this has a serious problem that the derived algorithm has huge constant factor. In this work, we redene this problem on recursiv ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
In existing work on graph algorithms, it is known that a linear time algorithm can be derived mechanically from a logical formula for a class of optimization problems. But this has a serious problem that the derived algorithm has huge constant factor. In this work, we redene this problem on recursive data structures as a maximum marking problem and propose method for deriving a linear time algorithm for that. In this method, speci cation is given using recursive functions instead of logical formula, which results in a practical linear time algorithm. This method is mechanical and in fact, based on this deriving method, we make a system which automatically generates a practical linear time algorithm from specication for a maximum marking problem.

