Results 1 - 10
of
57
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 so-called `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 68 (3 self)
- Add to MetaCart
We present an overview of the program transformation methodology, focusing our attention on the so-called `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) 263--304. 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 [Burstall-Darlington 77], although the basic ideas were already presented in previous papers by the same authors [Darlington 72, Burstall-Darlington 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...
Logic program specialisation through partial deduction: Control issues
- THEORY AND PRACTICE OF LOGIC PROGRAMMING
, 2002
"... Program specialisation aims at improving the overall performance of programs by performing source to source transformations. A common approach within functional and logic programming, known respectively as partial evaluation and partial deduction, is to exploit partial knowledge about the input. It ..."
Abstract
-
Cited by 46 (12 self)
- Add to MetaCart
Program specialisation aims at improving the overall performance of programs by performing source to source transformations. A common approach within functional and logic programming, known respectively as partial evaluation and partial deduction, is to exploit partial knowledge about the input. It is achieved through a well-automated application of parts of the Burstall-Darlington unfold/fold transformation framework. The main challenge in developing systems is to design automatic control that ensures correctness, efficiency, and termination. This survey and tutorial presents the main developments in controlling partial deduction over the past 10 years and analyses their respective merits and shortcomings. It ends with an assessment of current achievements and sketches some remaining research challenges.
Static Caching for Incremental Computation
- ACM Trans. Program. Lang. Syst
, 1998
"... A systematic approach is given for deriving incremental programs that exploit caching. The cache-and-prune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the final result, (II) the ..."
Abstract
-
Cited by 42 (19 self)
- Add to MetaCart
A systematic approach is given for deriving incremental programs that exploit caching. The cache-and-prune method presented in the article consists of three stages: (I) the original program is extended to cache the results of all its intermediate subcomputations as well as the final result, (II) the extended program is incrementalized so that computation on a new input can use all intermediate results on an old input, %using existing techniques, and (III) unused results cached by the extended program and maintained by the incremental program are pruned away, leaving a pruned extended program that caches only useful intermediate results and a pruned incremental program that uses and maintains only the useful results. All three stages utilize static analyses and semantics-preserving transformations. Stages I and III are simple, clean, and fully automatable. The overall method has a kind of optimality with respect to the techniques used in Stage II. The method can be applied straightforwardly to provide a systematic approach to program improvement via caching.
Specialization of Lazy Functional Logic Programs
- IN PROC. OF THE ACM SIGPLAN CONF. ON PARTIAL EVALUATION AND SEMANTICS-BASED PROGRAM MANIPULATION, PEPM'97, VOLUME 32, 12 OF SIGPLAN NOTICES
, 1997
"... Partial evaluation is a method for program specialization based on fold/unfold transformations [8, 25]. Partial evaluation of pure functional programs uses mainly static values of given data to specialize the program [15, 44]. In logic programming, the so-called static/dynamic distinction is hard ..."
Abstract
-
Cited by 36 (22 self)
- Add to MetaCart
Partial evaluation is a method for program specialization based on fold/unfold transformations [8, 25]. Partial evaluation of pure functional programs uses mainly static values of given data to specialize the program [15, 44]. In logic programming, the so-called static/dynamic distinction is hardly present, whereas considerations of determinacy and choice points are far more important for control [12]. We discuss these issues in the context of a (lazy) functional logic language. We formalize a two-phase specialization method for a non-strict, first order, integrated language which makes use of lazy narrowing to specialize the program w.r.t. a goal. The basic algorithm (first phase) is formalized as an instance of the framework for the partial evaluation of functional logic programs of [2, 3], using lazy narrowing. However, the results inherited by [2, 3] mainly regard the termination of the PE method, while the (strong) soundness and completeness results must be restated for the lazy strategy. A post-processing renaming scheme (second phase) is necessary which we describe and illustrate on the well-known matching example. This phase is essential also for other non-lazy narrowing strategies, like innermost narrowing, and our method can be easily extended to these strategies. We show that our method preserves the lazy narrowing semantics and that the inclusion of simplification steps in narrowing derivations can improve control during specialization.
Controlling Conjunctive Partial Deduction of Definite Logic Programs
, 1996
"... "Classical" partial deduction, within the framework by Lloyd and Shepherdson, computes partial deduction for separate atoms independently. As a consequence, a number of program optimisations, known from unfold/fold transformations and supercompilation, cannot be achieved. In this paper, we show that ..."
Abstract
-
Cited by 32 (9 self)
- Add to MetaCart
"Classical" partial deduction, within the framework by Lloyd and Shepherdson, computes partial deduction for separate atoms independently. As a consequence, a number of program optimisations, known from unfold/fold transformations and supercompilation, cannot be achieved. In this paper, we show that this restriction can be lifted through (polygenetic) specialisation of entire atom conjunctions. We present a generic algorithm for such partial deduction and discuss its correctness in an extended formal framework. We concentrate on novel control challenges specific to this "conjunctive" partial deduction. We refine the generic algorithm into a fully automatic concrete one that registers partially deduced conjunctions in a global tree, and prove its termination and correctness. We discuss some further control refinements and illustrate the operation of the concrete algorithm and/or some of its possible variants on interesting transformation examples.
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...
Parallelization in Calculational Forms
- In 25th ACM Symposium on Principles of Programming Languages
, 1998
"... The problems involved in developing efficient parallel programs have proved harder than those in developing efficient sequential ones, both for programmers and for compilers. Although program calculation has been found to be a promising way to solve these problems in the sequential world, we believe ..."
Abstract
-
Cited by 28 (21 self)
- Add to MetaCart
The problems involved in developing efficient parallel programs have proved harder than those in developing efficient sequential ones, both for programmers and for compilers. Although program calculation has been found to be a promising way to solve these problems in the sequential world, we believe that it needs much more effort to study its effective use in the parallel world. In this paper, we propose a calculational framework for the derivation of efficient parallel programs with two main innovations: - We propose a novel inductive synthesis lemma based on which an elementary but powerful parallelization theorem is developed. - We make the first attempt to construct a calculational algorithm for parallelization, deriving associative operators from data type definition and making full use of existing fusion and tupling calculations. Being more constructive, our method is not only helpful in the design of efficient parallel programs in general but also promising in the construc...
Dynamic programming via static incrementalization
- In Proceedings of the 8th European Symposium on Programming
, 1999
"... Dynamic programming is an important algorithm design technique. It is used for solving problems whose solutions involve recursively solving subproblems that share subsubproblems. While a straightforward recursive program solves common subsubproblems repeatedly and often takes exponential time, a dyn ..."
Abstract
-
Cited by 26 (12 self)
- Add to MetaCart
Dynamic programming is an important algorithm design technique. It is used for solving problems whose solutions involve recursively solving subproblems that share subsubproblems. While a straightforward recursive program solves common subsubproblems repeatedly and often takes exponential time, a dynamic programming algorithm solves every subsubproblem just once, saves the result, reuses it when the subsubproblem is encountered again, and takes polynomial time. This paper describes a systematic method for transforming programs written as straightforward recursions into programs that use dynamic programming. The method extends the original program to cache all possibly computed values, incrementalizes the extended program with respect to an input increment to use and maintain all cached results, prunes out cached results that are not used in the incremental computation, and uses the resulting incremental program to form an optimized new program. Incrementalization statically exploits semantics of both control structures and data structures and maintains as invariants equalities characterizing cached results. The principle underlying incrementalization is general for achieving drastic program speedups. Compared with previous methods that perform memoization or tabulation, the method based on incrementalization is more powerful and systematic. It has been implemented and applied to numerous problems and succeeded on all of them. 1
Discovering Auxiliary Information for Incremental Computation
- In Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages
, 1996
"... This paper presents program analyses and transformations that discover a general class of auxiliary information for any incremental computation problem. Combining these techniques with previous techniques for caching intermediate results, we obtain a systematic approach that transforms nonincrementa ..."
Abstract
-
Cited by 22 (12 self)
- Add to MetaCart
This paper presents program analyses and transformations that discover a general class of auxiliary information for any incremental computation problem. Combining these techniques with previous techniques for caching intermediate results, we obtain a systematic approach that transforms nonincremental programs into efficient incremental programs that use and maintain useful auxiliary information as well as useful intermediate results. The use of auxiliary information allows us to achieve a greater degree of incrementality than otherwise possible. Applications of the approach include strength reduction in optimizing compilers and finite differencing in transformational programming.
Caching Intermediate Results for Program Improvement
- In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation
, 1995
"... A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from non-incremental programs. We exploit a number of program analysis and transformation techniques, centered around effective caching based on its utilization in deriving increment ..."
Abstract
-
Cited by 19 (6 self)
- Add to MetaCart
A systematic approach is given for symbolically caching intermediate results useful for deriving incremental programs from non-incremental programs. We exploit a number of program analysis and transformation techniques, centered around effective caching based on its utilization in deriving incremental programs, in order to increase the degree of incrementality not otherwise achievable by using only the return values of programs that are of direct interest. Our method can be applied straightforwardly to provide a systematic approach to program improvement via caching. 1 Introduction Incremental programs take advantage of repeated computations on inputs that differ only slightly from one another, making use of the old output in computing a new output rather than computing from scratch. Methods of incremental computation have widespread application, e.g., optimizing compilers [2, 9, 11], transformational programming [29, 32, 42], interactive editing systems [4, 38], etc. In this paper, ...

