10 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

    Syntactic Accidents in Program Analysis: On the Impact of the CPS Transformation

    Get PDF
    We show that a non-duplicating CPS transformation has no effect on control-flow analysis and that it has a positive effect on binding-time analysis: a monovariant control-flow analysis yields equivalent results on a direct-style programand on its CPS counterpart, and a monovariant binding-time analysis yields more precise results on a CPS program than on its direct-style counterpart. Our proof technique amounts to constructing the continuation-passing style (CPS) counterpart of flow information and of binding times.Our results confirm a folklore theorem about binding-time analysis, namelythat CPS has a positive effect on binding times. What may be more surprising is that this benefit holds even if contexts or continuations are not duplicated. The present study is symptomatic of an unsettling property of program analyses: their quality is unpredictably vulnerable to syntactic accidents in source programs, i.e., to the way these programs are written. More reliable program analyses require a better understanding of the effect of syntactic change

    An Analytical Approach to Programs as Data Objects

    Get PDF
    This essay accompanies a selection of 32 articles (referred to in bold face in the text and marginally marked in the bibliographic references) submitted to Aarhus University towards a Doctor Scientiarum degree in Computer Science.The author's previous academic degree, beyond a doctoral degree in June 1986, is an "Habilitation à diriger les recherches" from the Université Pierre et Marie Curie (Paris VI) in France; the corresponding material was submitted in September 1992 and the degree was obtained in January 1993.The present 32 articles have all been written since 1993 and while at DAIMI.Except for one other PhD student, all co-authors are or have been the author's students here in Aarhus

    Customizable Templates for OutSystems Applications

    Get PDF
    This dissertation addresses an extension of a metaprogramming mechanism in low-code platforms, specifically in the OutSystems platform. As proposed in the template language OSTRICH, model templates allow developers to reuse existing and thoroughly tested code fragments in a more productive and sound development process. Code templates help to overcome developer difficulties and lack of training. For instance, the development of professionally designed user interfaces is not a skill that is common amongst developers. Scenarios like specific synchronization algorithms are the other end of the spectrum for templates in OutSystems. The GOLEM project has the chief objective of providing mechanisms for automated programming. Such automation will make programming more accessible to a larger community of developers. This work is part of those efforts. To this end, our focus will be on developing and improving the template language OSTRICH that targets the OutSystems platform. It enables the creation of code fragments like screen templates, saving the user from the cumbersome task of repeatedly constructing code complex patterns. In OSTRICH, templates are instantiated by expanding their definition in the caller context to enable further customization of the resulting code. OSTRICH preserves the structure of the original model by expanding templates in place. However, expanding the template definition in place breaks the possibility of reapplying the template in the case of an update to a newer version or changing parameters. It requires the user to repeat all customization operations on top of a new instantiation of the template. Our purpose is to solve this issue by supporting customization operations that extend to all future template updates and new parameters. This way, the user will be saved from some erroneous trials, which could, eventually, push them to give up. We plan to evaluate our work using the benchmark template examples used previously to evaluate OSTRICH.Esta dissertação aborda uma extensão de um mecanismo de metaprogramação em pla- taformas low-code, especificamente na plataforma da OutSystems. Como proposto na linguagem de template OSTRICH, os templates permitem que os utilizadores reutilizem fragmentos de código existentes e completamente testados num processo de desenvol- vimento produtivo e seguro. Estes fragmentos ajudam os utilizadores a ultrapassar as dificuldades ou falta de conhecimento em linguagens de programação. Por exemplo, a sua utilização permite criar interfaces de forma profissional, o que nem sempre é uma habilidade comum entre desenvolvedores de software. Do outro lado do espetro, estão os algoritmos de sincronização específicos para modelos em OutSystems. O projeto GOLEM tem como principal objetivo fornecer mecanismos para automatizar a programação. Esta automatização irá tornar a programação mais acessível a um maior número de pessoas. Este trabalho faz parte destes esforços. Para alcançar este objetivo, estaremos focados no desenvolvimento e melhoria da linguagem de template OSTRICH para a plataforma da OutSystems. Esta permite a cria- ção de fragmentos de código como screen templates, poupando os utilizadores da tarefa complicada de repetir padrões complexos de código. Nesta linguagem, os templates são instanciados através da expansão da sua definição para permitir a customização do código resultante. Contudo, expandir esta definição no local quebra a possibilidade de reaplicar o template em caso de atualização para uma versão mais recente ou mudança de parâmetros. Isto acaba por obrigrar o utilizador a repetir todas as operações aplicadas numa nova instanciação de template. O nosso propósito passa por resolver este problema, permitindo que as operações do utilizador possam ser reaplicadas em todas as novas atualizações do template e novos parâmetros. Desta forma, o utilizador será poupado de seguir uma apren- dizagem tentativa e erro, que poderia eventualmente levá-lo a desistir. Planeamos avaliar o nosso trabalho utilizando como referência exemplos de templates usados anteriormente para avaliar a linguagem OSTRICH

    Syntactic Accidents in Program Analysis: On the Impact of the CPS Transformation

    Full text link

    Specialization of applications using shared libraries

    Get PDF
    Ph.DDOCTOR OF PHILOSOPH

    Progressive program reasoning

    Get PDF
    Ph.DDOCTOR OF PHILOSOPH

    Correctness of Binding-time Analysis

    No full text
    A binding-time analysis is correct if it always produces consistent binding-time information. Consistency prevents partial evaluators from "going wrong". A sufficient and decidable condition for consistency, called well-annotatedness, was first presented by Gomard and Jones. In this paper we prove that a weaker condition implies consistency. Our condition is decidable, subsumes the one of Gomard and Jones, and was first studied by Schwartzbach and the present author. Our result implies the correctness of the binding-time analysis of Mogensen, and it indicates the correctness of the core of the binding-time analyses of Bondorf and Consel. We also prove that all partial evaluators will on termination have eliminated all "eliminable"-marked parts of an input which satisfies our condition. This generalizes a result of Gomard. Our development is for the pure -calculus with explicit binding-time annotations. 1 Introduction A partial evaluator is an implementation of Kleene's S m n theorem...

    Mechanically Verifying the Correctness of an Offline Partial Evaluator

    No full text
    . We show that using deductive systems to specify an offline partial evaluator allows one to specify, prototype, and mechanically verify correctness via meta-programming --- all within a single framework. For a -mix-style partial evaluator, we specify binding-time constraints using a natural-deduction logic, and the associated program specializer using natural (aka "deductive") semantics. These deductive systems can be directly encoded in the Elf programming language --- a logic programming language based on the LF logical framework. The specifications are then executable as logic programs. This provides a prototype implementation of the partial evaluator. Moreover, since deductive system proofs are accessible as objects in Elf, many aspects of the partial evaluator correctness proofs (e.g., the correctness of binding-time analysis) can be coded in Elf and mechanically checked. 1 Introduction Offline partial evaluation consists of two phases: a binding-time analysis phase (where inform..
    corecore