scispace - formally typeset
Search or ask a question
Topic

Program transformation

About: Program transformation is a research topic. Over the lifetime, 2468 publications have been published within this topic receiving 73415 citations.


Papers
More filters
Journal ArticleDOI
01 Dec 2002
TL;DR: This paper uses Pitts' recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short-cut fusion are contextually equivalent to their unfused counterparts.
Abstract: Short-cut fusion is a program transformation technique that uses a single, local transformation—called the \tt foldr-build rule—to remove certain intermediate lists from modularly constructed functional programs. Arguments that short-cut fusion is correct typically appeal either to intuition or to “free theorems”—even though the latter have not been known to hold for the languages supporting higher-order polymorphic functions and fixed point recursion in which short-cut fusion is usually applied. In this paper we use Pitts' recent demonstration that contextual equivalence in such languages is relationally parametric to prove that programs in them which have undergone short-cut fusion are contextually equivalent to their unfused counterparts. For each algebraic data type we then define a generalization of \tt build which constructs substitution instances of its associated data structures, and use Pitts' techniques to prove the correctness of a contextual equivalence-preserving fusion rule which generalizes short-cut fusion. These rules optimize compositions of functions that uniformly consume algebraic data structures with functions that uniformly produce substitution instances of those data sructures.

50 citations

Book ChapterDOI
29 Oct 2001
TL;DR: It is shown how control-flow-based program transformations in functional languages can be proven correct and how two program transformations - flow-based inlining and lightweight defunctionalization - can beproven correct.
Abstract: We show how control-flow-based program transformations in functional languages can be proven correct. The method relies upon "defunctionalization," a mapping from a higher-order language to a firstorder language. We first show that defunctionalization is correct; using this proof and common semantic techniques, we then show how two program transformations - flow-based inlining and lightweight defunctionalization - can be proven correct.

49 citations

Proceedings ArticleDOI
01 Sep 2000
TL;DR: An optimization theorem is presented, a calculational strategy for applying the theorem is given, and the effectiveness of the approach is demonstrated through several nontrivial examples which would be difficult to deal with when using the methods previously available.
Abstract: In this paper we propose a new method for deriving a practical linear-time algorithm from the specification of a maximum-weightsum problem: From the elements of a data structure x, find a subset which satisfies a certain property p and whose weightsum is maximum. Previously proposed methods for automatically generating linear-time algorithms are theoretically appealing, but the algorithms generated are hardly useful in practice due to a huge constant factor for space and time. The key points of our approach are to express the property p by a recursive boolean function over the structure x rather than a usual logical predicate and to apply program transformation techniques to reduce the constant factor. We present an optimization theorem, give a calculational strategy for applying the theorem, and demonstrate the effectiveness of our approach through several nontrivial examples which would be difficult to deal with when using the methods previously available.

49 citations

Journal ArticleDOI
TL;DR: The design and implementation of a region-based compilation technique in the authors' dynamic optimization framework, in which the compiled regions are selected as code portions without rarely executed code.
Abstract: Method inlining and data flow analysis are two major optimization components for effective program transformations, but they often suffer from the existence of rarely or never executed code contained in the target method. One major problem lies in the assumption that the compilation unit is partitioned at method boundaries. This article describes the design and implementation of a region-based compilation technique in our dynamic optimization framework, in which the compiled regions are selected as code portions without rarely executed code. The key parts of this technique are the region selection, partial inlining, and region exit handling. For region selection, we employ both static heuristics and dynamic profiles to identify and eliminate rare sections of code. The region selection process and method inlining decisions are interwoven, so that method inlining exposes other targets for region selection, while the region selection in the inline target conserves the inlining budget, allowing more method inlining to be performed. The inlining process can be performed for parts of a method, not just for the entire body of the method. When the program attempts to exit from a region boundary, we trigger recompilation and then use on-stack replacement to continue the execution from the corresponding entry point in the recompiled code. We have implemented these techniques in our Java JIT compiler, and conducted a comprehensive evaluation. The experimental results show that our region-based compilation approach achieves approximately 4p performance improvement on average, while reducing the compilation overhead by 10p to 30p, in comparison to the traditional method-based compilation techniques.

49 citations

Book ChapterDOI
TL;DR: The Ciao module system as mentioned in this paper is a Prolog implementation of a modular global analysis and transformation system for Prolog, which allows separate compilation, extensibility in features and in syntax, amenability to modular transformation, enhanced error detection, support for meta-programming and higher-order, compatibility with official and de-facto standards, etc.
Abstract: It is now widely accepted that separating programs into modules is useful in program development and maintenance. While many Prolog implementations include useful module systems, we argue that these systems can be improved in a number of ways, such as, for example, being more amenable to effective global analysis and transformation and allowing separate compilation or sensible creation of standalone executables. We discuss a number of issues related to the design of such an improved module system for Prolog and propose some novel solutions. Based on this, we present the choices made in the Ciao module system, which has been designed to meet a number of objectives: allowing separate compilation, extensibility in features and in syntax, amenability to modular global analysis and transformation, enhanced error detection, support for meta-programming and higher-order, compatibility to the extent possible with official and de-facto standards, etc.

49 citations


Network Information
Related Topics (5)
Model checking
16.9K papers, 451.6K citations
92% related
Compiler
26.3K papers, 578.5K citations
88% related
Programming paradigm
18.7K papers, 467.9K citations
87% related
Executable
24K papers, 391.1K citations
86% related
Component-based software engineering
24.2K papers, 461.9K citations
86% related
Performance
Metrics
No. of papers in the topic in previous years
YearPapers
20234
202218
202126
202042
201956
201836