Results 1 -
6 of
6
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 29 (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...
Calculating Software Generators from Solution Specifications
- In TAPSOFT'95, volume 915 of LNCS
, 1994
"... Software application generators can eliminate many of the technical aspects of programming for most computer users. We have developed a uniform approach to the design of program generators, based upon a simple idea---provide a declarative specification language for each application domain and give i ..."
Abstract
-
Cited by 9 (7 self)
- Add to MetaCart
Software application generators can eliminate many of the technical aspects of programming for most computer users. We have developed a uniform approach to the design of program generators, based upon a simple idea---provide a declarative specification language for each application domain and give it a computable, denotational semantics. To make this idea practical, however, requires a comprehensive system for transforming and translatiing expressions in the higher-order functional operators of the semantics formulation into a reasonably efficient implementation expressed in a first-order, imperative programming language. This paper describes the system we have built to accomplish this. The technique and the system have been applied to produce a generator for modules that validate and translate messages sent from a peripheral sensor to a central controller. The input to a generator is a specification of the data formats and data constraints that characterize a message. The output is an...
ASTRE: Towards A Fully Automated Program Transformation System
- In Jieh Hsiang, editor, Proc. of RTA'95
, 1994
"... Introduction It has often been said that functional programs are constructed using functions as pieces. Data structures such as lists and trees are the glue to hold them together. This compositional style of programming produces many intermediate data structures. One way to circumvent this problem ..."
Abstract
-
Cited by 7 (0 self)
- Add to MetaCart
Introduction It has often been said that functional programs are constructed using functions as pieces. Data structures such as lists and trees are the glue to hold them together. This compositional style of programming produces many intermediate data structures. One way to circumvent this problem is to perform fusion or deforestation on programs. Deforestation algorithms (elimination of useless intermediate data-structures) [6, 10] do not recognize that an expression contains two or more functions that consume the same data structure. These functions can be put together in a tuple as a single function that traverses the data structure only once. This tactical is usually called two-loops fusion or two-loops tupling since it is implemented by using a tupling technique. It has been pointed out by Dershowitz [8] that an fold-unfold methodology [5] can be controlled by a completion procedure. Following this idea, the transformation system Astre [2] is based on comp
Automating Synthesis by Completion
, 1994
"... When using a completion procedure, simple static analyses allow automatizing the manipulation of first-order functional programs. This paper shows how to apply these techniques in order to fully automatize program transformation by the two strategies: deforestation (eliminating useless intermediate ..."
Abstract
-
Cited by 4 (3 self)
- Add to MetaCart
When using a completion procedure, simple static analyses allow automatizing the manipulation of first-order functional programs. This paper shows how to apply these techniques in order to fully automatize program transformation by the two strategies: deforestation (eliminating useless intermediate data structures) and tupling (eliminating parallel traversals of identical data structures). These techniques enable us to transform a larger class of programs than the current deforestation algorithms. Programs are translated into a constructor-based rewrite system. Then, a completion procedure can be used for synthesis of the transformed rewrite system. Static analyses of the rewrite system are needed to automatize a given transformation strategy. They permit the following: (1) to automatically discover the specifications of the functions that need to be synthesized by completion in order to accommodate the strategy, (2) to control the production of critical pairs during the completion pr...
Termination Issues in Automated Syntheses
, 1994
"... Synthesis by completion is used for a fully automated system for program transformation. In the paper, we present a set of transition rules for a full automation of a sound and terminating synthesis process which preserves orthogonality and termination of a constructor-based rewrite system. Moti ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Synthesis by completion is used for a fully automated system for program transformation. In the paper, we present a set of transition rules for a full automation of a sound and terminating synthesis process which preserves orthogonality and termination of a constructor-based rewrite system. Motivation The transformational approach to the development of programs is attractive for writing small components of large software systems. In this approach, developing a software component consists simply of writing an initial, possibly inefficient, but correct program P 0 and then, in transforming P 0 into a sequence of programs P 1 ; P 2 ; : : : ; P n to get a new, semantically equivalent program P n which is more efficient. The transformation phase, to be effective, must be fully automated so that it is not necessary to be an expert in transformation strategies to use the transformational approach for software design. In our work, synthesis is used as a mechanism for an automated system f...
Automatic Transformations by Rewriting Techniques
, 1994
"... . The paper shows how term rewriting techniques can be used to automatically transform first-order functional programs by both deforestation (eliminating useless intermediate data structures) and tupling (eliminating parallel traversals of identical data structures). Its novelty is that it include ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
. The paper shows how term rewriting techniques can be used to automatically transform first-order functional programs by both deforestation (eliminating useless intermediate data structures) and tupling (eliminating parallel traversals of identical data structures). Its novelty is that it includes these strategies for program improvement in a transformation system which uses completion procedures to automatically control a unfold/fold methodology. This means that eurekas for these strategies are automatically discovered and that they are processed by a completion procedure. The completion procedure is automatically constrained for orienting pairs into rules and for producing critical pairs. An interesting result is that the process preserves termination of the original set of rules, which is not guaranteed in general by a unfold/fold method. Introduction As it has often been said, functional programs are constructed using only functions as pieces. Data structures such as lists and ...

