Results 1 - 10
of
13
A Semantic Account of Type-Directed Partial Evaluation
- In Gopalan Nadathur, editor, International Conference on Principles and Practice of Declarative Programming, number 1702 in Lecture
, 1999
"... We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a type-based normalization-by-evaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic ar ..."
Abstract
-
Cited by 25 (2 self)
- Add to MetaCart
We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a type-based normalization-by-evaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic argument based on Kripke logical relations. For simplicity, the results are stated for a nonstrict, purely functional language; but the methods are directly applicable to stating and proving correctness of type-directed partial evaluation in ML-like languages as well.
Aspect-Oriented Compilers
, 1999
"... . Aspect-oriented programming provides the programmer with means to cross-cut conventional program structures, in particular the class hierarchies of object-oriented programming. This paper studies the use of aspect orientation in structuring syntax directed compilers implemented as attribute gr ..."
Abstract
-
Cited by 17 (2 self)
- Add to MetaCart
. Aspect-oriented programming provides the programmer with means to cross-cut conventional program structures, in particular the class hierarchies of object-oriented programming. This paper studies the use of aspect orientation in structuring syntax directed compilers implemented as attribute grammars. Specifically, it describes a method for specifying definitions of related attributes as `aspects' and treating them as first-class objects, that can be stored, manipulated and combined. It is hoped that this embedding of an aspect-oriented programming style in Haskell provides a stepping stone towards a more general study of the semantics of aspect-oriented programming. 1 Introduction Compilers are often structured by recursion over the abstract syntax of the source language. For each production in the abstract syntax, one defines a function that specifies how a construct is to be translated. The method of structuring compilers in this syntax--directed manner underlies the for...
TinkerType: a language for playing with formal systems
, 2003
"... TinkerType is a pragmatic framework for compact and modular description of formal systems (type systems, operational semantics, logics, etc.). A family of related systems is broken down into a set of clauses – individual inference rules – and a set of features controlling the inclusion of clauses in ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
TinkerType is a pragmatic framework for compact and modular description of formal systems (type systems, operational semantics, logics, etc.). A family of related systems is broken down into a set of clauses – individual inference rules – and a set of features controlling the inclusion of clauses in particular systems. Simple static checks are used to help maintain consistency of the generated systems. We present TinkerType and its implementation and describe its application to two substantial repositories of typed lambda-calculi. The first repository covers a broad range of typing features, including subtyping, polymorphism, type operators and kinding, computational effects, and dependent types. It describes both declarative and algorithmic aspects of the systems, and can be used with our tool, the TinkerType Assembler,to generate calculi either in the form of typeset collections of inference rules or as executable ML typecheckers. The second repository addresses a smaller collection of systems, and provides modularized proofs of basic safety properties.
Metacomputation-based compiler architecture
- IN 5TH INTERNATIONAL CONFERENCE ON THE MATHEMATICS OF PROGRAM CONSTRUCTION
, 2000
"... This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong binding-time separation. Because metacomputations are ..."
Abstract
-
Cited by 7 (4 self)
- Add to MetaCart
This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong binding-time separation. Because metacomputations are defined interms of monads, they can be constructed modularly and extensibly using monad transformers. A number of language constructs are specified: expressions, control flow, imperative features, and block structure. Metacomputation-style specification lends itself to semantics-directed compilation, which we demonstrate by creating a modular compiler for a block-structured, imperative while language.
Two Flavors of Offline Partial Evaluation
, 1998
"... . Type-directed partial evaluation is a new approach to program specialization for functional programming languages. Its merits with respect to the traditional offline partial evaluation approach have not yet been fully explored. We present a comparison of type-directed partial evaluation with stand ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
. Type-directed partial evaluation is a new approach to program specialization for functional programming languages. Its merits with respect to the traditional offline partial evaluation approach have not yet been fully explored. We present a comparison of type-directed partial evaluation with standard offline partial evaluation in both a qualitative and quantitative way. For the latter we use implementations of both approaches in Scheme. Both approaches yield equivalent results in comparable time. 1 Introduction Partial evaluation is a technique for automatically specializing programs. One approach is offline partial evaluation where specialization is entirely driven by the results of a program analysis. We consider two offline frameworks which are superficially quite different. In the traditional approach the program analysis is a binding-time analysis, an abstraction of the semantics of specialization. A binding-time analysis determines for each program point whether the specialize...
Compilation as Metacomputation: Binding Time Separation in Modular Compilers (Extended Abstract)
- In 5th Mathematics of Program Construction Conference, MPC2000, Ponte de
, 1998
"... This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong binding-time separation. Because metacomputations are ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong binding-time separation. Because metacomputations are defined in terms of monads, they can be constructed modularly and extensibly using monad transformers. A number of language constructs are specified: expressions, control-flow, imperative features, block structure, and higher-order functions and recursive bindings. Metacomputation-style specification lends itself to semantics-directed compilation, which we demonstrate by creating a modular compiler for a higher-order, imperative, Algol-like language.
A Monadic Approach for Avoiding Code Duplication when Staging Memoized Functions
, 2006
"... Building program generators that do not duplicate generated code can be challenging. At the same time, code duplication can easily increase both generation time and runtime of generated programs by an exponential factor. We identify an instance of this problem that can arise when memoized functions ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
Building program generators that do not duplicate generated code can be challenging. At the same time, code duplication can easily increase both generation time and runtime of generated programs by an exponential factor. We identify an instance of this problem that can arise when memoized functions are staged. Without addressing this problem, it would be impossible to effectively stage dynamic programming algorithms. Intuitively, direct staging undoes the effect of memoization. To solve this problem once and for all, and for any function that uses memoization, we propose a staged monadic combinator library. Experimental results confirm that the library works as expected. Preliminary results also indicate that the library is useful even when memoization is not used.
Dynamically Adaptable Software with Metacomputations in a Staged Language
, 2001
"... Machine Operations ***** datatype Value = code of | Z of int | Void; push : int -> Value M branch : Label -> Label -> Value M pop : Value M read,store : Addr -> Value M ADD,LEQ,NEG : Value M pushReg,loadReg : Value M jump : Label -> Value M newSeg,endlabel : Label->Value M->Value M # ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Machine Operations ***** datatype Value = code of <Value M> | Z of int | Void; push : int -> Value M branch : Label -> Label -> Value M pop : Value M read,store : Addr -> Value M ADD,LEQ,NEG : Value M pushReg,loadReg : Value M jump : Label -> Value M newSeg,endlabel : Label->Value M->Value M #### ## Source, Static & Abstract Machine Operations for the Reference Compiler Figure 1 presents the source language for our compiler. Wehave deliberately kept this language quite simple, because we wish to keep our metacomputationbased compiler as simple as possible. ### is a simple imperative language with while loops. A program is represented as ######## ###############, where ####### are the globally-dened integer program variables with command #### of type ###. #### is either an assignment #############,aloop##############, or a sequence of such statements ############.Variables are dened only in the declarations in the top-level ####### phrase. ### has integer expressions ####### #...
The Guideline for the Accounting
- Management in the Construction Enterprises No.27
, 2003
"... Reproduction of all or part of this work is permitted for educational or research use on condition that this copyright notice is included in any copy. See back inner page for a list of recent BRICS Report Series publications. Copies may be obtained by contacting: BRICS ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Reproduction of all or part of this work is permitted for educational or research use on condition that this copyright notice is included in any copy. See back inner page for a list of recent BRICS Report Series publications. Copies may be obtained by contacting: BRICS
LPS: A Language Prototyping System Using Modular Monadic Semantics
, 2001
"... This paper describes LPS, a Language Prototyping System that facilitates the modular development of interpreters from semantic building blocks. The system is based on the integration of ideas from Modular Monadic Semantics and Generic Programming. To define a new programming language, the abstract s ..."
Abstract
- Add to MetaCart
This paper describes LPS, a Language Prototyping System that facilitates the modular development of interpreters from semantic building blocks. The system is based on the integration of ideas from Modular Monadic Semantics and Generic Programming. To define a new programming language, the abstract syntax is described as the fixpoint of non-recursive pattern functors. For each functor an algebra is defined whose carrier is the computational monad obtained from the application of several monad transformers to a base monad. The interpreter is automatically generated by a catamorphism or, in some special cases, a monadic catamorphism. The system has been implemented as a domain-specific language embedded in Haskell and we have also implemented an interactive framework for language testing. 1

