28 research outputs found

    A Polyvariant Binding-Time Analysis for Off-line Partial Deduction

    Full text link
    We study the notion of binding-time analysis for logic programs. We formalise the unfolding aspect of an on-line partial deduction system as a Prolog program. Using abstract interpretation, we collect information about the run-time behaviour of the program. We use this information to make the control decisions about the unfolding at analysis time and to turn the on-line system into an off-line system. We report on some initial experiments.Comment: 19 pages (including appendix) Paper (without appendix) appeared in Programming Languages and Systems, Proceedings of the European Symposium on Programming (ESOP'98), Part of ETAPS'98 (Chris Hankin, eds.), LNCS, vol. 1381, 1998, pp. 27-4

    Fast Offline Partial Evaluation of Logic Programs

    Full text link
    One of the most important challenges in partial evaluation is the design of automatic methods for ensuring the termination of the process. In this work, we introduce sufficient conditions for the strong (i.e., independent of a computation rule) termination and quasitermination of logic programs which rely on the construction of size-change graphs. We then present a fast binding-time analysis that takes the output of the termination analysis and annotates logic programs so that partial evaluation terminates. In contrast to previous approaches, the new binding-time analysis is conceptually simpler and considerably faster, scaling to medium-sized or even large examples. © 2014 Elsevier Inc. All rights reserved.This work has been partially supported by the Spanish Ministerio de Ciencia e Innovacion under grant TIN2008-06622-C03-02 and by the Generalitat Valenciana under grant PROMETEO/2011/052.Leuschel, M.; Vidal Oriola, GF. (2014). Fast Offline Partial Evaluation of Logic Programs. Information and Computation. 235:70-97. https://doi.org/10.1016/j.ic.2014.01.005S709723

    Poly-controlled partial evaluation and its application to resource-aware program specialization

    Get PDF
    La Evaluación Parcial es una técnica automática para la optimización de programas. Su objetivo principal es el de especializar un programa con respecto a parte de sus datos de entrada, los que se conocen como datos estáticos. La calidad del código generado por la evaluación parcial de programas lógicos depende, en gran medida, de la estrategia de control que se haya empleado. Desafortunadamente, aún estamos lejos de contar con una estrategia de control suficientemente sofisticada como para comportarse de manera óptima para cualquier programa. La principal contribución de esta tesis es el desarrollo de la Evaluación Parcial Policontrolada, un novedoso entorno para la evaluación parcial de programas lógicos, el cual es policontrolado en el sentido de que puede tomar en cuenta conjuntos de reglas de control global y local, en lugar de emplear una única combinación predeterminada (como es el caso de la evaluación parcial tradicional). Este entorno es más flexible que los enfoques existentes, ya que permite asignar diferentes reglas de control local y global a diferentes patrones de llamada. De este modo, es posible obtener programas especializados que no pueden ser generados usando evaluación parcial tradicional. En consecuencia, el entorno de evaluación parcial policontrolada puede generar conjuntos de programas especializados, en lugar de un único programa. A través de técnicas auto-ajustables, es posible hacer que este enfoque sea completamente automático. Dichas técnicas permiten medir la calidad de los diferentes programas especializados obtenidos. Este entorno es consciente de los recursos, en el sentido de que cada una de las soluciones obtenidas a través de la evaluación parcial policontrolada es valorada utilizando funciones de adecuación, las que pueden tener en cuenta factores tales como el tamaño de los programas especializados, o la cantidad de memoria que consumen, además de la velocidad del programa especializado que es el factor habitualmente considerado en otros entornos de evaluación parcial. Este entorno de evaluación parcial policontrolada ha sido implementado en el sistema CiaoPP, y evaluado con numerosos programas de prueba. Los resultados experimentales muestran que nuestra propuesta obtiene en muchos casos mejores especializaciones que aquellas generadas usando la evaluación parcial tradicional, especialmente cuando la especialización es consciente de los recursos. Otra de las principales contribuciones de esta tesis es la presentación de una visión unificada del problema de eliminar la polivarianza superflua en la evaluación parcial y en la especialización abstracta múltiple, a través del uso de un paso de minimización, el cual agrupa versiones equivalentes de predicados. Este paso se puede aplicar en la especialización de cualquier programa Prolog, inclusive aquellos que contienen llamadas a predicados predefinidos o predicados externos. Además, ofrecemos la posibilidad de agrupar versiones que no sean estrictamente equivalentes, con el propósito de obtener programas más pequeños

    Program Transformations in Magnolia

    Get PDF
    We explore program transformations in the context of the Magnolia programming language. We discuss research and implementations of transformation techniques, scenarios to put them to use in Magnolia, interfacing with transformations, and potential workflows and tooling that this approach to programming enables.Vi utforsker program transformasjoner med tanke på programmeringsspråket Magnolia. Vi diskuterer forsking og implementasjoner av transformasjonsteknikker, sammenhenger der vi kan bruke dei i Magnolia, grensesnitt til transformasjoner, og potensielle arbeidsflyt og verktøy som denne tilnærmingen til programmering kan tillate og fremme.Masteroppgåve i informatikkINF39

    Partial evaluation in an optimizing prolog compiler

    Get PDF
    Specialization of programs and meta-programs written in high-level languages has been an active area of research for some time. Specialization contributes to improvement in program performance. We begin with a hypothesis that partial evaluation provides a framework for several traditional back-end optimizations. The present work proposes a new compiler back-end optimization technique based on specialization of low-level RISC-like machine code. Partial evaluation is used to specialize the low-level code. Berkeley Abstract Machine (BAM) code generated during compilation of Prolog is used as the candidate low-level language to test the hypothesis. A partial evaluator of BAM code was designed and implemented to demonstrate the proposed optimization technique and to study its design issues. The major contributions of the present work are as follows: It demonstrates a new low-level compiler back-end optimization technique. This technique provides a framework for several conventional optimizations apart from providing opportunity for machine-specific optimizations. It presents a study of various issues and solutions to several problems encountered during design and implementation of a low-level language partial evaluator that is designed to be a back-end phase in a real-world Prolog compiler. We also present an implementation-independent denotational semantics of BAM code--a low-level language. This provides a vehicle for showing the correctness of instruction transformations. We believe this work to provide the first concrete step towards usage of partial evaluation on low-level code as a compiler back-end optimization technique in real-world compilers

    Termination Proofs for Logic Programs with Tabling

    Full text link
    Tabled logic programming is receiving increasing attention in the Logic Programming community. It avoids many of the shortcomings of SLD execution and provides a more flexible and often extremely efficient execution mechanism for logic programs. In particular, tabled execution of logic programs terminates more often than execution based on SLD-resolution. In this article, we introduce two notions of universal termination of logic programming with Tabling: quasi-termination and (the stronger notion of) LG-termination. We present sufficient conditions for these two notions of termination, namely quasi-acceptability and LG-acceptability, and we show that these conditions are also necessary in case the tabling is well-chosen. Starting from these conditions, we give modular termination proofs, i.e., proofs capable of combining termination proofs of separate programs to obtain termination proofs of combined programs. Finally, in the presence of mode information, we state sufficient conditions which form the basis for automatically proving termination in a constraint-based way.Comment: 48 pages, 6 figures, submitted to ACM Transactions on Computational Logic (TOCL

    FOAL 2002 Proceedings: Foundations of Aspect-Oriented Langauges Workshop at AOSD 2002

    Get PDF
    Aspect-oriented programming is a new area in software engineering and programming languages that promises better support for separation of concerns. The first Foundations of Aspect-Oriented Languages (FOAL) workshop was held at the 1st International Conference on Aspect-Oriented Software Development in Enschede, The Netherlands, on April 22, 2002. This workshop was designed to be a forum for research in formal foundations of aspect-oriented programming languages. The call for papers announced the areas of interest for FOAL as including, but not limited to: formal semantics, formal specification, verification, theory of testing, aspect management, theory of aspect composition, and aspect translation and rewriting. The call for papers welcomed all theoretical and foundational studies of this topic. The goals of this FOAL workshop were to: • Explore the formal foundations of aspect-oriented programming. • Exchange ideas about semantics and formal methods for aspect-oriented programming languages. • Foster interest in the programming language theory communities concerning aspects and aspect- oriented programming languages. • Foster interest in the formal methods community concerning aspects and aspect-oriented programming. In addition, we hoped that the workshop would produce an outline of collaborative research topics and a list of areas for further exploration. The papers at the workshop, which are included in the proceedings, were selected from papers submitted by researchers worldwide. Due to time limitations at the workshop, not all of the submitted papers were selected for presentation
    corecore