24 research outputs found

    A Rewrite Framework for Language Definitions and for Generation of Efficient Interpreters

    Get PDF
    A rewrite logic semantic definitional framework for programming languages is introduced, called K, together with partially automated translations of K language definitions into rewriting logic and into C. The framework is exemplified by defining SILF, a simple imperative language with functions. The translation of K definitions into rewriting logic enables the use of the various analysis tools developed for rewrite logic specifications, while the translation into C allows for very efficient interpreters. A suite of tests show the performance of interpreters compiled from K definitions

    An Institutional Foundation for the K Semantic Framework

    Get PDF

    All-Path Reachability Logic

    Full text link
    This paper presents a language-independent proof system for reachability properties of programs written in non-deterministic (e.g., concurrent) languages, referred to as all-path reachability logic. It derives partial-correctness properties with all-path semantics (a state satisfying a given precondition reaches states satisfying a given postcondition on all terminating execution paths). The proof system takes as axioms any unconditional operational semantics, and is sound (partially correct) and (relatively) complete, independent of the object language. The soundness has also been mechanized in Coq. This approach is implemented in a tool for semantics-based verification as part of the K framework (http://kframework.org

    IELE: A Rigorously Designed Language and Tool Ecosystem for the Blockchain

    Get PDF
    This paper proposes IELE, an LLVM-style language, together with a tool ecosystem for implementing and formally reasoning about smart contracts on the blockchain. IELE was designed by specifying its semantics formally in the K framework. Its implementation, a IELE virtual machine (VM), as well as a formal verification tool for IELE smart contracts, were automatically generated from the formal specification. The automatically generated formal verification tool allows us to formally verify smart contracts without any gap between the verifier and the actual VM. A compiler from Solidity, the predominant high-level language for smart contracts, to IELE has also been (manually) implemented, so Ethereum contracts can now also be executed on IELE.Ope

    A Rewriting Logic Approach to Operational Semantics

    Get PDF
    We show how one can use rewriting logic to faithfully capture (not implement) various operational semantic frameworks as rewrite logic theories, namely big-step and small-step semantics, reduction semantics using evaluation contexts, and continuation-based semantics. There is a one-to-one correspondence between an original operational semantics and its associated rewrite logic theory, both notationally and computationally. Once an operational semantics is defined as a rewrite logic theory, one can use standard, off-the-shelf context-insensitive rewrite engines to ``execute'' programs directly within their semantics; in other words, one gets interpreters for free for the defined languages, directly from their semantic definitions. Experiments show that the resulting correct-by-definition interpreters are also reasonably efficient

    Towards Effectively Eliminating Conditional Rewrite Rules

    Get PDF
    Conditional rewrite rules are notorious for being difficult to implement in rewrite engines. This is because, like in the case of function calls in programming language implementations, rewrite engines need to "freeze" the current rewriting environment and to create a new one in which the condition is reduced. Stacking these rewriting environments efficiently can easily become a nontrivial task, which can have a direct impact on the efficiency of rewriting. Continuation-passing-style (CPS) transformations are used as a front-end in many programming languages to transform the programs to compile into a convenient and highly optimizable form, in which functions never need to return their values: they just pass their computed values to the current data-context, which "knows" how to continue the computation.We argue that a similar transformation technique can be applied to conditional rewrite systems, to transform them into computationally equivalent unconditional rewrite systems. In this paper we present the first steps towards such a transformation. No special support is needed from the underlying unconditional rewrite engine, so the presented technique can be used as a front-end to any of the current rewrite engines. Since unconditional rewriting is more amenable to parallelization, our transformation is expected to lead to efficient concurrent implementations of rewriting

    A rewriting approach to concurrent programming language design and semantics

    Get PDF
    A plethora of programming languages have been and continue to be developed to keep pace with hardware advancements and the ever more demanding requirements of software development. As these increasingly sophisticated languages need to be well understood by both programmers and implementors, precise specifications are increasingly required. Moreover, the safety and adequacy with respect to requirements of programs written in these languages needs to be tested, analyzed, and, if possible, proved. This dissertation proposes a rigorous approach to define programming languages based on rewriting, which allows to easily design and test language extensions, and to specify and analyze safety and adequacy of program executions. To this aim, this dissertation describes the K framework, an executable semantic framework inspired from rewriting logic but specialized and optimized for programming languages. The K framework consists of three components: (1) a language definitional technique; (2) a specialized notation; and (3) a resource-sharing concurrent rewriting semantics. The language definitional technique is a rewriting technique built upon the lessons learned from capturing and studying existing operational semantics frameworks within rewriting logic, and upon attempts to combine their strengths while avoiding their limitations. The specialized notation makes the technical details of the technique transparent to the language designer, and enhances modularity, by allowing the designer to specify the minimal context needed for a semantic rule. Finally, the resource-sharing concurrent semantics relies on the particular form of the semantic rules to enhance concurrency, by allowing overlapping rule instances (e.g., two threads writing in different locations in the store, which overlap on the store entity) to apply concurrently as long as they only overlap on the parts they do not change. The main contributions of the dissertation are: (1) a uniform recasting of the major existing operational semantics techniques within rewriting logic; (2) an overview description of the K framework and how it can be used to define, extend and analyze programming languages; (3) a semantics for K concurrent rewriting obtained through an embedding in graph rewriting; and (4) a description of the K-Maude tool, a tool for defining programming languages using the K technique on top of the Maude rewriting language

    Effective Predictive Runtime Analysis Using Sliced Causality and Atomicity

    Get PDF
    Predictive runtime analysis has been proposed to improve the effectiveness of concurrent program analysis and testing. Observing an execution, predictive runtime analysis extracts causality which is then used as the model of the program and checked against desired properties. This way, one can predict concurrent errors without actually hitting them. The causality constructed during the analysis determines the prediction ability of this approach. This paper presents an efficient and sound approach to computing sliced causality and atomicity which significantly but soundly improves existing causalities by removing irrelevant causal partial orders using dependence, relevance, and atomicity information of the program. Algorithms presented in this paper have been implemented and extensively evaluated. The results show that the technique is effective and sound: we found all the previously known bugs as well as unknown errors in popular systems, like the Tomcat webserver and the Apache FTP server, without any false alarms
    corecore