18 research outputs found

    Improving PARMA Trailing

    Full text link
    Taylor introduced a variable binding scheme for logic variables in his PARMA system, that uses cycles of bindings rather than the linear chains of bindings used in the standard WAM representation. Both the HAL and dProlog languages make use of the PARMA representation in their Herbrand constraint solvers. Unfortunately, PARMA's trailing scheme is considerably more expensive in both time and space consumption. The aim of this paper is to present several techniques that lower the cost. First, we introduce a trailing analysis for HAL using the classic PARMA trailing scheme that detects and eliminates unnecessary trailings. The analysis, whose accuracy comes from HAL's determinism and mode declarations, has been integrated in the HAL compiler and is shown to produce space improvements as well as speed improvements. Second, we explain how to modify the classic PARMA trailing scheme to halve its trailing cost. This technique is illustrated and evaluated both in the context of dProlog and HAL. Finally, we explain the modifications needed by the trailing analysis in order to be combined with our modified PARMA trailing scheme. Empirical evidence shows that the combination is more effective than any of the techniques when used in isolation. To appear in Theory and Practice of Logic Programming.Comment: 36 pages, 7 figures, 8 table

    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

    Global flow analysis as a practical compilation tool

    Get PDF
    This paper addresses the issue of the practicality of global flow analysis in logic program compilation, in terms of speed of the analysis, precisión, and usefulness of the information obtained. To this end, design and implementation aspects are discussed for two practical abstract interpretation-based flow analysis systems: MA , the MCC And-parallel Analyzer and Annotator; and Ms, an experimental mode inference system developed for SB-Prolog. The paper also provides performance data obtained (rom these implementations and, as an example of an application, a study of the usefulness of the mode information obtained in reducing run-time checks in independent and-parallelism.Based on the results obtained, it is concluded that the overhead of global flow analysis is not prohibitive, while the results of analysis can be quite precise and useful

    Programming constraint services

    Get PDF
    This thesis presents design, application, implementation, and evaluation of computation spaces as abstractions for programming constraint services at a high level. Spaces are seamlessly integrated into a concurrent programming language and make constraintbased computations compatible with concurrency through encapsulation. Spaces are applied to search and combinators as essential constraint services. State-of-the-art and new search engines such as visual interactive search and parallel search are covered. Search is expressive and concurrency-compatible by using copying rather than trailing. Search is space and time efficient by using recomputation. Composable combinators, also known as deep-guard combinators, stress the control facilities and concurrency integration of spaces. The implementation of spaces comes as an orthogonal extension to the implementation of the underlying programming language. The resulting implementation is shown to be competitive with existing constraint programming systems.Diese Dissertation beschreibt Entwurf, Verwendung, Implementierung und Evaluierung von Computation Spaces für die Programmierung von Constraintdiensten. Spaces werden in eine nebenläufige Programmiersprache integriert. Sie fungieren als Kapseln für Berechnungen mit Constraints. Dadurch wird die Kompatibilität zu nebenläufigen Berechnungen gewährleistet. Suche und Kombinatoren sind zentrale Constraintdienste, die mit Spaces programmiert werden. Es werden sowohl übliche, als auch vollkommen neue Suchmaschinen, wie zum Beispiel interaktive Suche und parallele Suche, vorgestellt. Durch Kopieren wird Suche ausdrucksstark und kompatibel mit Nebenläufigkeit. Durch Wiederberechnung wird Suche effizient hinsichtlich Speicherbedarf und Laufzeit. Kombinatoren, die ineinander geschachtelt werden können (so genannte deep-guard Kombinatoren), verdeutlichen die Kontrollmöglichkeiten von Spaces. Die Implementierung von Spaces erfolgt als orthogonale Erweiterung einer Implementierung für die zugrundeliegende Programmiersprache. Das Ergebnis ist konkurrenzfähig zu existierenden Constraintprogrammiersystemen

    MuLE : A Multi-Paradigm Language for Education

    Get PDF

    Tools and Language Elements for Testing, Encapsulation and Controlling Abstraction in Large Scale C++ Projects

    Get PDF
    A disszertáció új kutatási eredményeket mutat be három alapvető szoftver fejlesztési területen: tesztelés, egységbezárás és absztrakció. Az első három tézis az ún. nem-tolakodó teszteléssel foglalkozik, amely egy olyan tesztelési technika amely során nem szükséges semmilyen strukturális módosítást végrehajtanunk a termék forráskódján. Megvitatjuk a már létező nem-tolakodó tesztelési módszereket és felsoroljuk ezek előnyeit és hátrányait. Bevezetünk egy új, nem-tolakodó tesztelési módszert amely függvény hívás közbeavatkozáson alapszik és számos egyértelmű előnnyel rendelkezik a korábbi megoldásokhoz képest. Ezzel az új technikával képesek vagyunk függvényeket teszt dublőrökkel helyettesíteni még akkor is ha azok inline függvények. Továbbá bemutatunk két új kísérleti eljárást amelyek lehetővé teszik, hogy akár típusokat is helyettesítsünk teszt dublőrökkel: az egyik metódus szintaxis fa transzformációkon alapszik, a másik pedig fordítási idejű reflectionön. Demonstráljuk, hogy gyakran előfordul, hogy szükséges privát tagokhoz hozzáférni a nem-tolakodó tesztek esetében. Bemutatunk két új módszert a privát tagok eléréséhez (és ily módon támogatjuk a nem-tolakodó és fehér doboz tesztek létrehozását): egy program könyvtárat amely explicit sablon példányosításon alapszik, illetve az osztályon kívüli barát (friend) nyelvi elemet. Az egységbezárással kapcsolatosan szemléltetjük, hogy bizonyos nyelvi konstrukciók minta C++ barát (friend) túlzottan erős hozzáférést nyújthat egy osztály belső elemeihez. Ez a túlzott hozzáférés hibák forrása lehet az adott szoftverben. Javaslatot teszünk egy új nyelvi elem létrehozására amely lehetővé teszi, hogy megszorítsuk ezt a hozzáférést csupán néhány jól specifikált taghoz, ily módon erősítendő az egységbezárást és adatrejtést. Az egységbezárás mellett az absztrakció a másik alapvető szereplő ha nagy méretű szoftverek fejlesztéséről van szó. Különösen,ha többszálú programokról beszélünk. Bemutatunk egy új magas szintű C++ absztrakciót mely a read-copy-update konkurrens programozási mintán alapszik és elfogadható teljesítményt nyújt amellett, hogy kellően generikus és biztonságos használni. Az itt bemutatott új módszerek mindegyikéhez tartozik prototípus implementáció (ez alól kivételt képez a reflection alapú nem-tolakodó tesztelés ötlete)
    corecore