7 research outputs found

    A Selective CPS Transformation

    Get PDF
    The CPS transformation makes all functions continuation-passing, uniformly. Not all functions, however, need continuations: they only do if their evaluation includes computational effects. In this paper we focus on control operations, in particular ``call with current continuation'' and ``throw''. We characterize this involvement as a control effect and we present a selective CPS transformation that makes functions and expressions continuation-passing if they have a control effect, and that leaves the rest of the program in direct style. We formalize this selective CPS transformation with an operational semantics and a simulation theorem à la Plotkin

    The Sigma-Semantics: A Comprehensive Semantics for Functional Programs

    Get PDF
    A comprehensive semantics for functional programs is presented, which generalizes the well-known call-by-value and call-by-name semantics. By permitting a separate choice between call-by value and call-by-name for every argument position of every function and parameterizing the semantics by this choice we abstract from the parameter-passing mechanism. Thus common and distinguishing features of all instances of the sigma-semantics, especially call-by-value and call-by-name semantics, are highlighted. Furthermore, a property can be validated for all instances of the sigma-semantics by a single proof. This is employed for proving the equivalence of the given denotational (fixed-point based) and two operational (reduction based) definitions of the sigma-semantics. We present and apply means for very simple proofs of equivalence with the denotational sigma-semantics for a large class of reduction-based sigma-semantics. Our basis are simple first-order constructor-based functional programs with patterns

    Strictness types: An inference algorithm and an application

    Get PDF
    This report deals with strictness types, a way of recording whether a function needs its argument(s) or not. We shall present an inference system for assigning strictness types to expressions and subsequently we transform this system into an algorithm capable of annotating expressions with strictness types. We give an example of a transformation which can be optimized by means of these annotations, and finally we prove the correctness of the optimized transformation – at the same time proving the correctness of the annotation. Everything has been implemented; documentation can be found in appendix

    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

    An Analytical Approach to Programs as Data Objects

    Get PDF
    This essay accompanies a selection of 32 articles (referred to in bold face in the text and marginally marked in the bibliographic references) submitted to Aarhus University towards a Doctor Scientiarum degree in Computer Science.The author's previous academic degree, beyond a doctoral degree in June 1986, is an "Habilitation à diriger les recherches" from the Université Pierre et Marie Curie (Paris VI) in France; the corresponding material was submitted in September 1992 and the degree was obtained in January 1993.The present 32 articles have all been written since 1993 and while at DAIMI.Except for one other PhD student, all co-authors are or have been the author's students here in Aarhus

    CPS Transformation after Strictness Analysis

    No full text
    syntax of the source language ` c : ' f:::; x : ø ; :::g ` x : ø ß ` e : ø !ø ß ` fix e : ø ß [ fx : ø 1 g ` e : ø 2 ß ` x : ø 1 : e : ø 1 !ø 2 ß ` e 0 : ø 1 !ø 2 ß ` e 1 : ø 1 ß ` @ e 0 e 1 : ø 2 ß ` e 1 : ' ß ` e 2 : ø ß ` e 3 : ø ß ` if e 1 then e 2 else e 3 : ø ß ` e 0 : ø 0 ß [ fx : ø 0 g ` e 1 : ø 1 ß ` let x = e 0 in e 1 : ø 1 ß ` e 1 : ø 1 ß ` e 2 : ø 2 ß ` pair e 1 e 2 : ø 1 \Theta ø 2 ß ` e : ø 1 \Theta ø 2 ß ` fst e : ø 1 ß ` e : ø 1 \Theta ø 2 ß ` snd e : ø 2 Fig. 2. Type-checking rules for the source language approach is used by Kesley and Hudak [11] and by Fradet and Le M'etayer [9]. Both include a CPS transformation. Fradet and Le M'etayer compile both CBN and CBV programs by using the CBN and the CBV CPS-transformation. Recently, Burn and Le M'etayer have combined this technique with a global programanalysis [2], which is comparable to our goal here. 1.4 Overview Section 2 presents the syntax of the source language and the strictness-annotated language. We c..
    corecore