Results 1 
6 of
6
Playing by the rules: rewriting as a practical optimisation technique in GHC
"... We describe a facility for improving optimization of Haskell programs using rewrite rules. Library authors can use rules to express domainspecific optimizations that the compiler cannot discover for itself. The compiler can also generate rules internally to propagate information obtained from aut ..."
Abstract

Cited by 57 (9 self)
 Add to MetaCart
We describe a facility for improving optimization of Haskell programs using rewrite rules. Library authors can use rules to express domainspecific optimizations that the compiler cannot discover for itself. The compiler can also generate rules internally to propagate information obtained from automated analyses. The rewrite mechanism is fully implemented in the released Glasgow Haskell Compiler. Our system is very simple, but can be effective in optimizing real programs. We describe two practical applications involving shortcut deforestation, for lists and for rose trees, and document substantial performance improvements on a range of programs. 1 Introduction Optimising compilers perform program transformations that improve the efficiency of the program. However, a compiler can only use relatively shallow reasoning to guarantee the correctness of its optimisations. In contrast, the programmer has much deeper information about the program and its intended behaviour. For example, a programmer may know that
Imperative program transformation by rewriting
 In Proc. 10th International Conf. on Compiler Construction, volume 2027 of Lecture Notes in Computer Science
, 2001
"... Abstract. We present a method of specifying standard imperative program optimisations as a rewrite system. To achieve this we have extended the idea of matching subterms in expressions with simple patterns to matching blocks in a control flow graph. In order to express the complex restrictions on t ..."
Abstract

Cited by 35 (5 self)
 Add to MetaCart
Abstract. We present a method of specifying standard imperative program optimisations as a rewrite system. To achieve this we have extended the idea of matching subterms in expressions with simple patterns to matching blocks in a control flow graph. In order to express the complex restrictions on the applicability of these rewrites we add temporal logic side conditions. The combination of these features allows a flexible, high level, yet executable specification of many of the transformations found in optimising compilers. 1
Universal regular path queries
 HigherOrder and Symbolic Computation
, 2003
"... Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this proble ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
Given are a directed edgelabelled graph G with a distinguished node n0, and a regular expression P which may contain variables. We wish to compute all substitutions φ (of symbols for variables), together with all nodes n such that all paths n0 → n are in φ(P). We derive an algorithm for this problem using relational algebra, and show how it may be implemented in Prolog. The motivation for the problem derives from a declarative framework for specifying compiler optimisations. 1 Bob Paige and IFIP WG 2.1 Bob Paige was a longstanding member of IFIP Working Group 2.1 on Algorithmic Languages and Calculi. In recent years, the main aim of this group has been to investigate the derivation of algorithms from specifications by program transformation. Already in the mideighties, Bob was way ahead of the pack: instead of applying transformational techniques to wellworn examples, he was applying his theories of program transformation to new problems, and discovering new algorithms [16, 48, 52]. The secret of his success lay partly in his insistence on the study of general algorithm design strategies (in particular
CACHET: An interactive, incrementalattributionbased program transformation system for deriving incremental programs
 IN PROCEEDINGS OF THE 10TH KNOWLEDGEBASED SOFTWARE ENGINEERING CONFERENCE
, 1995
"... This paper describes the design and implementation of an interactive, incrementalattributionbased program transformation system, CACHET, that derives incremental programs from nonincremental programs written in a functional language. CACHET is designed as a programming environment and implemented ..."
Abstract

Cited by 9 (8 self)
 Add to MetaCart
This paper describes the design and implementation of an interactive, incrementalattributionbased program transformation system, CACHET, that derives incremental programs from nonincremental programs written in a functional language. CACHET is designed as a programming environment and implemented using a languagebased editor generator, the Synthesizer Generator, with extensions that support complex transformations. Transformations directly manipulate the program tree and take into consideration information obtained from program analyses. Program analyses are performed via attribute evaluation, which is done incrementally as transformations change the program tree. The overall approach also explores a general framework for describing dynamic program semantics using annotations, which allows interleaving transformations with external input, such as user input. Designing CACHET as a programming environment also facilitates the integration of program derivation and validation with inte...
A Formal Framework for Automated Roundtrip Software Engineering in Static Aspect Weaving and Transformations
"... We present a formal framework for a recently introduced approach to Automated Roundtrip Software Engineering (ARE) in sourcelevel aspect weaving systems. Along with the formalization we improve the original method and suggest a new concept of weaving transactions in Aspectoriented Programming (AO ..."
Abstract
 Add to MetaCart
We present a formal framework for a recently introduced approach to Automated Roundtrip Software Engineering (ARE) in sourcelevel aspect weaving systems. Along with the formalization we improve the original method and suggest a new concept of weaving transactions in Aspectoriented Programming (AOP). As the major contribution we formally show how, given a treeshaped intermediate representation of a program and an ancillary transposition tree, manual edits in statically woven code can consistently be mapped back to their proper source of origin, which is either in the application core or in an element in the aspect space. The presented formalism is constructive. It frames AOP by generalizing static aspect weaving to classical tree transformations.
Preliminary Proceedings of the ACM SIGPLAN Haskell Workshop (HW'2001)
, 2001
"... Using Haskell as a digital circuit description language, we transform a ripple carry adder that requires O(n) time to add two nbit words into an e#cient carry lookahead adder that requires O(log n) time. The gain in speed relies on the use of parallel scan to calculate the propagation of carry bits ..."
Abstract
 Add to MetaCart
Using Haskell as a digital circuit description language, we transform a ripple carry adder that requires O(n) time to add two nbit words into an e#cient carry lookahead adder that requires O(log n) time. The gain in speed relies on the use of parallel scan to calculate the propagation of carry bits e#ciently. The main di#culty is that this scan cannot be parallelised directly since it is applied to a nonassociative function. Several additional techniques are needed to circumvent the problem, including partial evaluation and symbolic function representation. The derivation given here provides a formal correctness proof, yet it also makes the solution more intuitive by bringing out explicitly each of the ideas underlying the carry lookahead adder.