Results 1 
9 of
9
Composition of functions with accumulating parameters
 Journal of Functional Programming
, 2004
"... Many functional programs with accumulating parameters are contained in the class of macro tree transducers. We present a program transformation technique that can be used to solve the efficiency problems due to creation and consumption of intermediate data structures in compositions of such function ..."
Abstract

Cited by 20 (9 self)
 Add to MetaCart
Many functional programs with accumulating parameters are contained in the class of macro tree transducers. We present a program transformation technique that can be used to solve the efficiency problems due to creation and consumption of intermediate data structures in compositions of such functions, where classical deforestation techniques fail. In order to do so, given two macro tree transducers under appropriate restrictions, we construct a single macro tree transducer that implements the composition of the two original ones. The imposed restrictions are more liberal than those in the literature on macro tree transducer composition, thus generalising previous results.
Formal Efficiency Analysis for Tree Transducer Composition
, 2004
"... We study the question of efficiency improvement or deterioration for a semanticspreserving program transformation technique for (lazy) functional languages, based on composition of restricted macro tree transducers. By annotating programs to reflect the intensional property ``computation time'' exp ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
We study the question of efficiency improvement or deterioration for a semanticspreserving program transformation technique for (lazy) functional languages, based on composition of restricted macro tree transducers. By annotating programs to reflect the intensional property ``computation time'' explicitly in the computed output and by manipulating such annotations, we formally prove syntactic conditions under which the composed program is guaranteed to be not less efficient than the original program with respect to the number of callbyname reduction steps required to reach normal form. Under additional conditions the guarantee also holds for callbyneed semantics. The criteria developed can be checked automatically and efficiently, and thus are suitable for integration into an optimizing compiler.
Semantics and pragmatics of new shortcut fusion rules
 IN FLOPS, PROCEEDINGS, VOLUME 4989 OF LNCS
, 2008
"... We study various shortcut fusion rules for languages like Haskell. Following a careful semantic account of a recently proposed rule for circular program transformation, we propose a new rule that trades circularity for higherorderedness, and thus attains better semantic properties. This also leads ..."
Abstract

Cited by 4 (3 self)
 Add to MetaCart
We study various shortcut fusion rules for languages like Haskell. Following a careful semantic account of a recently proposed rule for circular program transformation, we propose a new rule that trades circularity for higherorderedness, and thus attains better semantic properties. This also leads us to revisit the original foldr/buildrule, as well as its dual, and to develop variants that do not suffer from detrimental impacts of Haskell’s mixed strict/nonstrict semantics. Throughout, we offer pragmatic insights about our new rules to investigate also their relative effectiveness, rather than just their semantic correctness.
Deforesting in Accumulating Parameters via TypeDirected Transformations
 In: Asian Workshop on Programming Languages and Systems
, 2002
"... Classical deforestation methods fail to compose functions with accumulating parameters, which are function arguments to which intermediate result accumulates. This paper proposes a new deforestation method which solves this problem. The method is comprised of a few transformation steps, each of whic ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Classical deforestation methods fail to compose functions with accumulating parameters, which are function arguments to which intermediate result accumulates. This paper proposes a new deforestation method which solves this problem. The method is comprised of a few transformation steps, each of which is guided by type information. Though our solution draws its fundamental idea from a deforestation method that has been developed for attribute grammars, it is not merely a recast of an existing technique to another formalism. The new method provides a typebased account for the existing attribute grammar deforestation process. Further, it can deforest a class of functions that the attribute grammar deforestation cannot. These advantages are demonstrated by a few examples. It is also shown that the new method is as powerful as another method that has been developed for macro tree transducer composition.
Deaccumulation Techniques for Improving Provability ∗
"... Several induction theorem provers were developed to verify functional programs mechanically. Unfortunately, automatic verification often fails for functions with accumulating arguments. Using concepts from the theory of tree transducers and extending on earlier work, the paper develops automatic tra ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
Several induction theorem provers were developed to verify functional programs mechanically. Unfortunately, automatic verification often fails for functions with accumulating arguments. Using concepts from the theory of tree transducers and extending on earlier work, the paper develops automatic transformations from accumulative functional programs into nonaccumulative ones, which are much better suited for mechanized verification. The overall goal is to reduce the need for generalizing induction hypotheses in (semi)automatic provers. Via the correspondence between imperative programs and tailrecursive functions, the presented approach can also help to reduce the need for inventing loop invariants in the verification of imperative programs. 1
Algebraic fusion of functions with an accumulating parameter and its improvement
 In Proc. ACM International Conference on Functional Programming
