5 research outputs found

    Eta-Expansion Does The Trick (Revised Version)

    Get PDF
    Partial-evaluation folklore has it that massaging one's source programs can make them specialize better. In Jones, Gomard, and Sestoft's recent textbook, a whole chapter is dedicated to listing such "binding-time improvements": nonstandard use of continuation passing style, eta-expansion, and a popular transformation called "The Trick". We provide a unified view of these binding-time improvements, from a typing perspective.Just as a proper treatment of product values in partial evaluationrequires partially static values, a proper treatment of disjoint sums requires moving static contexts across dynamic case expressions. This requirement precisely accounts for the nonstandard use of continuation-passing style encountered in partial evaluation. Eta-expansion thusacts as a uniform binding-time coercion between values and contexts, be they of function type, product type, or disjoint-sum type. For the latter case, it enables "The Trick".In this article, we extend Gomard and Jones's partial evaluatorfor the lambda-calculus, lambda-Mix, with products and disjoint sums; we pointout how eta-expansion for (finite) disjoint sums enables The Trick; we generalize our earlier work by identifying that eta-expansion can be obtained in the binding-time analysis simply by adding two coercion rules; and we specify and prove the correctness of our extension to lambda-Mix.Keywords: Partial evaluation, binding-time analysis, program specialization,binding-time improvement, eta-expansion, static reduction

    Artificial Intelligence and Intelligent Systems Research in Chile

    Get PDF
    Abstract Worldwide Artificial Intelligence research has witnessed fast and growing advances. These contributions mainly came from first-world nations as other research priorities and needs have been undertaken by less-developed countries. Nevertheless some Latin American countries have put significant efforts into AI research so as to advance in the state-of-the-art at international levels. This paper describes the history, evolution and main contributions of Chile to AI research and applications

    Towards efficient partial evaluation

    No full text
    In general, a partial evaluator needs to keep track of the tasks that have already been completed or initiated, so that it can recognize when to stop unfolding. In the MIX-style polyvariant specialization algorithm, this is accomplished by a global log. This is a very general technique, so it is not surprising that the algorithm is not particularly efficient. In many special cases a simpler technique would suffice. In this paper, we identify some classes of such special cases by considering the purpose of the global log. We outline how a partial evaluator can take advantage of these special cases and we propose analyses to detect them automatically. We discuss examples to illustrate the effect on specialization and to demonstrate that we can even obtain better residual programs. The work presented here is still in its early stages, and we do not have a full system incorporating the proposed improvements. 1 The bookkeeping of polyvariant specialization The underlying principle of the self-applicable MIX-type partial-evaluation algorithms [JSS89] is related to Jones and Mycroft’s minimal function-graphs [JM86]. Each time a procedure is called, the call is compared to a list of already processed calls (sometimes called “seen-before ” [BD91] or “déjà-vu ” [JGS93] — in MIX it is split into “Pending ” and “Out ” [Ses86]). If the current call is found in this log of calls, it is not necessary to process the procedure, and we can simply refer to the result. If it is not found, a reference is created and the call and the reference are entered in the log. Then the procedure is processed and the result is recorded under the reference. In partial evaluation, the reference is typically a freshly created name for the residual procedure. In abstract interpretation, the reference might for example be a non-terminal in a grammar [JM86]. This log is the central administrative structure in the algorithm. It ensures a smooth handling of branches, loops, and recursion in one mechanism and is the key tool for making the specialization terminate in any non-trivial cas

    Towards efficient partial evaluation in logic programming, New Generation Computing 14: 237--259

    No full text
    Abstract Partial evaluation is a symbolic manipulation technique used to produce efficient algorithms when part of the input to the algorithm is known. Other applications of partial evaluators such as universal compilation and compiler generation are also known to be possible. A partial evaluator receives as input a program and partially known input to that program, and outputs a residual program which should run at least as efficient as the input program with restricted input. In this paper we study the case where both the input and residual programs are logic programs, being the partial evaluator itself a logic program. Up to now, partial evaluators have failed to process large "nontoy" examples. Here we present extensions to partial evaluators which will allow us to produce more efficient residual programs using less computing resources during partial evaluation. First, the introduced extensions allow the processing of large examples, which is not possible with the previous techniques. This is now possible since the extensions use less CPU time and memory consumption during the partial evaluation process. Second, the extended partial evaluator produces smaller residual programs, producing important CPU time optimizing effects. With the standard techniques, a partial evaluator will most probably act as a pessimizer, not as an optimizer. Examples are given
    corecore