Results 21  30
of
62
Hoopl: Dataflow Optimization Made Simple
"... We present Hoopl, a Haskell library that makes it easy for compiler writers to implement program transformations based on dataflow analyses. The compiler writer must identify (a) logical assertions on which the transformation will be based; (b) a representation of such assertions, which should form ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
We present Hoopl, a Haskell library that makes it easy for compiler writers to implement program transformations based on dataflow analyses. The compiler writer must identify (a) logical assertions on which the transformation will be based; (b) a representation of such assertions, which should form a lattice of finite height; (c) transfer functions that approximate weakest preconditions or strongest postconditions over the assertions; and (d) rewrite functions whose soundness is justified by the assertions. Hoopl uses the algorithm of Lerner, Grove, and Chambers (2002), which can compose very simple analyses and transformations in a way that achieves the same precision as complex, handwritten “superanalyses.” Hoopl will be the workhorse of a new back end for the
Expressive Power of Declarative Programming Languages
, 1998
"... The thesis investigates several aspects of the expressive power of declarative programming languages. There seems to be no widely accepted definition of expressive power of programming languages. In the literature expressiveness may mean power to describe algorithms, or to describe computations, or ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
(Show Context)
The thesis investigates several aspects of the expressive power of declarative programming languages. There seems to be no widely accepted definition of expressive power of programming languages. In the literature expressiveness may mean power to describe algorithms, or to describe computations, or to check types, etc. Presenting a clearer idea of the expressiveness of programming languages is a part of the aim of the research. We concentrate on the expressive power of declarative languages because these languages are at the highest level of abstraction. People argue about relative expressiveness between declarative languages. Besides, there are two declarative paradigms: logic and functional programming. How can we define and compare expressive power of languages belonging to these two different paradigms ? In order to compare expressive power of logic and functional languages, several translation schemes from subsets of Prolog to Haskell are defined. During the translation we aim to ...
The substitution vanishes
 In Algebraic Methodology and Software Technology, Proceedings, volume 4019 of LNCS
