Professional Documents
Culture Documents
net/publication/220613592
CITATION READS
1 80
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Stefano Guerrini on 27 January 2015.
The concept of syntactical duality is central in logic. In particular, the duality defined by classical
negation, or more syntactically by left and right in sequents, has been widely used to relate logic
and computations.
We study the proof/test duality proposed by Girard in his 1999 paper on the meaning of logical
rules. In details, starting from the notion of “test” proposed by Girard, we develop a notion
of test for intuitionistic logic and we give a complete deductive system whose computational
interpretation is the target language of the call-by-value and call-by-name continuation passing
style translations.
Categories and Subject Descriptors: D.3.2 [Programming Languages]: Language Classifi-
cations—Applicative (functional) languages; F.4.1 [Mathematical Logic and Formal Lan-
guages]: Mathematical Logic—Lambda calculus and related systems
General Terms: Languages,Theory
Additional Key Words and Phrases: Minimal Logic, Intutionistic Logic, Linear Logic, Lambda
Calculus, Call-By-Value, Call-By-Name, Continuations Passing Style
1. INTRODUCTION
The concept of syntactical duality is central in logic. The most simple notion
of duality is given by means of the De Morgan laws. With the birth of modern
proof theory, and in particular after Gentzen’s sequent calculus, this notion has
been refined into a left/right duality: the left introduction rule of ∨ is dual to the
right introduction rule of ∧, and so on. Such a kind of duality has been deeply
investigated in the framework of Linear Logic (cut elimination in proof nets is
strongly based on the notion of duality between a formula A and its orthogonal
A⊥ ).
The correspondence between proofs and programs given by the Curry-Howard
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007, Pages 1–34.
2 · S. Guerrini and A. Masini
isomorphism maps the computational duality input/output into the logical duality
premise/conclusion in natural deduction, or left/right in sequent calculus. However,
since the Curry-Howard correspondence is straightforward for intuitionistic logic
only, at first, the computational relevance of the logical duality premise/conclusion,
or left/right, was not completely understood. Because of the restrictions on nega-
tion, in intuitionistic logic such dualities are broken: we may have many premises,
many formulas on the left, but we must have (at most) one conclusion, one formula
on the right. The first who showed that the duality given by classical negation—
that is by accepting the double negation rule—could lead to a full formulas-as-types
correspondence was Griffin [1990].
The deep analysis of cut elimination started by Linear Logic has pointed out other
possible interpretations of the above dualities, for instance, as opponent/player in
game theory, or negative/positive in polarized systems. On the other hand, the
studies on the sequential aspects of λ-calculus have pointed out the duality between
program and continuation, and have showed that this relates to the logical dualities
through classical negation.
Since Griffin’s seminal work [Griffin 1990], many papers have investigated the re-
lations between classical logic and computations, and between the logical dualities
described above and other computational dualities similar to that between programs
and continuations. In particular, we recall Herbelin [1995] that related the left/right
duality of sequents to the term/contexts duality of λ-calculus, Curien and Herbe-
lin [2000] that extended the above analysis to classical logic, and Wadler [2005] that
related the left/right duality of sequents to Call-By-Value and Call-By-Name.
This paper follows the above line of analysis but from a different perspective.
In a sequel of papers aimed to define a new interactive approach to logics, Girard
proposed a very simple notion of duality for classical proofs by means of the so called
tests [Girard 1999] (see later in section 1.3). Our work starts from the analysis of
the proof/test duality from a proof theoretical point of view in a genuine natural
deduction style (which is for instance one of the main differences between our work
and that of Curien and Herbelin, and that of Wadler). By assigning terms to
the natural deduction obtained in this way, and by restricting our analysis to the
intuitionistic case (actually, to the minimal case, for we do not treat negation),
we define the ptq-calculus and we use it to investigate Continuation Passing
Style translations; in particular, we show that the natural correspondence definable
between ptq-terms and λ-terms preserves Plotkin’s Call-by-Value and Call-by-Name
λ-calculi translations.
The above correspondence can be extended to classical logic. In particular, the
unrestricted version of the ptq-calculus leads to a computational calculus for clas-
sical logic. However, even if the extension to the classical case of the correspon-
dence between ptq-calculus and λ-calculus leads to associate a term of Parigot’s
λµ-calculus to every ptq-term, such a map is not an embedding, as it does not
preserve reductions (see the conclusions also). A careful analysis of the correspon-
dences between the classical extension of our ptq-calculus and λµ-calculus or Curien
and Herbelin’s λ̄µµ̃-calculus are not covered in this paper since they are still under
investigation.
The reader will not find in this paper the so called user control operators for
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 3
continuations (such as abort or call-cc); it is not the aim of this paper to deal
with user-controlled continuations. We assume that continuations live at the source
language level and that the compiler translate them into our target language.
Finally, we want to remark that the readback map that associates a λ-term to
every ptq-term is the same for the Call-by-Name and for the Call-by-Value trans-
lations that we shall give in the paper; in other words, in our framework, both the
translations have the same inverse. Therefore, if we think at the ptq-calculus as
a target calculus, we can decompile every term into a λ-term without taking into
account whether it comes from a Call-by-Name or from a Call-by-Value compila-
tion. Such a uniform treatment of Call-By-Name and Call-by-Value is peculiar of
our calculus, at least in the direct and simple way in which it is achieved.
1.1 CPS
Since the seminal works of Fischer [1972] and Plotkin [1975] continuations have
become central in the study and implementation of functional languages. In par-
ticular, by defining the Call-by-Name and Call-by-Value translations of λ-calculus,
Plotkin posed the basis of CPS (Continuation Passing Style) transforms.
After these initial milestones, any overview of continuations and CPS, even if
very short, cannot avoid to mention the fundamental work that Felleisen, Fried-
man, Kohlbecker, Duba, and Sabry carried out for type free functional languages.
Felleisen et al. [1986] were the first to axiomatize the so called control operators—
call/cc and other similar operators of lisp-like languages. Some years later, Sabry
and Felleisen [1993] were the first to prove completeness results for CPS transforms
of type-free functional languages.
While Felleisen and his collaborators were developing the theory of CPS trans-
forms, several researchers began to investigate if it was possible to explain continu-
ations by means of some known logic, in the style of the well-known correspondence
between minimal logic and types and computations of functional languages.
Griffin [1990] was the first one to give an answer to this question by proposing
classical logic as a type system for a simplified version of Scheme. The main idea
of Griffin was to use Reduction ad Absurdum to explain the C control operator
introduced by Felleisen.
The work of Griffin opened new perspectives in the use of classical logic for the
study of programming languages. When Griffin published his proposal, “classical
logic seemed not to have a clear computational interpretation”; e.g., see the lack
of confluence of its “standard” natural deduction formulation or, equivalently, the
collapse of proofs in the standard categorical semantics (as observed by Joyal).
In general, the lack of confluence is not said to be a ”defect”. Griffin himself ex-
plained non-confluence as an application of control operators as Abort or Scheme’s
call/cc, and several other authors have proposed interesting non-deterministic
computational interpretations of classical logic based on non-confluence (e.g., see
the work of Barbanera and Berardi [1993; 1994]). Nevertheless, non-confluence
becomes a problem if one is interested in a full extension of the Curry-Howard
isomorphism—formulas as types and proofs as programs, with full subject reduction—
where the proof theoretical or denotational meaning of a terminating program is
given by its (unique) normal form.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
4 · S. Guerrini and A. Masini
1.3 Interaction
An interesting question is: in logic, is there any explicit notion of “interaction” that
could be used to deal with continuations? In our opinion, a good answer, is given
by the proposal of Girard for an “interactive approach to logic”.
The key point of Girard [1999] is the idea that the meaning of proofs does not
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 5
reside in some external world called the “semantics of the proofs”; the meaning of
proofs is described by the interaction between proofs and some dual objects that
Girard name tests.
The proof/test duality introduced by Girard can be understood in terms of a
game between a player and an opponent. A proof is a sequence of arguments
used by the player to assert that, moving from a given set of premises, the ending
formula (or sequent) holds. Then, what is the dual of a proof? A test is a sequence
of arguments used by the opponent to confute the provability of a formula (or
sequent).
What does it happen if the player asserts that a formula is provable while the
opponent says that such a formula is not provable? If the system is not trivial—and
by the way, we are interested in such a case only—someone is cheating and we need
a way to validate the arguments used in a proof/test. In this kind of game there
is no referee and we cannot resort to any external argument. So, the only way
that we have to discover who is cheating is by counterposing the proof proposed
by the player to the test proposed by the opponent. The interaction between the
two derivations (cut-elimination) will lead to discover where the arguments of the
player or of the opponent fail.
Another important issue is constructiveness: if we do not want to exit outside
our computational world, both proof and tests must be constructive.
The BHK interpretation asserts that:
Γ, Ap ` Ap Γ, At ` At
Γ, Ap , B t ` Γ ` Ap Γ ` Bt
Γ ` A → Bp Γ ` A → Bt
Γ, At ` Γ, Ap `
Γ ` Ap Γ ` At
Γ ` At Γ ` Ap
Γ`
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 7
—(Γp , ∆t `)+ = Γ ` ∆;
—(Γp , ∆t ` Ap )+ = Γ ` ∆, A;
—(Γp , ∆t ` At )+ = Γ, A ` ∆;
Such a translation, when applied to the rules of KT, produces the rules:
Γ, A ` ∆, B Γ ` ∆, A Γ, B ` ∆ Γ, A ` ∆ Γ ` ∆, A
Γ, A ` ∆, A
Γ ` ∆, A → B Γ, A → B ` ∆ Γ`∆
which are the standard LK rules of classical logic.
Now, let us consider minimal logic, i.e., the system of types for simply typed
λ-calculus. We know that minimal logic is obtained by means of a structural con-
straint: the sequents must have exactly one conclusion.
If we want that the ( )+ translation produces minimal logic sequents, we must
constrain the structure of derivable judgments in such a way that:
C1. for each judgment Γ ` Ap , the set Γ does not contain test formulas;
C2. for each judgment Γ `, the set Γ contains exactly one test formula;
C3. for each judgment Γ ` At , the set Γ contains exactly one test formula.
The simpler way to obtain a deductive system such that all the derivable judg-
ments obey to the constraints (C1), (C2) and (C3) is to impose a linear discipline
for test formulas, as in the deductive system below—let us call it mT.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
8 · S. Guerrini and A. Masini
Γp , Ap ` Ap Γp , At ` At
Γp , Ap , B t ` Γ p ` Ap Γp , C t ` B t
Γp ` A → B p Γp , C t ` A → B t
Γp , At ` Γp , Ap , B t `
Γ p ` Ap Γp , B t ` At
Γ p , B t ` At Γ p ` Ap
Γp , B t `
It is possible to prove that mT is a presentation of minimal logic.
Proposition 2.2. The sequent Γ ` A is derivable in minimal logic iff the judg-
ment Γp ` Ap is derivable in mT.
The above stated proposition might lead the reader to believe that the formulas
of kind At are useless. A naive way to “eliminate” the At formulas could be by
introducing the connective for negation and by replacing At with ¬Ap . But in so
doing we change the intended meaning of t-formulas. For example, the meaning of
a sequent B t ` At is not ¬B ` ¬A but A ` B, (remember that in minimal and
intuitionistic logic, the sequent ¬B ` ¬A is not equivalent to the sequent A ` B).
Moreover, even if the final sequent Γp ` Ap does not contain any t-formula, in
general, in order to derive it we have to use t-formulas. In fact, in some case the
syntactical conclusion of the proof, the formula on the right-hand side, is not the
intended conclusion of the proof—namely the type of the corresponding term—
which is instead a t-formula on the left-hand side. (A similar situation appears
in Curien and Herbelin λ̄µµ̃-calculus where even in the minimal case you need a
continuation of type ¬A, that is a formula A on the left-hand side that corresponds
to the type of the term assigned to the sequent).
Γp , x : Ap ` x : Ap Γp , k : At ` k : At
Γ p , x : Ap , k : B t ` u p
Γ p ` p : Ap Γp , k : C t ` t : B t
p t → →t
Γp , ` λhxA , k B i.u : A → B p Γp , k : C t ` hp, ti : A → B t
Γ p , k : At ` u Γ p , x : Ap , k : B t ` u
t λp p λt
Γp ` λk A .u : Ap Γp , k : B t ` λxA .u : At
Γ p , k : B t ` t : At Γp ` p : Ap
@
Γp , k : B t ` t • p
The reduction rules for terms that naturally arise from the above syntax are:
hp, ti • λhx, ki.u → u[p/x, t/k]
λx.u • p → u[p/x]
t • λk.u → u[t/k]
Unfortunately, such a system has the main defect of any naive term system
associated to classical logic: it is non-confluent. In fact,
λx.u0 • λk.u00
OOO
ooooo OOO
ooo OOO
w o
o o OO'
u0 [λk.u00 /x] u00 [λx.u0 /k]
—a dynamic composition t; p, in which the term that plays the role of the
argument is not statically fixed (it could be either t or p), depending on the
shape of t and p.
3. THE PTQ-CALCULUS
The set of the type expressions is given by the following grammar:
X ::= X1 | . . . | Xk base types
A ::= X | A→A intuitionistic types
P ::= Ap proof types
T ::= At test types
Q ::= Aq q-proof types
W ::= P | T | Q types
The set of the ptq-term expressions, or ptq-terms for short, is defined by the
following grammar:
x ::= x0 , x1 , . . . p-variables
k ::= k0 , k1 , . . . t-variables
p ::= x | λhx, ki.u | λk.u p-terms
t ::= ∗ | k | hp, ti | λx.u t-terms
q ::= λk.u q-terms
u ::= t; p | qt e-terms
In order to simplify the treatment of substitution, we shall assume to work
modulo variable renaming, i.e., term-expressions are equivalence classes modulo
α-conversion. Substitution up to α-equivalence is defined in the usual way.
Γ, x : Ap ` x : Ap Γ k : At ` k : At
Γ ∗ : At ` ∗ : At
Γ, x : Ap k : B t ` u Γ ` p : Ap Γ δ ` t : Bt
→p →t
Γ ` λhx, ki.u : A → B p Γ δ ` hp, ti : A → B t
Γ k : At ` u Γ, x : Ap δ ` u
λp λt
Γ ` λk.u : Ap Γ δ ` λx.u : At
Γ k : At ` u q
λ
Γ ` λk.u : Aq
Γ ` p : Ap Γ δ ` t : At Γ ` q : Aq Γ δ ` t : At
@p @q
Γ δ ` t; p Γ δ ` qt
Summing up, in order to construct well-typed terms, we need only one name for
t-variables. Therefore, in the following, we shall assume that all the occurrences of
t-variables have name k.
Fact 3.1. The ptq-type system has the substitution property.
(1 ) For any well-typed Γ ξ ` t0 : At , we have that
(a) for every well-typed Γ, ∆ k : At ` t : B t or Γ, ∆ ∗ : At ` t : B t ,
the corresponding Γ, ∆ ξ ` t[t0 /k] : B t or Γ, ∆ ξ ` t[t0 /∗] : B t is
well-typed;
(b) for every well-typed Γ, ∆ k : At ` u or Γ, ∆ ∗ : At ` u, the
corresponding Γ, ∆ ξ ` u[t0 /k] or Γ, ∆ ξ ` u[t0 /∗] : B t is well-typed.
(2 ) For any well-typed Γ ` p0 : Ap , we have that
(a) for every well-typed Γ, ∆, x : Ap ξ ` t : B t , then Γ, ∆ ξ ` t[p0 /x] : B t
is well-typed;
(b) for every well-typed Γ, ∆, x : Ap ` u or Γ, ∆, x : Ap ` p : B p or Γ, ∆, x :
Ap ` q : B q , the corresponding Γ, ∆ ` u[p0 /x] or Γ, ∆ ` p[p0 /x] : B p or
Γ, ∆ ` q[p0 /x] : B q is well-typed.
A term is t-closed when it does not contain free occurrences of t-variables. We
have already seen that every well-typed p-term/q-term is t-closed and that every
t-closed well-typed t-term/e-term contains either a free occurrence of the t-variable
k or an occurrence of the constant ∗ outside the scope of any t-binder. Thus, every
t-closed well-typed t-term t∗ or e-term u∗ can be obtained by replacing ∗ for the
free t-variable k in a well-typed t-term t or e-term u that does not contain any
occurrence of the constant ∗, namely
t∗ = t[∗/k] with t∗ [k/∗] = t
u∗ = u[∗/k] with u∗ [k/∗] = u
respectively.
In the following, we shall only consider well-typed ptq-terms and well-typed judg-
ments; therefore, we shall omit to specify that a term or judgment is well-typed.
When not otherwise specified, we shall always denote t-closed t-terms or e-terms
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
12 · S. Guerrini and A. Masini
3.2 Computations
First of all let us remark some of the peculiarities of the ptq-calculus that we shall
define in the rest of this subsection.
3.2.1 A necessary premise. The ptq-calculus does not have any kind of evalua-
tion context, nor any notion of reduction strategy. In particular, the ptq-calculus is
neither a Call-by-Value nor a Call-by-Name calculus. This assertion might confuse
the reader, since we are proposing a calculus to deal with Call-by-Value and Call-
by-Name. In order to clarify this point, we remark that we do not propose ptq as a
source calculus. Instead, we think at ptq as a target calculus, namely a calculus for
the result of the compilation of standard typable Call-by-Value and Call-by-Name
languages based on λ-calculus.
The reader will not find in this paper the so called user control operators for
continuations (such as abort or call-cc); it is not the aim of this paper to deal
with user-controlled continuations. We assume that continuations live at the source
language level and that the compiler translate them into our target language.
The rules of the ptq-calculus come out from a proof theoretical analysis of the
proof/test dichotomy. By analyzing how to embed the λ-calculus into the ptq-
calculus, we see that the two natural ways in which this can be done correspond to
Plotkin’s Call-by-Value and Call-by-Name translations. Then, let us take a term
M . The Call-by-Value and the Call-by-Name translations of M produce a term uv
and a term un , respectively. It is the compiler that (roughly speaking) produces
either a Call-by-Value or a Call-by-Name target code. The ptq-calculus, our target
language, has no particular treatment for uv or un , both of them are executed
following the same set of reduction rules which, in any case, must ensure that
the reductions of uv and un agree with the Call-by-Value and the Call-by-Name
reductions of M , respectively.
3.2.2 Toward the computational rules. Let us now gradually introduce the com-
putational rules of the ptq-calculus.
According to a standard lazy approach, the reduction rules that we shall define
do not reduce inside the scope of a λ or λ binder and inside a pair. Since
(1) when t is a constant or a pair, the control passes to the p-term p. In particular,
(a) if p = λk.u, then p corresponds to a suspended execution that is waiting for
a continuation to put in the place of the parameter k. When p is applied
to the t-term t, the variable k is replaced with t in the body of p and the
execution resumes;
(b) if p = λhx, ki.u, then p corresponds to a suspended execution that is waiting
for a program to put in the place of the parameter x and a continuation to
put in the place of the parameter k. Then the term t; p reduces only when
t = hp0 , t0 i is a pair; in that case, the variables x and k in u are replaced
by the program p0 and the continuation t0 , respectively, and the execution
resumes;
(2) when t is a λ-abstraction, the continuation corresponding to t = λx.u can be
interpreted as a suspended execution waiting for the actual value of a parameter
x. Therefore, after replacing the program p for x in u, the execution resumes.
∗; λk.u → u∗
hp, ti; λk.u → u[hp, ti/k]
hp, ti; λhx, ki.u → u[p/x, t/k]
λx.u; p → u[p/x]
reducing a t-application t; p
(1) analyze first t and then p;
(2) contract the application by assuming that the first term that is “usable” as
a function receives the other term as an argument.
The previous reduction rule does not suffice for our purposes. In some cases,
namely for the encoding of call-by-value, we also need the rule that takes the t-
term t as an argument of some kind of function constructed by abstracting the only
free t-variable k in the e-term u, even when t = λx.u is a λ-abstraction at its turn.
For this reason, in the type system, we have an abstraction λk.u : Aq that, if k : At ,
construct a term q : Aq , whose type is not a test type, and another application qt,
for which we have the only reduction rule
λx.u; t → u[t/k]
Let us remark that, since any q-term is a λ-abstraction, a term qt is always a redex.
In the previous analysis we have omitted the case in which t is a variable. The rea-
son is that, if we take k; λk.u → u, we do not have (k; λk.u)[λx.u0 /k] → u[λx.u0 /k],
but (k; λk.u)[λx.u0 /k] → u0 [λk.u/x]. Because of this, we prefer to assume that the
term k; p is always irreducible. This also explains the role of the constant ∗. Since,
such a constant cannot be bound, it cannot be interpreted as a placeholder for
an arbitrary t-term and there is no problem in reducing the e-term ∗; λk.u to u∗ .
Anyhow, we remark that ∗; λhx, ki.u is irreducible.
In order to complete the explanation of the role of the constant ∗, let us recall
that we want to interpret a p-term p as the translation of a program. Since e-terms
only are reducible, in order to start the computation of p we have to composite it
with some t-term, that is to pass some continuation to the program. The simplest
choice is to compose p with the constant ∗. Correspondingly,
the constant ∗ plays the role of the initial continuation of the system:
the continuation that the “system” passes to the compiled code in order
to start the computation.
This assumption is fully justified by the fact that, following a Continuation Pass-
ing Style, we shall compile any λ-term into t-closed p-term. Because of this, we can
also
∗; λk.u → u∗
hp, t∗ i; λk.u → u[hp, t∗ i/k]
hp, t∗ i; λhx, ki.u → u[p/x, t∗ /k]
λx.u∗ ; p → u∗ [p/x]
(λk.u)t∗ → u[t∗ /k]
∗
As usual, we shall denote by → the transitive and reflexive closure of →.
One of the standard interpretation of a continuation is as the rest of computation:
the continuation passed to a program specifies how the computation must continue
after the completion of the program. (For a comparison of this interpretation with
the interpretation that thinks at a continuation as an evaluation context, see [Danvy
2004].) Accordingly, we expect that the reduction of t; p starts by the reduction
that mimic the execution of the program corresponding to p and that, only after
the completion of that program, the execution is resumed by the continuation. In
∗ ∗
practice, we expect that t∗ ; p → t∗ ◦ u∗ = u[t/k], whenever ∗; p → u∗ . However, it
0 00
is readily seen that this cannot hold if t∗ = λx.u∗ and p = λk.u∗ .
Lemma 3.2 gives the exact condition under which we may get the expected re-
placement property: either t∗ is not a λ-abstraction or, when this is not the case,
during the reduction of ∗; p we never apply the rule that reduces a term with the
shape ∗; λk.u00∗ . Let us remark that this condition hold for the translations of λ-
terms that we shall give in the paper.
∗
Lemma 3.2. Let u∗ be an e-term s.t. u∗ → u0∗ . Given a t-term t∗ ,
(1 ) if t∗ is not an abstraction λx.u00∗ , or
∗
(2 ) u∗ → u0∗ without reducing any redex with the shape ∗; λk.u00∗ ,
∗
then t∗ ◦ u∗ → t∗ ◦ u0∗ , for every closed t-term t∗ .
Proof. By inspection of the reduction rules, we see that, since we cannot have
u∗ = λx.u00∗ ; λk.u0∗ , the statement holds for a one-step reduction. Then, by induction
on the length of the reduction, we conclude.
of simpler and cleaner systems, such as the intuitionistic sequent calculus LJ and the
intuitionistic natural deduction NJ, the comparison between normalization and cut
elimination is extremely difficult, e.g., see the fundamental work of Zucker [Zucker
1974]. Moreover, the cut elimination of λ̄µµ̃-calculus is, in some sense, midway
between sequent calculus and natural deduction. For instance, let us take the
following piece of deduction:
Γ, x : A ` v1 : B | ∆ Γ ` v2 : A | ∆ Γ|E:B`∆
Γ ` λx.v1 : A → B | ∆ Γ | v2 · E : A → B ` ∆
hλx.v1 | (v2 · E)i : (Γ ` ∆)
If one tries to eliminate the cut, it is readily seen that this breaks the term
assignment. In order to preserve terms, the reduction rule between λx.v1 of type
A → B and (v2 · E) is defined as
hλx.v1 | (v2 · E)i → hv1 [x ← v2 ] | Ei
and it is readily seen that this corresponds to a standard cut elimination step
between main rules for the functional part, the B formula, while for the argument
part, the A formula, the rule corresponds to a sort of big reduction step that moves
the cut towards the axioms introducing x : A. This rule corresponds to the cut
elimination for the LKT system defined in [Danos et al. 1995; 1997]. Nevertheless,
the above analysis clearly shows that the rule contains a part that works at the
bottom of the proof—by replacing the cut in the final sequent with a cut on the
formula of the functional part—as in standard sequent calculus cut elimination,
and a part that works at the top of the proof—by plugging a new copy of the proof
corresponding to the argument of the function in the place of every occurrence of
the corresponding variable—in a way that clearly corresponds to a reduction step
of natural deduction.
By the way, this is not a drawback of λ̄µµ̃-calculus, neither we want to criticize
such a choice. We only want to point out that the approach of Curien and Herbelin
moves from a different starting point and leads to different choices for the logical
rules and for the reductions of the calculus. In particular, Curien and Herbelin start
from an analysis of computations and, as a consequence, the design of their logical
system derives from this computational point of view. In our work, we starts from a
proof theoretical analysis and, according to a genuine natural deduction approach,
we analyze the resulting calculus and its reduction figures by studying the terms
corresponding to every derivation of the logical system. Nevertheless, since the
framework is similar, in both the approaches the kind of problems that one has to
solve are similar. As for instance the non-determinism introduced by critical pairs
(see (1) on page 14). But, while in [Curien and Herbelin 2000] the authors decide to
give priority to one of the two directions according to the translation under analysis,
we internalize the choice of the direction of the reduction, showing that in any case,
via Plotkin’s translations, this keeps the correspondence with Call-By-Name and
Call-By-Value.
By the way, a completely different approach might be possible, and has been
presented in the literature: in spite of trying to avoid non-confluence, one might
decide to accept critical pairs and non-determinism as part of the calculus, as for
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 17
3.4 Readback
The ptq-calculus can be translated into the λ-calculus by a map that associates to
each term of the ptq-calculus a typed λ-term. If we forget the types, every ptq-term
is mapped into a λ-term that contains the same p-variables of the ptq-term and one
special constant 2, named hole, that plays the role of the free t-variable in the
ptq-term.
A λ2 -term is a λ-term that may contain occurrences of the hole and whose
variables range over the set of the p-variables. If M and N are λ2 -terms, the hole
composition is defined by
M ◦ N = M [N/2]
The hole composition is associative and 2 is its neutral element, for M ◦ 2 = M =
2 ◦ M.
The (untyped) readback map J·K is defined in Figure 3. Every t-term is mapped
into a corresponding λ2 -term that may contain holes, while the other kind of terms
are mapped into λ2 -terms that does not contain holes.
J∗K = 2 JxK = x
Jhp, t∗ iK = Jt∗ K ◦ 2JpK Jλhx, ki.uK = λx.Ju∗ K
Jλx.u∗ K = Ju∗ K[2/x] Jλk.uK = Ju∗ K
Jλk.uK = Ju∗ K
Jt∗ ; pK = Jt∗ K ◦ JpK
Jqt∗ K = Jt∗ K ◦ JqK
The readback map naturally extends to judgments. The typed λ2 -terms obtained
by the translation are terms of a typed λ-calculus Λ2 in which:
—the set of the base types is the same of the ptq-calculus;
—the set of the variables is the set of the p-variables of the ptq-calculus;
—for each type A, there is a constant 2A : A, the hole of type A;
—the type assignment rules are those of the typed λ-calculus, with the restriction
that
—a term of Λ2 cannot contain occurrences of holes with different types (in any
case, a term of Λ2 may contain more than one hole of the same type);
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
18 · S. Guerrini and A. Masini
Remark 3.3. Typed λ2 -terms with holes are a sort of typed contexts. But, dif-
ferently from the standard definition of contexts, Λ2 -terms are equivalence classes
modulo variable renaming (α-rule), for hole instantiation is not variable capturing.
In a standard context, if a hole is in the scope of a λ-abstraction binding the vari-
able x, the free occurrences of the variable x in a term M will be bound by the
λ-abstraction when M is put into the hole. In a Λ2 -term, the hole composition
N ◦ M = N [M/2] is defined by means of the standard variable substitution; there-
fore, the variable x bound in N must be renamed and the free occurrences of x in
M remain free in N ◦ M .
Proposition 3.4. Let the judgment Γp δ ` ξ be derivable in the ptq-calculus.
The judgment JΓp δ ` ξK is derivable in Λ2 .
Proof. By induction on the derivation of Γp δ ` ξ.
W.r.t. the readback, the ∗ plays the role of a neutral element, namely J∗; pK = JpK
and Jq∗K = JqK. Indeed, the readback transformation maps the ∗-composition into
the hole composition. (Let us recall that the ∗-composition on t-terms is defined
by t∗ ◦ t0∗ = t0 [t∗ /k].)
Lemma 3.5.
(1 ) Jt∗ ◦ t0∗ K = Jt∗ K ◦ Jt0∗ K
(2 ) Jt∗ ◦ u∗ K = Jt∗ K ◦ Ju∗ K
Proof. By structural induction on t0 and u.
(1) Let A = Jt∗ ◦ t0∗ K and B = Jt∗ K ◦ Jt0∗ K.
(a) If t0 = k, then B = Jt∗ K ◦ J∗K = Jt∗ K ◦ 2 = Jt∗ K = Jt∗ K∗◦ = A.
(b) If t0 = ht00 , pi, then A = Jht∗ ◦ t00∗ , piK = (by the definition of readback)
Jt∗ ◦ t00∗ K ◦ 2JpK = (by the induction hypothesis) (Jt∗ K ◦ Jt00∗ K) ◦ 2JpK =
Jt∗ K ◦ (Jt00∗ K ◦ 2JpK) = (by the definition of readback) Jt∗ K ◦ Jht00∗ , piK = B.
(c) If t0 = λx.u (with x 6∈ FV(t)), then A = Jt∗ ◦ λx.u∗ K = Jλx.(t∗ ◦ u∗ )K = (by
the definition of readback) Jt∗ ◦ u∗ K[2/x] = (by the induction hypothesis)
(Jt∗ K ◦ Ju∗ K)[2/x] = (by x 6∈ FV(t)) Jt∗ K ◦ (Ju∗ K[2/x]) = (by the definition
of readback) Jt∗ K ◦ Jλx.u∗ K = B.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 19
|q|σ : (N → N) → N |u∗ |σ : (N → N) → N
are defined by
|∗|σ f n = fn |x|σ = σ(x)
|hp, t∗ i|σ f n = n |λhx, ki.u|σ = 0
|λx.u∗ |σ f n = |u∗ |σ[x7→n] (f ) |λk.u|σ = |u∗ |σ id
|λk.u|σ f = |u∗ |σ f
|t∗ ; p|σ f = (|t∗ |σ f |p|σ ) + 1
|qt∗ |σ f = (|q|σ (|t∗ |σ f )) + 1
The key properties that have inspired the definition of the above measure are
summarized by the following fact.
Fact 3.9. Let a be a t-closed t-term or a p-term or a q-term or a t-closed e-term.
(1 ) |a[p/x]|σ = |a|σ[x7→|p|σ ] , for every p-term p.
(2 ) |t∗ ◦ a|σ f = |a|σ (|t∗ |σ f ), for every t-closed t-term t∗ , when a is a t-closed
t-term or a t-closed e-term.
Proof. By induction on the structure of a.
(1) Straightforward.
(2) In the base case a = ∗, we have |t∗ ◦ ∗|σ f = |t∗ |σ f = |∗|σ (|t∗ |σ f ). The
induction steps are:
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 21
(a) if a = hp, t0∗ i, then |t∗ ◦ hp, t0∗ i|σ f = id = |hp, t0∗ i|σ (|t∗ |σ f );
(b) if a = λx.u∗ with x 6∈ FV(t∗ ), then |t∗ ◦ λx.u∗ |σ f = λn.|t∗ ◦ u∗ |σ[x7→n] f
= (by the induction hypothesis and x 6∈ FV(t∗ )) λn.|u∗ |σ[x7→n] (|t∗ |σ f )
= |λx.u∗ |σ (|t∗ |σ f );
(c) if a = t0∗ ; p, then |t∗ ◦ (t0∗ ; p)|σ f = |t∗ ◦ t0∗ |σ f |p∗ |σ + 1 = (by the induction
hypothesis) |t0∗ |σ (|t∗ |σ f ) |p∗ |σ + 1 = |t0∗ ; p|σ (|t∗ |σ f );
(d) if a = qt0∗ , then |t∗ ◦ (qt0∗ )|σ f = |q|σ (|t∗ ◦ t0∗ |σ f ) + 1 = (by the induction
hypothesis) |q|σ (|t0∗ |σ (|t∗ |σ f )) + 1 = |qt0∗ |σ (|t∗ |σ f ).
4. TRANSLATIONS
Theorem 3.12 shows that the ptq-calculus is a well-suited target language for the
“compilation” of λ-terms: given a suitable translation of λ-terms into ptq-terms, we
can compute the normal form of a λ-term by reducing its corresponding ptq-term;
where by suitable translation we mean a (total) map that inverts the readback.
Let us remind that, since in a ptq-term there is at most one redex, the reduction
of the ptq-term is deterministic and induces a particular reduction strategy of its
readback. As a consequence, any translation of λ-terms into ptq-terms defines a
reduction strategy for λ-terms. In particular, and this is the interesting compu-
tational property of the ptq-calculus, we can define translations that implement
Call-by-Value and Call-by-Name (see Plotkin [Plotkin 1975]).
4.1 Call-by-Value and Call-by-Name λ-calculus
In the Call-by-Value (CbV) and in the Call-by-Name (CbN) λ-calculus a λ-term is
a value if it is not an application. The main rule, in both cases, is the β-rule of
λ-calculus that, in CbV, is restricted to the case in which a λ-abstraction is applied
to a value.
In the paper we shall consider the lazy case only, that is we shall not reduce the
β-redexes that are in the scope of a λ-abstraction.
The reduction rules of CbN and CbV will be given by means of inference rules
that do not extend to contexts. In the case of CbN, we have two rules (small step
natural semantics of CbN):
M 7→n M1
βn
(λx.M )N 7→n M [N/x] M N 7→n M1 N
The βn -rule is the standard β-reduction of λ-calculus restricted to the case in which
the reducing term is a β-redex. The second rule, instead, allows to reduce a β-redex
when it is the left-most-outer-most head application of the term.
The CbN-normal form of any closed λ-term M is a value V , say M ⇓n V . The
relation ⇓n is defined by the following rules (big step natural semantics of CbN):
M ⇓n λx.M1 M1 [N/x] ⇓n V
V ⇓n V M N ⇓n V
where V denotes a value.
The main reduction rule of CbV is the usual β-rule restricted to the case in which
the reducing term is a β-redex whose argument is a value, namely
βv
(λx.M )V 7→v M [V /x]
where V denotes a value.
As in the case of CbN, the small steps natural semantics of CbV is completed by
the inference rules that allow to reduce the head redexes of an application that, in
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 23
this case, can be in the argument part also. However, we have to fix an evaluation
order deciding which part of an application we want to reduce first. The rules that
reduce the function part first are
M 7→v M1 N 7→v N1
M N 7→v M1 N V N 7→v V N1
where V denotes a value. Otherwise, if one wants to reduce the argument first, the
rules are
N 7→v N1 M 7→v M1
M N 7→v M N1 M V 7→v M1 V
where V denotes a value.
Both choices lead to the following big step natural semantics for CbV
M ⇓v λx.M1 M1 [W/x] ⇓v V N ⇓v W
V ⇓n V M N ⇓n V
where V and W denote values.
The typing rules of CbV and CbN are the usual ones of simply typed λ-calculus.
that translates a λ-term M into another λ-term dM en s.t. the CbV reduction of
dM en I corresponds to the CbN reduction of M .
The untyped CbN translation of terms given above corresponds to the following
translation of typed terms
CbN
Γ`M :A dΓen ` dM en : dAen
where, if Γ = x1 : A1 , . . . , xn : An , then dΓen = x1 : dA1 en , . . . , xn : dAn en , and the
translation of the types dAen is defined by
dAen = bAcn → o → o
bXcn = X bA → Bcn = dAen → dBen
where o is a new base type and X denotes a base type.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
24 · S. Guerrini and A. Masini
For the analysis of the correspondence between Plotkin’s translation and the ptq-
translation that we shall give in the following, let us observe that, by uncurryfying
the translation of A → B, we can assume
bA → Bcn = (dAen × (bBcn → o)) → o
Correspondingly, the CbN translation of terms becomes
dxen = x
dλx.M en = λk.k(λ(x, h).dM en h)
dM N en = λk.dM en (λm.m(dN en , k))
4.2.2 CbV translation. The CbV translation is defined by the map
dxev = λk.kx
dλx.M ev = λk.k(λx.dM ev )
dM N ev = λk.dM ev (λm.dN ev (λn.mnk))
that translates every λ-term M into another λ-term dM ev s.t. the CbN reduction
of dM ev I corresponds to the CbV reduction of M .
The map above ensures that, in an application M N , the function M is evaluated
first. Replacing the translation of M N with
dM N ev = λk.dN ev (λn.dM ev (λm.mnk))
we get the translation for the case in which, in an application M N , the argument
N is evaluated first.
The untyped CbV translation of terms given above corresponds to the following
translation of typed terms
CbV
Γ`M :A bΓcv ` dM ev : dAev
where, if Γ = x1 : A1 , . . . , xn : An , then bΓcv = x1 : bA1 cv , . . . , xn : bAn cv and the
translations of types bAcv and dAev are defined by
dAev = bAcv → o → o
bXcn = X bA → Bcn = bAcv → dBev
where o is a new base type and X denotes a base type.
As in the case of CbN translation, by uncurryfying the translation of A → B, we
get
bA → Bcn = (bAcv × (bBcv → o)) → o
Correspondingly, the CbV translation of terms becomes
dxev = λk.kx
dλx.M ev = λk.k(λ(x, h).dM ev h)
λk.dM ev (λm.dN ev (λn.m(n, k)))
eval M first
dM N ev =
λk.dN ev (λn.dM ev (λm.m(n, k))) eval N first
Call-by-Name Call-by-Value
xn = x xv = λk.k; x
n n v v
λx.M = λhx, ki.k; M λx.M = λk.k; (λhx, ki.M k)
n n n v v v
MN = λk.hN , ki; M MN = λk.N (λx.M hx, ki)
Fig. 4. ptq-translations
bAcn Ap bAcn → o At
that also implies, in the translation with pairs,
bA → Bcn → o = dAen × (bBcn → o) A → Bt
Correspondingly, the CbN Plotkin’s translation of terms becomes
dxen x
n n
dλx.M e λk.k; (λ(x, m).m; M )
n n
dM N en λk.(λm.hN , ki; m); M
Such a translation can be simplified to the ptq-translation in Figure 4 by observing
that, by η-equivalence λk.(λm.hdN en , ki; m); dM en = λk.hdN en , ki; dM en and that,
since in the translation we never use t-terms with the shape λx.u, we can also assume
that λk.k; (λhx, mi.m; dM en ) is equivalent to λhx, mi.m; dM en .
4.4 Call-by-Value ptq-translation
The CbV ptq-translation derives from the translation of minimal logic that maps the
premises of the ending sequent into p-formulas and its conclusion into a q-formula
Γ`A Γ p ` Aq
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
26 · S. Guerrini and A. Masini
In order to get the above correspondence, one can easily find the CbV translation
in Figure 4.
Proposition 4.2. Let Γ ` M : A be derivable in the simply typed λ-calculus.
v
Then, Γp ` M : Aq is derivable in the ptq-calculus.
Proof. By induction on the structure of M .
4.4.1 Correspondence with Plotkin’s CbV translation. In order to relate the CbV
ptq-translation with Plotkin’s CbV translation, the translated Plotkin’s types can
be mapped to ptq-types according to the following schema:
dAen = bAcn → o → o Aq
bAcn Ap bAcn → o At
that also implies, in the translation with pairs,
bA → Bcn → o = bAcn × (bBcn → o) A → Bt
Correspondingly, the CbV Plotkin’s translation of terms becomes
dxev λk.k; x
v v
dλx.M e λk.k; (λhx, hi.h; M )
v v
λk.M (λm.(N (λn.hn, ki; m)))
dM N ev v v
λk.N (λn.(M (λm.hn, ki; m)))
The translation in which M is evaluated first cannot be simplified. The case in
which N is evaluated first, instead, can be reduced to the CbV ptq-translation in
Figure 4 because of the η-equivalence λm.hn, ki; m = hn, ki.
(a) if V = x, then V n = V v = x;
(b) if V = λx.N , then V n = λhx, ki.un and V v = λhx, ki.uv for some un and
uv .
(2) By structural induction on M . When M = V , where V is a value (base case),
n v
it is readily seen that ∗; V → ∗; V n and V ∗ → ∗; V v by a control reduction.
When M = P Q, by the induction hypothesis, we have three control reductions
∗ n v ∗ v v ∗ v
s.t.: ∗; P → P , for the CbN; P ∗ → P and Q ∗ → Q , for the CbV.
Therefore, by Lemma 3.2,
—for the CbN, we have the control reduction
n n n n ∗ n n n
∗; M = ∗; P Q → hQ , ∗i; P → hQ , ∗i ◦ P = M ;
—for the CbV,
(a) when Q = V is a value, we have the control reduction
v v v ∗ v v
∗; M = P V ∗ = hV v , ∗i ◦ P → hV v , ∗i ◦ P = M ;
(b) when Q is not a value, we have the control reduction
v v v v ∗ v v v
∗; M = P Q ∗ → (λx.P hx, ∗i) ◦ Q → (λx.P hx, ∗i) ◦ Q = M .
5.2 Readback
One of the key properties of the ptq-translations is that the readback of a translated
term is the term itself.
Proposition 5.3. For every λ-term M ,
n n n
(1 ) J∗; M K = JM K = JM K = M
v v v
(2 ) JM ∗K = JM K = JM K = M
n n
Proof. By the definition of readback, it is readily seen that J∗; M K = JM K
v v
and that JM ∗K = JM K.
n
(1) We shall prove JM K = M , by induction on the structure of M .
(a) Jxn K = x
n n n
(b) Jλx.P K = Jλhx, ki.k; P K = λx.J∗; P K = (by the induction hypothesis)
λx.P
n n n n n n n
(c) JP Q K = Jλk.hQ , ki; P K = JhQ , ∗iK ◦ JP K = JP KJQ K = (by the in-
duction hypothesis) P Q
v
(2) By induction on the structure of M , we shall prove that JM t∗ K = Jt∗ K ◦ M .
v
(a) Jx t∗ K = Jt∗ K ◦ Jλk.k; xK = Jt∗ K ◦ J∗; xK = Jt∗ K ◦ x
v v v
(b) JP Q t∗ K = Jt∗ K ◦ JQ (λx.P hx, ∗i)K = (by the induction hypothesis) Jt∗ K ◦
v v
Jλx.P hx, ∗iK ◦ Q = Jt∗ K ◦ JP hx, ∗iK[Q/x] = (by the induction hypothesis)
Jt∗ K ◦ (Jhx, ∗iK ◦ P )[Q/x] = Jt∗ K ◦ P x[Q/x] = Jt∗ K ◦ P Q
v v v
(c) Jλx.P t∗ K = Jt∗ K ◦ Jλhx, ki.P kK = Jt∗ K ◦ λx.JP ∗K = (by the induction
hypothesis) Jt∗ K ◦ λx.P
v
In particular, JM ∗K = J∗K ◦ M = M .
n ∗ n v ∗ v
By Lemma 5.2, ∗; M → M and M ∗ → M by control reductions. Therefore,
n n v v
by Proposition 3.8, JM K = J∗; M K = M and JM K = JM ∗K = M .
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 29
v
shape ∗; p for some p; therefore, M is in normal form. If Q → Q0 in the
CbV, then M → P Q0 V1 . . . Vk = N in the CbV. By the induction hypoth-
v v v v v
esis, Q → Q0 and M → (λx.P [x, V1 v , . . . , Vk v ]) ◦ Q0 , by Lemma 3.2.
v v v
Then, if Q0 is not a value, (λx.P [x, V1 v , . . . , Vk v ]) ◦ Q0 = N , otherwise,
if Q0 = V is a value, we have
v v
M → (λx.P [x, V1 v , . . . , Vk v ]); V v
v
→ P [V v , V1 v , . . . , Vk v ]
∗ v
→ [V v , V1 v , . . . , Vk v ]; P
v v
= P V V1 . . . Vk = N
∗; M
n ∗ / n
N
O O
n n
(·) (·)
_ _
M
∗ / N
CbN
∗ v ∗ v
(2 ) If M → N in the CbV λ-calculus, then M → N , namely
M ∗
v ∗ / v
N
O O
v v
(·) (·)
_ _
M
∗ / N
CbV
∗; M
n ∗ / u∗
_ _
J·K J·K
M
∗ / Ju∗ K
CbN
v ∗ ∗
(2 ) If M ∗ → u∗ , then M → Ju∗ K in the CbV λ-calculus, namely
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 31
v
M ∗
∗ / u∗
_ _
J·K J·K
M
∗ / Ju∗ K
CbV
∗
Proof. By Lemma 5.2, M → M by a control reduction for CbN and CbV.
∗ ∗
Therefore, Ju∗ K = M , for every M → u∗ → M (by Proposition 3.8). By Lemma 5.2,
M is either a normal form or a β-redex. When M is a β-redex, there is a reduction
∗ ∗
M → u0∗ → u∗ → N s.t. all the rules but the first one are control rules (see the
proof of Proposition 5.5). By Proposition 3.8, we have then M → Ju0∗ K = Ju∗ K = N .
Proposition 5.5 ensures that M → Ju∗ K by CbN or CbV according to the case that
we are considering.
(the only cases that change are those for the terms in which there are explicit
occurrences of test variables).
In accord with this step from λ-calculus to λµ-calculus, the translations in Fig-
ure 4 extend to λµ-terms by adding
µh.(k)M = λh.k; M
and by assuming the proviso that the variables k introduced by the other rules are
always fresh.
It is readily seen that for both CbN and CbV the readback preserves the key
property that
JM K = M
But the extension is no longer trivial when we try to compare the reductions. In
particular, the rule that contracts the redex λx.u; p is the only one with no corre-
spondence in the λµ-calculus. Then, since the CbN translation does not introduce
any λx.u subterm in the image of a term M , in this case case we can immediately
obtain that
n ∗ ∗
∗; M → u∗ implies M →N with N ∼ µk.Ju∗ [k/∗]K
where ∼ is a structural congruence on λµ-terms. On the contrary, since the use of
the λx abstraction is crucial in the CbV translation, it is not yet clear to us which
kind of simulation we can get for CbV, neither with respect to the CbV λµ-calculus
proposed by Ong and Stewart [1997].
Summing up, in extending the analysis presented in this paper to the classical
case, our main goal will be to understand in which way the ptq-calculus relates to
Ong and Stewart Call-by-Value λµ-calculus [Ong and Stewart 1997] and to Curien
and Herbelin’s λ̄µµ̃-calculus [Curien and Herbelin 2000].
REFERENCES
Ariola, Z. M. and Herbelin, H. 2003. Minimal classical logic and control operators. In Au-
tomata, languages and programming. Lecture Notes in Comput. Sci., vol. 2719. Springer, Berlin,
871–885.
Barbanera, F. and Berardi, S. 1993. Extracting constructive content from classical logic via
control-like reductions. In TLCA ’93: Proceedings of the International Conference on Typed
Lambda Calculi and Applications, M. Bezem and J. F. Groote, Eds. Lecture Notes in Computer
Science, vol. 664. Springer-Verlag, Utrecht, The Netherlands, 45–59.
Barbanera, F. and Berardi, S. 1994. A symmetric lambda-calculus for classical program
extraction. In Proceedings of TACS ’94. Lecture Notes in Computer Science, vol. 789. Springer-
Verlag.
Curien, P.-L. and Herbelin, H. 2000. The duality of computation. In ICFP ’00: Proceedings
of the fifth ACM SIGPLAN international conference on Functional programming. ACM Press,
New York, NY, USA, 233–243.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
Proofs, tests and continuation passing style · 33
Danos, V., Joinet, J.-B., and Schellinx, H. 1995. LKT and LKQ: sequent calculi for second
order logic based upon dual linear decomposition of classical implication. In Advances in Linear
Logic, J.-Y. Girard, Y. Lafont, and L. Regnier, Eds. Cambridge University Press, 43–59.
Danos, V., Joinet, J.-B., and Schellinx, H. 1997. A new deconstructive logic: Linear logic.
Journal of Symbolic Logic 62, 3, 755–807.
Danvy, O. 2004. On evaluation contexts, continuations, and the rest of the computation. In
Proceedings of the Fourth ACM SIGPLAN Continuations Workshop (CW’04), H. Thielecke,
Ed. Number CSR-040-1 in Technical Report. Proceedings of the Fourth ACM SIGPLAN Con-
tinuations Workshop (CW’04), Birmingham, UK.
de Groote, P. 1998. An environment machine for the lambda-mu-calculus. Mathematical Struc-
tures in Computer Science 8, 6, 637–669.
Felleisen, M., Friedman, D. P., Kohlbecker, E. E., and Duba, B. F. 1986. Reasoning with
continuations. In Proceedings of the First Annual IEEE Symp. on Logic in Computer Science,
LICS 1986, A. Meyer, Ed. IEEE Computer Society Press, 131–141.
Fischer, M. J. 1972. Lambda calculus schemata. In Proceedings of ACM conference on Proving
assertions about programs. ACM Press, New York, NY, USA, 104–109.
Führmann, C. and Thielecke, H. 2004. On the call-by-value CPS transform and its semantics.
Inform. and Comput. 188, 2, 241–283.
Girard, J.-Y. 1999. On the meaning of logical rules I: syntax vs. semantics. In Computational
Logic, Proceedings of the NATO Advanced Study Institute on Computational Logic, held in
Marktoberdorf, Germany, July 29 - August 10, 1997, U. Berger and H. Schwichtenberg, Eds.
NATO ASI Series, Computer and Systems Sciences, vol. 165. Springer, 215–272.
Griffin, T. G. 1990. The formulae-as-types notion of control. In Conf. Record 17th Annual
ACM Symp. on Principles of Programming Languages, POPL’90, San Francisco, CA, USA,
17–19 Jan 1990. ACM Press, New York, 47–57.
Herbelin, H. 1995. Séquents qu’on calcule. Thèse de Doctorat, Université Paris 7.
Hofmann, M. and Streicher, T. 1997. Continuation models are universal for lambda-mu-
calculus. In LICS ’97: Proceedings of the 12th Annual IEEE Symposium on Logic in Computer
Science. IEEE Computer Society, Washington, DC, USA, 387.
Ogata, I. 2002. A proof theoretical account of continuation passing style. In CSL ’02: Proceedings
of the 16th International Workshop and 11th Annual Conference of the EACSL on Computer
Science Logic. Springer-Verlag, London, UK, 490–505.
Ong, C.-H. L. and Stewart, C. A. 1997. A Curry-Howard foundation for functional compu-
tation with control. In Conf. Record 24th ACM SIGPLAN-SIGACT Symp. on Principles of
Programming Languages, POPL’97, Paris, France, 15–17 Jan. 1997. ACM Press, New York,
215–227.
Parigot, M. 1992. λµ-calculus: an algorithmic interpretation of classical natural deduction. In
Logic programming and automated reasoning (St. Petersburg, 1992). Lecture Notes in Comput.
Sci., vol. 624. Springer, Berlin, 190–201.
Parigot, M. 1997. Proofs of strong normalisation for second order classical natural deduction.
J. Symbolic Logic 62, 4, 1461–1479.
Plotkin, G. D. 1975. Call-by-name, call-by-value and the lambda-calculus. Theor. Comput.
Sci. 1, 2, 125–159.
Sabry, A. and Felleisen, M. 1993. Reasoning about programs in continuation-passing style.
Lisp and Symbolic Computation 6, 289–360.
Selinger, P. 2001. Control categories and duality: on the categorical semantics of the lambda-mu
calculus. Math. Structures Comput. Sci. 11, 2, 207–260.
Streicher, T. and Reus, B. 1998. Classical logic, continuation semantics and abstract machines.
J. Funct. Programming 8, 6, 543–572.
Wadler, P. 2005. Call-by-value is dual to call-by-name reloaded. In Term rewriting and appli-
cations. Lecture Notes in Comput. Sci., vol. 3467. Springer, Berlin, 185–203.
Zucker, J. 1974. The correspondence between cut-elimination and normalization, Part I & II.
Annals of Mathematical Logic 7, 1–155.
ACM Transactions on Computational Logic, Vol. V, No. N, December 2007.
34 · S. Guerrini and A. Masini