15 research outputs found

    Compiling Exceptions Correctly

    Get PDF
    Exceptions are an important feature of modern programming languages, but their compilation has traditionally been viewed as an advanced topic. In this article we show that the basic method of compiling exceptions using stack unwinding can be explained and verified both simply and precisely, using elementary functional programming techniques. In particular, we develop a compiler for a small language with exceptions, together with a proof of its correctness

    Calculating an exceptional machine

    Get PDF

    Calculating an exceptional machine

    Get PDF
    In previous work we showed how to verify a compiler for a small language with exceptions. In this article we show how to calculate, as opposed to verify, an abstract machine for this language. The key step is the use of Reynold's defunctionalization, an old program transformation technique that has recently been rejuvenated by the work of Danvy et al

    Towards modular compilers for effects

    Get PDF
    Compilers are traditionally factorised into a number of separate phases, such as parsing, type checking, code generation, etc. However, there is another potential factorisation that has received comparatively little attention: the treatment of separate language features, such as mutable state, input/output, exceptions, concurrency and so forth. In this article we focus on the problem of modular compilation, in which the aim is to develop compilers for separate language features independently, which can then be combined as required. We summarise our progress to date, issues that have arisen, and further wor

    Compiling concurrency correctly: cutting out the middle man

    Get PDF
    The standard approach to proving compiler correctness for concurrent languages requires the use of multiple translations into an intermediate process calculus. We present a simpler approach that avoids the need for such an intermediate language, using a new method that allows us to directly establish a bisimulation between the source and target languages. We illustrate the technique on two small languages, using the Agda system to present and formally verify our compiler correctness proofs

    Strategic term rewriting and its application to a VDM-SL to SQL conversion

    Get PDF
    We constructed a tool, called VooDooM, which converts datatypes in Vdm-sl into Sql relational data models. The conversion involves transformation of algebraic types to maps and products, and pointer introduction. The conversion is specified as a theory of refinement by calculation. The implementation technology is strategic term rewriting in Haskell, as supported by the Strafunski bundle. Due to these choices of theory and technology, the road from theory to practise is straightforward.Fundação para a Ciência e a Tecnologia (FCT) - POSI/ICHS/44304/2002Agência de Inovação (ADI) - ∑!223

    Abstract Machine for a Comonadic Dataflow Language

    Get PDF
    The formal semantics of higher-order functional dataflow language programs can be represented with the concepts of arrows and comonads from category theory. Both of these methods convey the meaning of programs, but not the operational behaviour of them. In order to understand the operational behaviour of dataflow programs we will derive an abstract machine from an interpreter that is equivalent to a comonadic denotational semantics of a higher-order call-by-name dataflow language. The resulting abstract machine is identical to the well known abstract machine by Krivine with the exception of an overloaded notion of the environment and two additional transition rules for evaluating constructs specific to the dataflow language. The main result of this thesis is that the operational behaviour of call-by-name dataflow language programs is identical to the operational behaviour of regular non-strict languages

    Calculating correct compilers

    Get PDF
    In this article we present a new approach to the problem of calculating compilers. In particular, we develop a simple but general technique that allows us to derive correct compilers from high- level semantics by systematic calculation, with all details of the implementation of the compilers falling naturally out of the calculation process. Our approach is based upon the use of standard equational reasoning techniques, and has been applied to calculate compilers for a wide range of language features and their combination, including arithmetic expressions, exceptions, state, various forms of lambda calculi, bounded and unbounded loops, non-determinism, and interrupts. All the calculations in the article have been formalised using the Coq proof assistant, which serves as a convenient interactive tool for developing and verifying the calculations

    Transforming data by calculation

    Get PDF
    Thispaperaddressesthefoundationsofdata-modeltransformation.A catalog of data mappings is presented which includes abstraction and representa- tion relations and associated constraints. These are justified in an algebraic style via the pointfree-transform, a technique whereby predicates are lifted to binary relation terms (of the algebra of programming) in a two-level style encompassing both data and operations. This approach to data calculation, which also includes transformation of recursive data models into “flat” database schemes, is offered as alternative to standard database design from abstract models. The calculus is also used to establish a link between the proposed transformational style and bidi- rectional lenses developed in the context of the classical view-update problem.Fundação para a Ciência e a Tecnologia (FCT

    VooDooM : support for understanding and re-engineering of VDM-SL specifications

    Get PDF
    Tese mestrado informáticaThe main purpose of this work is to define steady ground for supporting the understanding and re-engineering of VDM-SL specifications. Understanding and re-engineering are justified by Lehman’s laws of software evolution which state, for instance, that systems must be continually adapted and as a program evolves its complexity increases unless specific work is done to reduce it. This thesis reports the implementation of understanding and re-enginering techniques in a tool called VooDooM, which was built in three well defined steps. First, development of the language front-end to recognize the VDMSL language, using a grammar-centered approach, supported by the SDF formalism, in which a wide variety of components are automatically generated from a single grammar; Second, development of understanding support, in which graphs are extracted and derived and subsequently used as input to strongly-connected components, formal concept analysis and metrication. Last, development of re-engineering support, through the development of a relational calculator that transforms a formal specification into an equivalent model which can be translated to SQL. In all steps of the work we thoroughly document the path from theory to practice and we conclude by reporting successful results obtained in two test cases.O objectivo principal deste trabalho é a definiçãoo de uma infra-estrutura para suportar compreensão e re-engenharia de especificações escritas em VDM-SL. compreensão e re-engenharia justificam-se pelas leis de evolução do software. Estas leis, formuladas por Lehman, definem, por exemplo, que um qualquer sistema deve ser continuamente adaptado e `a medida que os programas evoluem a sua complexidade tende sempre a aumentar. Esta tese descreve o estudo de técnicas de compreensão e re-engenharia que foram implementadas numa ferramenta chamada VooDooM. Esta implementação foi efectuada em três etapas bem definidas. Primeiro, foi desenvolvido um parser (front-end) para reconhecer a linguagem VDM-SL. Para tal, foi utilizada uma abordagem centrada na gramática, suportada no formalismo SDF, que está equipado com ferramentas de geração automática de diversos componentes. Segundo, para o suporte de compreensão, foram desenvolvidas funcionalidades para extrair e derivar grafos que são utilizados em técnicas de análise como componentes fortemente relacionados, análise de conceitos (formal concept analysis) e métricas. Por último, para o suporte de re-engenharia, foi prototipada uma calculadora relacional que transforma um modelo, definido numa especificação formal, no seu equivalente relacional que pode ser traduzido para SQL. Em todas as etapas realizadas h a preocupação de documentar o percurso entre teoria para a prática. A análise de resultados obtida no estudo de caso revela o sucesso da abordagem e as suas potencialidades para desenvolvimentos futuros
    corecore