Results 1 -
7 of
7
Meta-Programming in Logic Programming
- Handbook of Logic in Artificial Intelligence and Logic Programming
, 1994
"... data types are facilitated in Godel by its type and module systems. Thus, in order to describe the meta-programming facilities of Godel, a brief account of these systems is given. Each constant, function, predicate, and proposition in a Godel program must be specified by a language declaration. The ..."
Abstract
-
Cited by 43 (3 self)
- Add to MetaCart
data types are facilitated in Godel by its type and module systems. Thus, in order to describe the meta-programming facilities of Godel, a brief account of these systems is given. Each constant, function, predicate, and proposition in a Godel program must be specified by a language declaration. The type of a variable is not declared but inferred from its context within a particular program statement. To illustrate the type system, we give the language declarations that would be required for the program in Figure 1. BASE Name. CONSTANT Tom, Jerry : Name. PREDICATE Chase : Name * Name; Cat, Mouse : Name. Note that the declaration beginning BASE indicates that Name is a base type. In the statement Chase(x,y) !- Cat(x) & Mouse(y). the variables x and y are inferred to be of type Name. Polymorphic types can also be defined in Godel. They are constructed from the base types, type variables called parameters, and type constructors. Each constructor has an arity 1 attached to it. As an...
A Type-directed, On-line, Partial Evaluator for a Polymorphic Language
- In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation
, 1997
"... Recently, Olivier Danvy introduced a new, simple method for implementing powerful partial evaluators, namely typedirected partial evaluation[9]. He introduced a partial evaluator for the simply-typed lambda calculus (x2). This paper explores the possibility of using the same techniques over a lambda ..."
Abstract
-
Cited by 13 (3 self)
- Add to MetaCart
Recently, Olivier Danvy introduced a new, simple method for implementing powerful partial evaluators, namely typedirected partial evaluation[9]. He introduced a partial evaluator for the simply-typed lambda calculus (x2). This paper explores the possibility of using the same techniques over a lambda calculus with a richer type system. We generalize and extend Danvy's work in four ways: 1. Our system handles a much richer language than that presented by Danvy, including all of the features functional programmers have come to expect, such as polymorphism (x5), inductive datatypes (x10), and recursion (x9). 2. Our system includes a new systematic treatment of primitive operators (x7) and the propagation of residualized code (x7.1). This question has either been ignored or treated in an ad-hoc manner in previous work. 3. Our system handles non-closed terms (x6). This makes type-directed partial evaluation much more practically useful, and can easily be extended to work in languages wit...
Towards a New Perspective on Partial Evaluation
- Yale University
, 1992
"... this paper is divided into three sections. The first presents a classification scheme for the types of divergences that partial evaluators experience and a discussion of different forms of termination (reuse) mechanisms. Next, use-analysis and its application to termination and reuse mechanisms are ..."
Abstract
-
Cited by 13 (1 self)
- Add to MetaCart
this paper is divided into three sections. The first presents a classification scheme for the types of divergences that partial evaluators experience and a discussion of different forms of termination (reuse) mechanisms. Next, use-analysis and its application to termination and reuse mechanisms are presented. The paper closes with our plans for future research and some conclusions.
Accelerating Object-Oriented Simulation via Automatic Program Specialization
, 1992
"... Object-oriented simulations in an object-oriented environment are easier to construct and maintain than conventionally programmed simulations. Unfortunately, they are also slower because of message passing and other runtime overhead. We have developed an automatic program transformer that solves the ..."
Abstract
-
Cited by 5 (0 self)
- Add to MetaCart
Object-oriented simulations in an object-oriented environment are easier to construct and maintain than conventionally programmed simulations. Unfortunately, they are also slower because of message passing and other runtime overhead. We have developed an automatic program transformer that solves the efficiency problem for a large class of simulation programs. It automatically constructs an efficient program from the inefficient simulation program and the objects it will receive as input. Depending on the object-oriented language used, and the application, the new program can be more than an order of magnitude faster than the original program. In this paper we describe the benefits of object-oriented simulation, our transformer, and how such dramatic speedups are possible. This research has been supported in part by NSF Contract No. MIP-8902764, and in part by Advanced Research Projects Agency, Department of Defense, Contract No. N0039-91-K-0138. Key Words and Phrases: Object-Oriented S...
Implementing Bit-addressing with Specialization
- In Proceedings Of the 1997 ACM SIGPLAN International Conference on Functional Programming
, 1997
"... General media-processing programs are easily expressed with bitaddressing and variable-sized bit-fields. But the natural implementation of bit-addressing relies on dynamic shift offsets and repeated loads, resulting in slow execution. If the code is specialized to the alignment of the data against w ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
General media-processing programs are easily expressed with bitaddressing and variable-sized bit-fields. But the natural implementation of bit-addressing relies on dynamic shift offsets and repeated loads, resulting in slow execution. If the code is specialized to the alignment of the data against word boundaries, the offsets become static and many repeated loads can be removed. We show how introducing modular arithmetic into an automatic compiler generator enables the transformation of a program that uses bit-addressing into a synthesizer of fast specialized programs. In partial-evaluation jargon we say: modular arithmetic is supported by extending the binding time lattice used by the static analysis in a polyvariant compiler generator. The new binding time Cyclic functions like a partially static integer. A software cache combined with a fast, optimistic sharing analysis built into the compilers eliminates repeated loads and stores. The utility of the transformation is demonstrated ...
Reasoning about Hierarchies of Online Program Specialization Systems
- In Danvy et
"... . We present the language S-Graph-n --- the core of a multilevel metaprogramming environment for exploring foundational issues of self-applicable online program specialization. We illustrate how special-purpose S-Graph-n primitives can be used to obtain an efficient and conceptually simple encoding ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
. We present the language S-Graph-n --- the core of a multilevel metaprogramming environment for exploring foundational issues of self-applicable online program specialization. We illustrate how special-purpose S-Graph-n primitives can be used to obtain an efficient and conceptually simple encoding of programs as data objects. The key feature of the encoding scheme is the use of numerical indices which indicate the number of times that a program piece has been encoded. Evaluation of S-Graph-n is formalized via an operational semantics. This semantics is used to justify the fundamental operations on metavariables --- special-purpose tags for tracking unknown values in self-applicable online specialization systems. We show how metavariables can be used to construct biased generating extensions without relying on a separate binding-time analysis phase. 1 Introduction Metasystem hierarchies have been used for more than a decade to generate compilers and other program generators. A metasy...
Preliminary Report on a Self-Applicable Online Partial Evaluator for Flowchart
"... Abstract. This is a preliminary report on a self-applicable online partial evaluator for a flowchart language with recursive calls. Self-application of the partial evaluator yields generating extensions that are as efficient as those reported in the literature for offline partial evaluation. This re ..."
Abstract
- Add to MetaCart
Abstract. This is a preliminary report on a self-applicable online partial evaluator for a flowchart language with recursive calls. Self-application of the partial evaluator yields generating extensions that are as efficient as those reported in the literature for offline partial evaluation. This result is remarkable because partial evaluation folklore has indicated that online partial evaluation techniques unavoidably lead to overgeneralized generating extensions. The purpose of this paper is not to argue which line of partial evaluation is better, but to show how the problem can be solved by recursive polyvariant specialization. The online partial evaluator, its techniques and implementation, are presented in a complete way. Full self-application according to the Futamura projections is demonstrated. 1