, 2006
"... Abstract. Accumulation techniques were invented to transform functional programs, which intensively use append functions (like inefficient list reversal), into more efficient programs, which use accumulating parameters instead (like efficient list reversal). In this paper we present a generalized an ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
Abstract. Accumulation techniques were invented to transform functional programs, which intensively use append functions (like inefficient list reversal), into more efficient programs, which use accumulating parameters instead (like efficient list reversal). In this paper we present a generalized and automatic accumulation technique that also handles programs operating with unary functions on arbitrary tree structures and employing substitution functions on trees which may replace different designated symbols by different trees. We show that this transformation does not deteriorate the efficiency with respect to callbyneed reduction. 1
Improving Functional Logic Programs by DifferenceLists
, 2000
"... . Modern multiparadigm declarative languages integrate features from functional, logic, and concurrent programming. In this work, we consider the adaptation of the logic programming transformation based on the introduction of differencelists to an integrated setting. Unfortunately, the use of ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
. Modern multiparadigm declarative languages integrate features from functional, logic, and concurrent programming. In this work, we consider the adaptation of the logic programming transformation based on the introduction of differencelists to an integrated setting. Unfortunately, the use of differencelists is impractical due to the absence of nonstrict equality in lazy (callbyname) languages. Despite all, we have developed a novel, stepwise transformation which achieves a similar effect over functional logic programs. We also show a simple and practical approach to incorporate the optimization into a real compiler. Finally, we have conducted a number of experiments which show the practicality of our proposal. Keywords: functional logic programming, program transformation, compiler optimization 1 Introduction In recent years, several proposals have been made to amalgamate functional and logic programming languages. These languages combine features from functional pr...
Church numerals, twice!
, 2002
"... This paper explains Church numerals, twice. The first explanation links Church numerals to Peano numerals via the wellknown encoding of data types in the polymorphic λcalculus. This view suggests that Church numerals are folds in disguise. The second explanation, which is more elaborate, but also ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
This paper explains Church numerals, twice. The first explanation links Church numerals to Peano numerals via the wellknown encoding of data types in the polymorphic λcalculus. This view suggests that Church numerals are folds in disguise. The second explanation, which is more elaborate, but also more insightful, derives Church numerals from first principles, that is, from an algebraic specification of addition and multiplication. Additionally, we illustrate the use of the parametricity theorem by proving exponentiation as reverse application correct. 1
Reflection without Remorse Revealing a hidden sequence to speed up monadic reflection
"... A series of list appends or monadic binds for many monads performs algorithmically worse when leftassociated. Continuationpassing style (CPS) is wellknown to cure this severe dependence of performance on the association pattern. The advantage of CPS dwindles or disappears if we have to examine o ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
A series of list appends or monadic binds for many monads performs algorithmically worse when leftassociated. Continuationpassing style (CPS) is wellknown to cure this severe dependence of performance on the association pattern. The advantage of CPS dwindles or disappears if we have to examine or modify the intermediate result of a series of appends or binds, before continuing the series. Such examination is frequently needed, for example, to control search in nondeterminism monads. We present an alternative approach that is just as general as CPS but more robust: it makes series of binds and other such operations efficient regardless of the association pattern – and also provides efficient access to intermediate results. The key is to represent such a conceptual sequence as an efficient sequence data structure. Efficient sequence data structures from the literature are homogeneous and cannot be applied as they are in a typesafe way to series of monadic binds. We generalize them to type aligned sequences and show how to construct their (assuredly orderpreserving) implementations. We demonstrate that our solution solves previously undocumented, severe performance problems in iteratees, LogicT transformers, free monads and extensible effects. Categories and Subject Descriptors D.3.2 [Programming Lan
Explicit Binds: Effortless Efficiency with and without Trees
"... Abstract. We demonstrate a simple and robust program transformation technique that can improve asymptotic time complexity of datamanipulating programs (e.g., produce a lineartime list reversal function from the obvious quadratic one). In the version of the present paper, it applies to monadic induc ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
Abstract. We demonstrate a simple and robust program transformation technique that can improve asymptotic time complexity of datamanipulating programs (e.g., produce a lineartime list reversal function from the obvious quadratic one). In the version of the present paper, it applies to monadic inductive datatypes and can be stated in two flavors, through a datatype representation, with an explicit (“frozen”) bind constructor and a special associated defining clause for the fold function, and in a functional form (generalized Church numerals), with a special definition of the bind function in terms of the build constructor. The technique explicates, systematizes, combines and scales a number of ideas known from the literature, achieving a new level of generality. 1
ListProcessing Optimizations in Curry
 In Proceedings of the 9th Intl. Workshop on Functional and Logic Programming
, 2000
"... The multiparadigm language Curry integrates features from functional, logic, and concurrent programming. In this work, we consider two wellknown listprocessing optimizations: short cut deforestation (from functional programming) and differencelists (from logic programming), and study their ada ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
The multiparadigm language Curry integrates features from functional, logic, and concurrent programming. In this work, we consider two wellknown listprocessing optimizations: short cut deforestation (from functional programming) and differencelists (from logic programming), and study their adaptation to our integrated setting. While short cut deforestation adapts smoothly, the use of differencelists in Curry is impractical due to the absence of nonstrict equality in the language. Despite all, we have developed a novel transformation which achieves a similar effect over functional logic programs. Both transformations combined together yield a simple and practical method for optimizing listprocessing programs. 1
Pretty printing with delimited continuations
, 2006
"... Abstract Pretty printing is the task of nicely formatting tree structured data within a given line width limit. In 1980 Oppen published a pretty printing algorithm that takes time linear in the size of the input, independent of the line width, and uses only limited lookahead. This work inspired the ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract Pretty printing is the task of nicely formatting tree structured data within a given line width limit. In 1980 Oppen published a pretty printing algorithm that takes time linear in the size of the input, independent of the line width, and uses only limited lookahead. This work inspired the development of a number of purely functional pretty printing libraries in Haskell. Here I present a new functional pretty printing algorithm that has all the nice properties of Oppen’s and is surprisingly simple. A doubleended queue of delimited continuations is the key to addressing all aspects of the problem explicitly. Copyright c © 2006 University of Kent
Losing Functions without Gaining Data – another look at defunctionalisation
"... We describe a transformation which takes a higherorder program, and produces an equivalent firstorder program. Unlike Reynoldsstyle defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. We can use our method to improve t ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
We describe a transformation which takes a higherorder program, and produces an equivalent firstorder program. Unlike Reynoldsstyle defunctionalisation, it does not introduce any new data types, and the results are more amenable to subsequent analysis operations. We can use our method to improve the results of existing analysis operations, including strictness analysis, patternmatch safety and termination checking. Our transformation is implemented, and works on a Core language to which Haskell programs can be reduced. Our method cannot always succeed in removing all functional values, but in practice is remarkably successful. D.3 [Software]: Program