60 research outputs found

    Specifying and Executing Optimizations for Parallel Programs

    Full text link
    Compiler optimizations, usually expressed as rewrites on program graphs, are a core part of all modern compilers. However, even production compilers have bugs, and these bugs are difficult to detect and resolve. The problem only becomes more complex when compiling parallel programs; from the choice of graph representation to the possibility of race conditions, optimization designers have a range of factors to consider that do not appear when dealing with single-threaded programs. In this paper we present PTRANS, a domain-specific language for formal specification of compiler transformations, and describe its executable semantics. The fundamental approach of PTRANS is to describe program transformations as rewrites on control flow graphs with temporal logic side conditions. The syntax of PTRANS allows cleaner, more comprehensible specification of program optimizations; its executable semantics allows these specifications to act as prototypes for the optimizations themselves, so that candidate optimizations can be tested and refined before going on to include them in a compiler. We demonstrate the use of PTRANS to state, test, and refine the specification of a redundant store elimination optimization on parallel programs.Comment: In Proceedings GRAPHITE 2014, arXiv:1407.767

    Pseudo-Retract Functors for Local Lattices and Bifinite L-Domains

    Get PDF
    Recently, a new category of domains used for the mathematical foundations of denotational semantics, that of L-domains, have been under study. In this paper we consider a related category of posets, that of local lattices. First, a completion operator taking posets to local lattices is developed, and then this operator is extended to a functor from posets with embedding-projection pairs to local lattices with embedding-projection pairs. The result of applying this functor to a local lattice yields a local lattice isomorphic to the first; this functor is a pseudo-retract. Using the functor into local lattices, a continuous pseudo-retraction functor from ω-bifinite posets to ω-bifinite L-domains can be constructed. Such a functor takes a universal domain for the ω-bifinite posets to a universal domain for the ω-bifinite L-domains. Moreover, the existence of such a functor implies that, from the existence of a saturated universal domain for the ω-algebraic bifinites, we can conclude the existence of a saturated universal domain for the ω-bifinite L-domains

    Doing Algebra in Simple Type Theory

    Get PDF
    To fully utilize the power of higher-order logic in interactive theorem proving, it is desirable to be able to develop abstract areas of Mathematics such as algebra and topology in an automated setting. Theorems provers capable of higher order reasoning have generally had some form of type theory as theory object language. But mathematicians have tended to use the language of set theory to give definitions and prove theorems in algebra and topology. In this paper,we give an incremental description of how to express various basic algebraic concepts in terms of simple type theory. We present a method for representing algebras, subalgebras, quotient algebras, homorphisms and isomorphisms simple type theory, using group theory as an example in each case. Following this we discuss how to automatically apply such an abstract theory to concrete examples. Finally, we conclude with some observations about a potential inconvenience associated with this method of representation, and discuss a difficulty inherent in any attempt to remove this inconvenience

    Verifying Optimizations for Concurrent Programs

    Get PDF
    While program correctness for compiled languages depends fundamentally on compiler correctness, compiler optimizations are not usually formally verified due to the effort involved, particularly in the presence of concurrency. In this paper, we present a framework for stating and reasoning about compiler optimizations and transformations on programs in the presence of relaxed memory models. The core of the framework is the PTRANS specification language, in which program transformations are expressed as rewrites on control flow graphs with temporal logic side conditions. We demonstrate our technique by verifying the correctness of a redundant store elimination optimization in a simple LLVM-like intermediate language, relying on a theorem that allows us to lift single-thread simulation relations to simulations on multithreaded programs

    K-LLVM: A Relatively Complete Semantics of LLVM IR

    Get PDF

    An Abstract Interpretation for ML Equality Kinds

    Get PDF
    The definition of Standard ML provides a form of generic equality which is inferred for certain types, called equality types, on which it is possible to define an equality relation in ML. However, the standard definition is incomplete in the sense that there are interesting and useful types which are not inferred to be equality types but for which an equality relation can be defined in ML in a uniform manner. In this paper, a refinement of the Standard ML system of equality types is introduced and is proven sound and complete with respect to the existence of a definable equality. The technique used here is based on an abstract interpretation of ML operators as monotone functions over a three point lattice. It is shown how the equality relation can be defined (as an ML program) from the definition of a type with our equality property. Finally, a sound, efficient algorithm for inferring the equality property which corrects the limitations of the standard definition in all cases of practical interest is demonstrated

    Correspondence assertions for process synchronization in concurrent communications

    Get PDF
    High-level specification of patterns of communications such as protocols can be modeled elegantly by means of session types. However, a number of examples suggest that session types fall short when finer precision on protocol specification is required. In order to increase the expressiveness of session types we appeal to the theory of correspondence assertions. The resulting type discipline augments the types of long term channels with effects and thus yields types which may depend on messages read or written earlier within the same session. We prove that evaluation preserves typability and that well-typed processes are safe. Also, we illustrate how the resulting theory allows us to address the shortcomings present in the pure theory of session types.Laboratorio de Investigación y Formación en Informática Avanzad

    Correspondence assertions for process synchronization in concurrent communications

    Get PDF
    High-level specification of patterns of communications such as protocols can be modeled elegantly by means of session types. However, a number of examples suggest that session types fall short when finer precision on protocol specification is required. In order to increase the expressiveness of session types we appeal to the theory of correspondence assertions. The resulting type discipline augments the types of long term channels with effects and thus yields types which may depend on messages read or written earlier within the same session. We prove that evaluation preserves typability and that well-typed processes are safe. Also, we illustrate how the resulting theory allows us to address the shortcomings present in the pure theory of session types.Laboratorio de Investigación y Formación en Informática Avanzad

    IsaK: A Complete Semantics of K

    Get PDF
    K (Roşu and Şerbănuţă, 2010) is a rewrite-based executable semantic framework in which programming languages, type systems and formal analysis tools can be de ned using con gurations, computations and rules. In this paper we de ne IsaK, a reference semantics for K, which was developed through discussion with the K team to meet their expectations of a semantics of K. IsaK is de ned in the interactive theorem prover Isabelle/HOL (Paulson, 1990), and, to the best of our knowledge, is the most complete of any existing K speci cation. IsaK de nes the full behavior of K, a useful sort system for K and suggests several undesirable behaviors in the current K implementations (K 3.6 and K 4.0). We also provide an OCaml based executable K interpreter generated automatically from the K speci cation in Isabelle. By using a prede ned K parser, the K interpreter is suitable to interpret major K de nitions for large languages such as the LLVM semantics in K, the Java semantics in K and the C semantics in K. We ran a test suite including 13 speci cations and 356 programs to test our K interpreter and we are able to compile all 13 speci cations and run the 338 programs not requiring keyboard input. As a utility of IsaK, we also formally prove a CTL application in IsaK correct.NSF Grant No.0917218Ope
    corecore