, 2006
"... We present a unifying solution to the problem of fusion of functions, where both the producer function and the consumer function have one accumulating parameter. The key idea in this development is to formulate the producer function as a function which computes over a monoid of data contexts. Upon t ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
We present a unifying solution to the problem of fusion of functions, where both the producer function and the consumer function have one accumulating parameter. The key idea in this development is to formulate the producer function as a function which computes over a monoid of data contexts. Upon this formulation, we develop a fusion method called algebraic fusion based on the elementary theory of universal algebra and monoids. The producer function is fused with a monoid homomorphism that is derived from the definition of the consumer function, and is turned into a higherorder function f that computes over the monoid of endofunctions. We then introduce a general concept called improvement, in order to reduce the cost of computing over the monoid of endofunctions (i.e., function closures). An improvement of the function f via a monoid homomorphism h is a function g that satisfies f = h ◦ g. This provides a principled way of finding a firstorder function representing a solution to the fusion problem. It also presents a clean and unifying account for varying fusion methods that have been proposed so far. Furthermore, we show that our method extends to support partial and infinite data structures, by means of an appropriate monoid structure. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications—Applicative (functional) languages;
Swapping arguments and results of recursive functions
 In Mathematics of Program Construction, Proceedings, volume 4014 of LNCS
, 2006
"... Abstract. Many useful calculation rules, such as fusion and tupling, rely on wellstructured functions, especially in terms of inputs and outputs. For instance, fusion requires that wellproduced outputs should be connected to wellconsumed inputs, so that unnecessary intermediate data structures ca ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract. Many useful calculation rules, such as fusion and tupling, rely on wellstructured functions, especially in terms of inputs and outputs. For instance, fusion requires that wellproduced outputs should be connected to wellconsumed inputs, so that unnecessary intermediate data structures can be eliminated. These calculation rules generally fail to work unless functions are wellstructured. In this paper, we propose a new calculation rule called IO swapping. IO swapping exchanges calltime computations (occurring in the arguments) and returntime computations (occurring in the results) of a function, while guaranteeing that the original and resulting function compute the same value. IO swapping enables us to rearrange inputs and outputs so that the existing calculation rules can be applied. We present new systematic derivations of efficient programs for detecting palindromes, and a method of higherorder removal that can be applied to defunctionalize function arguments, as two concrete applications. 1
unknown title
"... In functional programming, arguments (inputs of functions) and results (outputs of functions) are not symmetric. Things being natural and suitable for arguments may not be natural for results, and vice versa. Such asymmetry is not suitable for program construction and program manipulation. We need s ..."
Abstract
 Add to MetaCart
In functional programming, arguments (inputs of functions) and results (outputs of functions) are not symmetric. Things being natural and suitable for arguments may not be natural for results, and vice versa. Such asymmetry is not suitable for program construction and program manipulation. We need some guideposts so that we would not lose our way by these kinds of asymmetry. In this thesis, we introduce a novel program transformation called IO swapping, which makes a new recursive function whose calltime computations (computations managed in arguments) and returntime computations (computations managed in results) are the returntime computations and calltime computations of the old one, respectively, yet guarantees that the old and new recursive functions compute the same value. IO swapping therefore introduces symmetry of arguments and results at the level of the program elements. Moreover, IO swapping is easy to combine with other program manipulation techniques and it enable to derive the IOswapped manipulation of an existing one. Using IO swapping, we do not suffer from the asymmetry of program manipulations anymore.