636 research outputs found

    Space-Efficient Gradual Typing in Coercion-Passing Style

    Get PDF
    Herman et al. pointed out that the insertion of run-time checks into a gradually typed program could hamper tail-call optimization and, as a result, worsen the space complexity of the program. To address the problem, they proposed a space-efficient coercion calculus, which was subsequently improved by Siek et al. The semantics of these calculi involves eager composition of run-time checks expressed by coercions to prevent the size of a term from growing. However, it relies also on a nonstandard reduction rule, which does not seem easy to implement. In fact, no compiler implementation of gradually typed languages fully supports the space-efficient semantics faithfully. In this paper, we study coercion-passing style, which Herman et al. have already mentioned, as a technique for straightforward space-efficient implementation of gradually typed languages. A program in coercion-passing style passes "the rest of the run-time checks" around - just like continuation-passing style (CPS), in which "the rest of the computation" is passed around - and (unlike CPS) composes coercions eagerly. We give a formal coercion-passing translation from ?S by Siek et al. to ?S?, which is a new calculus of first-class coercions tailored for coercion-passing style, and prove correctness of the translation. We also implement our coercion-passing style transformation for the Grift compiler developed by Kuhlenschmidt et al. An experimental result shows stack overflow can be prevented properly at the cost of up to 3 times slower execution for most partially typed practical programs

    Deriving the full-reducing Krivine machine from the small-step operational semantics of normal order

    Get PDF
    We derive by program transformation Pierre Crégut s full-reducing Krivine machine KN from the structural operational semantics of the normal order reduction strategy in a closure-converted pure lambda calculus. We thus establish the correspondence between the strategy and the machine, and showcase our technique for deriving full-reducing abstract machines. Actually, the machine we obtain is a slightly optimised version that can work with open terms and may be used in implementations of proof assistants

    Proofs, Reasoning and the Metamorphosis of Logic

    Get PDF
    Revised version of a conference given under title "From Natural Deduction to the nature of reasoning", at the colloquium Natural Deduction organized by Luiz Carlos Pereira and dedicated to the work of Dag Prawitz, Rio de Janeiro, Brazil, July 2001.With the “mathematical watershed”, Logic had been transformed into a foundational theory for mathematics, a theory of truth and proofs - far away from its philosophical status of theory of the intellectual process of reasoning. With the recent substitution of the traditional proofs-as-discourses paradigm by the proofs-as-programs one, Logic is now becomming a foundational theory for computing. One could interpret this new watershed as being “yet another technological drift”, bringing Logic always closer to applied ingeneering, always further from the human intellectual process of reasoning. This article promote the dual point of view: enlightened by the contemporary analysis of the dynamic of proofs, which bring us to a new understanding of the semantic counterpart of processes operationality (including the links between semantic dereliction due to inconsistency and computational exuberance), Logic has never appeared so close to being, ïŹnally, the theory of reasoning.A partir de son "tournant mathĂ©matique", la logique se convertit en une thĂ©orie des fondements des mathĂ©matiques, une thĂ©orie de la vĂ©ritĂ© et des preuves - loin de son statut philosophique de theorie du processus intellectuel de raisonnement. Avec le remplacement rĂ©cent du paradigme traditionnel des preuves-comme-discours par celui des preuves-comme-programes, la Logique est Ă  prĂ©sent devenue une thĂ©orie des fondements du calcul. On peut voir dans ce nouveau tournant comme un glissement supplĂ©mentaire qui conduirait la logique toujours plus prĂšs de l'ingĂ©nierie appliquĂ©e, toujours plus loin de son statut historique de thĂ©orie des processus de raisonnement. Cet article dĂ©fend le point de vue dual: sous la lumiĂšre des analyses contemporaines de la dynamique des preuves, qui conduisent Ă  une comprĂ©hension originale de la contrepartie sĂ©mantique de l'opĂ©rationalitĂ© des processus (y compris les liens entre dĂ©reliction sĂ©mantique due Ă  l'incohĂ©rence et exubĂ©rance calculatoire), la logique n'a finalement jamais semblĂ© aussi proche de devenir la thĂ©orie du raisonnement
    • 

    corecore