Results 1 - 10
of
10
Composing source-to-source data-flow transformations with rewriting strategies and dependent dynamic rewrite rules
- 14th International Conference on Compiler Construction (CC’05), volume 3443 of Lecture Notes in Computer Science
, 2005
"... Abstract. Data-flow transformations used in optimizing compilers are also useful in other programming tools such as code generators, aspect weavers, domain- and application-specific optimizers, and refactoring tools. These applications require source-to-source transformations rather than transformat ..."
Abstract
-
Cited by 14 (8 self)
- Add to MetaCart
Abstract. Data-flow transformations used in optimizing compilers are also useful in other programming tools such as code generators, aspect weavers, domain- and application-specific optimizers, and refactoring tools. These applications require source-to-source transformations rather than transformations on a low-level intermediate representation. In this paper we describe the composition of source-to-source dataflow transformations in the program transformation language Stratego. The language supports the high-level specification of transformations by means of rewriting strategy combinators that allow a natural modeling of data- and control-flow without committing to a specific source language. Data-flow facts are propagated using dynamic rewriting rules. In particular, we introduce the concept of dependent dynamic rewrite rules, for modeling the dependencies of data-flow facts on program entitities such as variables. The approach supports the combination of analysis and transformation, the combination of multiple transformations, the combination with other types of transformations, and the correct treatment of variable binding constructs and lexical scope to avoid variable capture. 1
Building Interpreters with Rewriting Strategies
- Workshop on Language Descriptions, Tools and Applications (LDTA’02), volume 65/3 of Electronic Notes in Theoretical Computer Science
, 2002
"... Programming language semantics based on pure rewrite rules suers from the gap between the rewriting strategy implemented in rewriting engines and the intended evaluation strategy. This paper shows how programmable rewriting strategies can be used to implement interpreters for programming languages b ..."
Abstract
-
Cited by 11 (7 self)
- Add to MetaCart
Programming language semantics based on pure rewrite rules suers from the gap between the rewriting strategy implemented in rewriting engines and the intended evaluation strategy. This paper shows how programmable rewriting strategies can be used to implement interpreters for programming languages based on rewrite rules. The advantage of this approach is that reduction rules are rst class entities that can be reused in dierent strategies, even in other kinds of program transformations such as optimizers. The approach is illustrated with several interpreters for the lambda calculus based on implicit and explicit (parallel) substitution, dierent strategies including normalization, eager evaluation, lazy evaluation, and lazy evaluation with updates. An extension with pattern matching and choice shows that such interpreters can easily be extended.
The essence of strategic programming
- Draft
, 2002
"... Abstract. Strategic programming is generic programming with the use of strategies. A strategy is a generic data-processing action which can traverse into heterogeneous data structures while mixing uniform and type-specific behaviour. With strategic programming, one gains full control over the applic ..."
Abstract
-
Cited by 9 (0 self)
- Add to MetaCart
Abstract. Strategic programming is generic programming with the use of strategies. A strategy is a generic data-processing action which can traverse into heterogeneous data structures while mixing uniform and type-specific behaviour. With strategic programming, one gains full control over the application of basic actions, most notably full traversal control. Using a combinator style, traversal schemes can be defined, and actual traversals are obtained by passing the problem-specific ingredients as parameters to suitable schemes. The prime application domain for strategic programming is program transformation and analysis. In this paper, we provide a language-independent definition that generalises over existing incarnations of this idiom in term rewriting, functional programming, and object-oriented programming.
First-class Rules and Generic Traversal
, 2001
"... In this paper we present a functional language supporting first-class rules and generic traversal. This is achieved by generalizing the pattern matching constructs of standard functional languages. The case construct that ties rules together and prevents their reuse, is replaced by separate, firs ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
In this paper we present a functional language supporting first-class rules and generic traversal. This is achieved by generalizing the pattern matching constructs of standard functional languages. The case construct that ties rules together and prevents their reuse, is replaced by separate, firstclass, pattern matching rules and a choice combinator that deals with pattern match failure. Generic traversal is achieved through application pattern matching in which a constructor application is generically divided into a prefix and a su#x, thus giving generic access to the subterms of a constructor term. Many highly generic term traversals can be defined in a type-safe way using this feature.
Strategies for Fusing Logic and Control via Local, Application-Specific Transformations
, 2003
"... Abstract programming supports the separation of logical concerns from issues of control in program construction. While this separation of concerns leads to reduced code size and increased reusability of code, its main disadvantage is the computational overhead it incurs. Fusion techniques can be ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
Abstract programming supports the separation of logical concerns from issues of control in program construction. While this separation of concerns leads to reduced code size and increased reusability of code, its main disadvantage is the computational overhead it incurs. Fusion techniques can be used to combine the reusability of abstract programs with the e#ciency of specialized programs.
Turning Dynamic Typing into Static Typing by Program Specialization
, 2003
"... Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this f ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this flexibility is computational performance, since the run-time system is responsible for type checking, array shape determination, function call dispatching, and handling possible run-time errors. In order to produce effecient code, an Octave compiler should address those issues at compile-time as much as possible. In particular, static type and shape inferencing can improve the quality of the generated code. In this paper we discuss how overloading in dynamically typed Octave programs can be resolved by program specialization. We discuss the typing issues in compilation of Octave programs and give an overview of the implementation of the specializer in the transformation language Stratego.
Strategy Application, Observability, and the Choice Combinator. Sandia
"... In many strategic systems, the choice combinator provides a powerful mechanism for controlling the application of rules and strategies to terms. The ability of the choice combinator to exercise control over rewriting is based on the premise that the success and failure of strategy application can be ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
In many strategic systems, the choice combinator provides a powerful mechanism for controlling the application of rules and strategies to terms. The ability of the choice combinator to exercise control over rewriting is based on the premise that the success and failure of strategy application can be observed. In this paper we present a higher-order strategic framework with the ability to dynamically construct strategies containing the choice combinator. To this framework, a combinator called hide is introduced that prevents the successful application of a strategy from being observed by the choice combinator. We then explore the impact of this new combinator on a real-world problem involving a restricted implementation of the Java Virtual Machine.
Formalization and Abstract Implementationof Rewriting with Nested Rules
"... *This research has been supported by the NSF grants CCR0218224 and CCR-0110496. ..."
Abstract
- Add to MetaCart
*This research has been supported by the NSF grants CCR0218224 and CCR-0110496.
Partial Evaluation using Rewrite Rules
"... Partial evaluation, or program specialization, is used when a variable is known to often hold one particular value. In that case, it is possible to specialize a program for that value, so the program performs better when the variable indeed has that value, as computations depending only on that vari ..."
Abstract
- Add to MetaCart
Partial evaluation, or program specialization, is used when a variable is known to often hold one particular value. In that case, it is possible to specialize a program for that value, so the program performs better when the variable indeed has that value, as computations depending only on that variable(s) are already done. Rewrite rules provide a good mechanism for expressing program transformations. As partial evaluation is an example of a program transformation, rewrite rules should provide a good mechanism for partial evaluation. Similix is a self-applicable partial evaluator for a large higher order subset of the strict functional language Scheme, a lisp-like language. Stratego is a programming language that provides us with rewrite rules which can be combined using rewriting strategies. An approach to an implementation of the process of partial evaluation as it is done by Similix 5.0, using the rewrite rules provided by Stratego is given. The rewrite rules and strategies provided by Stratego prove to be a nice way to express partial evaluation. All phases a program has to pass to attain a partial evaluated version of the program can be split up in simple rewriting steps, which are combined in a neatly arranged manner by the rewriting strategies. The Stratego program stays clearly structured, as no complicated rules have to be used to do partial evaluation, and the strategies used to combine the rules can be set up in a logical way. 1 Contents 1
Turning Dynamic Typing into Static Typing by Program Specialization Karina Olmos Eelco Visser
- Third IEEE International Workshop on Source Code Analysis and Manipulation (SCAM’03
, 2003
"... Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this f ..."
Abstract
- Add to MetaCart
Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this flexibility is computational performance, since the run-time system is responsible for type checking, array shape determination, function call dispatching, and handling possible run-time errors. In order to produce effecient code, an Octave compiler should address those issues at compile-time as much as possible. In particular, static type and shape inferencing can improve the quality of the generated code. In this paper we discuss how overloading in dynamically typed Octave programs can be resolved by program specialization. We discuss the typing issues in compilation of Octave programs and give an overview of the implementation of the specializer in the transformation language Stratego.

