Results 1 -
4 of
4
A Constraint-based Partial Evaluator for Functional Logic Programs and its Application
, 1998
"... The aim of this work is the development and application of a partial evaluation procedure for rewriting-based functional logic programs. Functional logic programming languages unite the two main declarative programming paradigms. The rewriting-based computational model extends traditional functional ..."
Abstract
-
Cited by 12 (0 self)
- Add to MetaCart
The aim of this work is the development and application of a partial evaluation procedure for rewriting-based functional logic programs. Functional logic programming languages unite the two main declarative programming paradigms. The rewriting-based computational model extends traditional functional programming languages by incorporating logical features, including logical variables and built-in search, into its framework. This work is the first to address the automatic specialisation of these functional logic programs. In particular, a theoretical framework for the partial evaluation of rewriting-based functional logic programs is defined and its correctness is established. Then, an algorithm is formalised which incorporates the theoretical framework for the procedure in a fully automatic technique. Constraint solving is used to represent additional information about the terms encountered during the transformation in order to improve the efficiency and size of the residual programs. ...
Constraints to Stop Higher-Order Deforestation
- In 24th ACM Symposium on Principles of Programming Languages
, 1997
"... Wadler's deforestation algorithm eliminates intermediate data structures from functional programs. To be suitable for inclusion in a compiler, it must terminate on all programs. Several techniques to ensure termination of deforestation on all first-order programs are known, but a technique for highe ..."
Abstract
-
Cited by 11 (1 self)
- Add to MetaCart
Wadler's deforestation algorithm eliminates intermediate data structures from functional programs. To be suitable for inclusion in a compiler, it must terminate on all programs. Several techniques to ensure termination of deforestation on all first-order programs are known, but a technique for higher-order programs was only recently introduced by Hamilton, and elaborated and implemented in the Glasgow Haskell compiler by Marlow. We introduce a new technique for ensuring termination of deforestation on all higher-order programs that allows useful transformation steps prohibited in Hamilton's and Marlowe's techniques. 1 Introduction Lazy, higher-order, functional programming languages lend themselves to a certain style of programming which uses intermediate data structures [28]. Example 1 Consider the following program. letrec a = x; y:case x of [] ! y (h : t) ! h : a t y in u; v; w: a (a u v) w The term u; v; w:a (a u v) w appends the three lists u, v, and w. Appending u and v ...
Integer Constraints to Stop Deforestation
, 1996
"... . Deforestation is a transformation of functional programs to remove intermediate data structures. It is based on outermost unfolding of function calls where folding occurs when unfolding takes place within the same nested function call. Since unrestricted unfolding may encounter arbitrarily man ..."
Abstract
-
Cited by 10 (2 self)
- Add to MetaCart
. Deforestation is a transformation of functional programs to remove intermediate data structures. It is based on outermost unfolding of function calls where folding occurs when unfolding takes place within the same nested function call. Since unrestricted unfolding may encounter arbitrarily many terms, a termination analysis has to determine those subterms where unfolding is possibly dangerous. We show that such an analysis can be obtained from a control flow analysis by an extension with integer constraints -- essentially at no loss in efficiency. 1 Introduction The key idea of flow analysis for functional languages is to define an abstract meaning in terms of program points , i.e., subexpressions of the program possibly evaluated during program execution [Pa95]. Such analysises have been invented for tasks like type recovery [Sh91], binding time analysis [Co93], or safety analysis [PS95]. Conceptually, these are closely related to A. Deutsch's store--based alias analysis [D...
Extending First Order Deforestation
, 1995
"... Intermediate data structures are widely used in functional programs. Programs which use these intermediate structures are usually much easier to understand, but they result in loss of efficiency at run-time. In order to reduce these run-time costs, a transformation algorithm called deforestation was ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Intermediate data structures are widely used in functional programs. Programs which use these intermediate structures are usually much easier to understand, but they result in loss of efficiency at run-time. In order to reduce these run-time costs, a transformation algorithm called deforestation was proposed by Wadler to eliminate intermediate structures. However, the set of expressions for which this algorithm is guaranteed to terminate is only a subset of all first-order functional expressions. In this paper, it is shown how the deforestation algorithm can be generalised so that it will be guaranteed to terminate for all first-order functional expressions. It is then shown how this generalised algorithm can be extended to allow more intermediate data structures to be eliminated. i Contents 1 Introduction 1 2 Language 2 2.1 Syntax : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.2 Semantics : : : : : : : : : : : : : : : : : : : : : ...

