8 research outputs found

    A Practical View on Renaming

    Full text link
    We revisit variable renaming from a practitioner's point of view, presenting concepts we found useful in dealing with operational semantics of pure Prolog. A concept of relaxed core representation is introduced, upon which a concept of prenaming is built. Prenaming formalizes the intuitive practice of renaming terms by just considering the necessary bindings, where now some passive "bindings" x/x may be necessary as well. As an application, a constructive version of variant lemma for implemented Horn clause logic has been obtained. There, prenamings made it possible to incrementally handle new (local) variables.Comment: In Proceedings WLP'15/'16/WFLP'16, arXiv:1701.0014

    Abstract State Machines 1988-1998: Commented ASM Bibliography

    Get PDF
    An annotated bibliography of papers which deal with or use Abstract State Machines (ASMs), as of January 1998.Comment: Also maintained as a BibTeX file at http://www.eecs.umich.edu/gasm

    TWAM: A Certifying Abstract Machine for Logic Programs

    Full text link
    Type-preserving (or typed) compilation uses typing derivations to certify correctness properties of compilation. We have designed and implemented a type-preserving compiler for a simply-typed dialect of Prolog we call T-Prolog. The crux of our approach is a new certifying abstract machine which we call the Typed Warren Abstract Machine (TWAM). The TWAM has a dependent type system strong enough to specify the semantics of a logic program in the logical framework LF. We present a soundness metatheorem which constitutes a partial correctness guarantee: well-typed programs implement the logic program specified by their type. This metatheorem justifies our design and implementation of a certifying compiler from T-Prolog to TWAM.Comment: 41 pages, under submission to ACM Transactions on Computational Logi

    On Applying Linear Tabling to Logic Programs

    Get PDF
    As linguagens de Programação em Lógica que derivam da lógica de Horn, tal como oProlog, têm mecanismos de resolução baseados em inferência que são bastante conhecidos.Embora o Prolog seja uma linguagem com bastante sucesso, o seu potencial é limitadopelo seu mecanismo de resolucão, que é baseado na resolucão SLD. O mecanismode resolução SLD foi provado ser bastante ineficiente quando avalia programas logicosque têm ciclos infinitos ou sub-computações redundantes. A tabulacão é uma técnicade implementação bastante reconhecida e poderosa que permite ultrapassar essaslimitações em sistemas de Prolog que são baseados na resolução SLD. Actualmente,a técnica de tabulação pode ser dividida em dois grandes mecanismos: por suspensãodas pilhas de execução e por execução linear. Os mecanismos por suspensão daspilhas de execução são considerados terem melhores resultados, no entanto eles têmmais requisitos em termos de memória e são mais complexos de implementar do queos mecanismos lineares.O trabalho apresentado nesta tese pretende fazer um estudo aprofundado sobre osmecanismos de tabulação linear, de forma a perceber como as diferentes estratégiasde tabulação afectam o fluxo de avaliação de um programa lógico e melhoram a performancegeral do sistema. As estratégias SLDT e DRA são duas das mais conhecidase bem sucedidas estratégias implementadas em sistemas de tabulação linear. Nestetrabalho, propomos uma nova estratégia, que foi denominada de DRS, e apresentamosuma plataforma integrada, que suporta a combinação das três estratégias. A nossaimplementação partilha o ambiente de execução e a maioria das estructuras de dadosusadas pela máquina de execução do YapTab, que é o actual mecanismo de tabulaçãobaseado em suspensão de pilhas do sistema Yap Prolog. A combinação de todasas estratégias e mecanismos na nossa plataforma permitiu-nos fazer uma primeiracomparação justa entre todas as estratégias lineares, usadas sozinhas ou combinadas,e o mecanismo original do YapTab, de forma a perceber as vantagens e desvantagens decada um. Os resultados obtidos, confirmam que os mecanismos baseados em suspensão têm, no geral, melhores resultados do que os mecanismos lineares, sendo que a diferençaentre os resultados de ambos os sistemas pode ser em grande parte reduzida atravésda combinação correcta das melhores estratégias lineares.Logic programming languages, such as Prolog, are derived from Horn Clause Logicand provide a well understood resolution based inference mechanism. Although Prologis a popular and successful language, its potential is limited by the SLD resolutionmethod on which it is based. SLD resolution was proven to be inecient whendealing with innite loops and redundant subcomputations. Tabled evaluation isa recognized and powerful technique that overcomes those limitations on traditionalProlog systems based on SLD resolution. We can distinguish two main categoriesof tabling mechanisms: suspension-based tabling and linear-based tabling. Whilesuspension-based mechanisms are considered to obtain better results in general, theyhave more memory space requirements and are more complex and hard to implementthan linear tabling mechanisms.The work presented on this thesis was focused on making a deep study about lineartabling, in order to understand how dierent linear tabling strategies can aect theevaluation ow of tabled programs and improve its overall performance. Arguably,the SLDT and DRA strategies are the two most successful extensions to standardlinear tabled evaluation. In this work, we propose a new strategy, named DRS, andwe present a framework, on top of the Yap system, that supports the combinationof all these three linear tabling strategies. Our implementation shares the underlyingexecution environment and most of the data structures used to implement tablingin the YapTab engine, which is the actual suspension-based tabling mechanism ofthe Yap Prolog system. All these common features allows us to make a rst andfair comparison between the linear tabling strategies, used solely or combined withthe other, and YapTab's suspension-based mechanism, in order to better understandthe advantages and weaknesses of each feature. The obtained results conrmed thatsuspension-based mechanisms have, in general, better performance than linear tablingand that the dierence between both mechanisms can be highly reduced by using thecorrect combination of linear tabling strategies

    Language Interoperability and Logic Programming Languages

    Get PDF
    We discuss P#, our implementation of a tool which allows interoperation between a concurrent superset of the Prolog programming language and C#. This enables Prolog to be used as a native implementation language for Microsoft's .NET platform. P# compiles a linear logic extension of Prolog to C# source code. We can thus create C# objects from Prolog and use C#'s graphical, networking and other libraries. P# was developed from a modified port of the Prolog to Java translator, Prolog Cafe. We add language constructs on the Prolog side which allow concurrent Prolog code to be written. We add a primitive predicate which evaluates a Prolog structure on a newly forked thread. Communication between threads is based on the unification of variables contained in such a structure. It is also possible for threads to communicate through a globally accessible table. All of the new features are available to the programmer through new built-in Prolog predicates. We present three case studies. The first is an application which allows several users to modify a database. The users are able to disconnect from the database and to modify their own copies of the data before reconnecting. On reconnecting, conflicts must be resolved. The second is an object-oriented assistant, which allows the user to query the contents of a C# namespace or Java package. The third is a tool which allows a user to interact with a graphical display of the inheritance tree. Finally, we optimize P#'s runtime speed by translating some Prolog predicates into more idiomatic C# code than is produced by a naive port of Prolog Cafe. This is achieved by observing that semi-deterministic predicates (being those which always either fail or succeed with exactly one solution) that only call other semi-deterministic predicates enjoy relatively simple control flow. We make use of the fact that Prolog programs often contain predicates which operate as functions, and that such predicates are usually semi-deterministic

    Verification of Compiler Correctness for the WAM

    No full text
    . Relying on a derivation of the Warren Abstract Machine (WAM) by stepwise refinement of Prolog models by Borger and Rosenzweig we present a formalization of an operational semantics for Prolog. Then we develop four refinement steps towards the Warren Abstract Machine (WAM). The correctness and completeness proofs for each step have been elaborated with the theorem prover Isabelle using the logic HOL. 1 Introduction In the area of logic programming, Prolog ranks among the most prominent programming languages. The development of efficient compilation techniques allows the application of logic programming even in large-scale software development. One of the main contributions to this field is due to D. Warren, having developed a sophisticated compilation concept known as the Warren Abstract Machine (WAM), which serves as basis for a large number of prolog implementations. While Prolog benefits from a well-defined semantics derived from its logical roots, the development of the W..

    Verification of compiler correctness for the WAM

    No full text
    corecore