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
Proceedings ArticleDOI
01 Oct 2001
TL;DR: This paper develops and presents MacroML, an extension of ML that supports inlining, recursive macros, and the definition of new binding constructs, and shows that MacroML is stage- and type-safe: macro expansion does not depend on runtime evaluation, and both stages do not "go wrong".
Abstract: With few exceptions, macros have traditionally been viewed as operations on syntax trees or even on plain strings. This view makes macros seem ad hoc, and is at odds with two desirable features of contemporary typed functional languages: static typing and static scoping. At a deeper level, there is a need for a simple, usable semantics for macros. This paper argues that these problems can be addressed by formally viewing macros as multi-stage computations. This view eliminates the need for freshness conditions and tests on variable names, and provides a compositional interpretation that can serve as a basis for designing a sound type system for languages supporting macros, or even for compilation. To illustrate our approach, we develop and present MacroML, an extension of ML that supports inlining, recursive macros, and the definition of new binding constructs. The latter is subtle, and is the most novel addition in a statically typed setting. The semantics of a core subset of MacroML is given by an interpretation into MetaML, a statically-typed multi-stage programming language. It is then easy to show that MacroML is stage- and type-safe: macro expansion does not depend on runtime evaluation, and both stages do not "go wrong.

104 citations

Journal Article
TL;DR: In this article, the authors extend many-sorted, first-order term rewriting with traversal functions that automate tree traversal in a simple and type safe way, which can be bottom-up or top-down traversals.
Abstract: Term rewriting is an appealing technique for performing program analysis and program transformation. Tree (term) traversal is frequently used but is not supported by standard term rewriting. We extend many-sorted, first-order term rewriting with traversal functions that automate tree traversal in a simple and type safe way. Traversal functions can be bottom-up or top-down traversals. They can be either sort preserving transformations, or mappings to a fixed sort. We give examples and describe the semantics and implementation of traversal functions.

103 citations

Book ChapterDOI
Sheng Liang1, Paul Hudak1
22 Apr 1996
TL;DR: The benefits of applying modular monadic semantics to compiler construction are shown, and an axiomatization of environments is presented, and used to prove the correctness of a well-known compilation technique.
Abstract: We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a language with a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational semantics, reasoning in monadic style offers the added benefits of highly modularized proofs and more widely applicable results. To demonstrate, we present an axiomatization of environments, and use it to prove the correctness of a well-known compilation technique. The monadic approach also facilitates generating code in various target languages with different sets of built-in features.

103 citations

Book ChapterDOI
30 Mar 2006
TL;DR: By studying the transformations themselves, it is shown how it is possible to benefit from their properties to dramatically improve both code generation quality and space/time complexity, with respect to the best state-of-the-art code generation tool.
Abstract: The polyhedral model is known to be a powerful framework to reason about high level loop transformations. Recent developments in optimizing compilers broke some generally accepted ideas about the limitations of this model. First, thanks to advances in dependence analysis for irregular access patterns, its applicability which was supposed to be limited to very simple loop nests has been extended to wide code regions. Then, new algorithms made it possible to compute the target code for hundreds of statements while this code generation step was expected not to be scalable. Such theoretical advances and new software tools allowed actors from both academia and industry to study more complex and realistic cases. Unfortunately, despite strong optimization potential of a given transformation for e.g., parallelism or data locality, code generation may still be challenging or result in high control overhead. This paper presents scalable code generation methods that make possible the application of increasingly complex program transformations. By studying the transformations themselves, we show how it is possible to benefit from their properties to dramatically improve both code generation quality and space/time complexity, with respect to the best state-of-the-art code generation tool. In addition, we build on these improvements to present a new algorithm improving generated code performance for strided domains and reindexed schedules.

102 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