The Logical Essence of Compiling With Continuations

04/28/2023
by   José Espírito Santo, et al.
0

The essence of compiling with continuations is that conversion to continuation-passing style (CPS) is equivalent to a source language transformation converting to administrative normal form (ANF). Taking as source language Moggi's computational lambda-calculus (lbc), we define an alternative to the CPS-translation with target in the sequent calculus LJQ, named value-filling style (VFS) translation, and making use of the ability of the sequent calculus to represent contexts formally. The VFS-translation requires no type translation: indeed, double negations are introduced only when encoding the VFS target language in the CPS target language. This optional encoding, when composed with the VFS-translation reconstructs the original CPS-translation. Going back to direct style, the "essence" of the VFS-translation is that it reveals a new sublanguage of ANF, the value-enclosed style (VES), next to another one, the continuation-enclosing style (CES): such an alternative is due to a dilemma in the syntax of lbc, concerning how to expand the application constructor. In the typed scenario, VES and CES correspond to an alternative between two proof systems for call-by-value, LJQ and natural deduction with generalized applications, confirming proof theory as a foundation for intermediate representations.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/26/2021

Encoding of Predicate Subtyping with Proof Irrelevance in the λΠ-Calculus Modulo Theory

The λΠ-calculus modulo theory is a logical framework in which various lo...
research
08/16/2019

A Gentzen-style monadic translation of Gödel's System T

We present a monadic translation of Gödel's System T in the spirit of Ge...
research
02/10/2020

The Bang Calculus Revisited

Call-by-Push-Value (CBPV) is a programming paradigm subsuming both Call-...
research
12/16/2022

Call-By-Name Is Just Call-By-Value with Delimited Control

Delimited control operator shift0 exhibits versatile capabilities: it ca...
research
04/12/2023

Foundations for an Abstract Proof Theory in the Context of Horn Rules

We introduce a novel, logic-independent framework for the study of seque...
research
07/16/2021

Systematic Translation of Formalizations of Type Theory from Intrinsic to Extrinsic Style

Type theories can be formalized using the intrinsically (hard) or the ex...
research
10/04/2021

SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Turn-Taking Simulation

Proving secure compilation of partial programs typically requires back-t...

Please sign up or login with your details

Forgot password? Click here to reset