PLS Lab

Parigot's \lambda\mu-calculus

Parigot 1992 introduced the \lambda\mu-calculus as a system for classical logic.

In terms of programming, the \lambda\mu-calculus is a \lambda-calculus equipped with continuation variables, to which one can throw values, or capture them using binding.

Type system

The \lambda\mu-calculus has two sorts of typing judgments:

In either case, \Gamma is the usual context of variables x : A, while \Delta is a context of continuation variables \alpha : A.

The idea is that the first sequent is the usual intuitionistic one, stating that M is a term that computes a value of type A using continuation variables in \Delta. Meanwhile, the second sequent corresponds to a command, which does some "internal" computation.

The type system is given by the following rules, which are slightly adapted from the original system by Ariola and Herbelin 2003:

\frac{}{\Gamma, x : A \vdash x : A; \Delta}
\quad
\frac{
  \Gamma, x : A \vdash M : B ; \Delta
}{
  \Gamma \vdash \lambda x .\ M : A \to B ; \Delta
}
\quad
\frac{
  \Gamma \vdash M : A \to B; \Delta \quad
  \Gamma \vdash N : A; \Delta \quad
}{
  \Gamma \vdash MN : B; \Delta
}
\frac{
  \Gamma \vdash M : A; \Delta, \alpha : A
}{
  [\alpha]M : (\Gamma \vdash \bot; \Delta, \alpha : A)
}
\quad
\frac{
  c : (\Gamma \vdash \bot; \Delta, \alpha : A)
}{
  \Gamma \vdash \mu \alpha.\ c : A; \Delta
}

The first three rules are the usual rules of the simply-typed \lambda-calculus. They have an extra context \Delta added to them parametrically.

The last two rules are the classical rules. The first one is sometimes called the passivate rule, and the second one the activate rule.

Read logically, assumptions \alpha : A in \Delta can be understood as proofs of \lnot A. Then the rules capture the following intuitions:

Seen more operationally:

Example

It is an instructive exercise to show that Peirce's law is typable as the term

\vdash \lambda f. \mu \alpha. [\alpha](f(\lambda y. \mu \beta. [\alpha] y) : ((A \to B) \to A) \to A

Very roughly, the operational behaviour of this can be described as follows: in trying to produce an A:

Notice that the fact that \alpha persists even after one throws something at it in the passivate rule is crucial for typing this example.

Dynamics

There are two dynamics for the \lambda\mu calculus.

In either case, the substitution operator

[[\alpha](wM)/[\alpha]w]

replaces every subterm of the form [\alpha]w with the subterm [\alpha](wM). Similarly for [[\alpha](Vw)/[\alpha]w].

The presentation here has been adapted from Ariola and Herbelin 2003.

Call-by-name

Call-by-value

Let V be a value, i.e. a variable or a \lambda-abstraction.

References

Parigot, Michel. 1992. ‘λμ-Calculus: An Algorithmic Interpretation of Classical Natural Deduction’. In Logic Programming and Automated Reasoning, edited by Andrei Voronkov, 624:190–201. Lecture Notes in Computer Science. Berlin/Heidelberg: Springer-Verlag. https://doi.org/10.1007/BFb0013061.
@inproceedings{parigot_1992,
	address = {Berlin/Heidelberg},
	series = {Lecture {Notes} in {Computer} {Science}},
	title = {$\lambda\mu$-{Calculus}: {An} algorithmic interpretation of classical natural deduction},
	volume = {624},
	doi = {10.1007/BFb0013061},
	booktitle = {Logic {Programming} and {Automated} {Reasoning}},
	publisher = {Springer-Verlag},
	author = {Parigot, Michel},
	editor = {Voronkov, Andrei},
	year = {1992},
	pages = {190--201}
}
Parigot, Michel. 1997. ‘Proofs of Strong Normalisation for Second Order Classical Natural Deduction’. Journal of Symbolic Logic 62 (4): 1461–79. https://doi.org/10.2307/2275652.
@article{parigot_1997,
	title = {Proofs of strong normalisation for second order classical natural deduction},
	volume = {62},
	doi = {10.2307/2275652},
	number = {4},
	journal = {Journal of Symbolic Logic},
	author = {Parigot, Michel},
	year = {1997},
	pages = {1461--1479}
}
Ong, C.-H. L., and C. A. Stewart. 1997. ‘A Curry-Howard Foundation for Functional Computation with Control’. In Proceedings of the 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages - POPL ’97, 215–27. ACM Press. https://doi.org/10.1145/263699.263722.
@inproceedings{ong__1997,
	title = {A {Curry}-{Howard} foundation for functional computation with control},
	doi = {10.1145/263699.263722},
	booktitle = {Proceedings of the 24th {ACM} {SIGPLAN}-{SIGACT} {Symposium} on {Principles} of {Programming} {Languages}  - {POPL} '97},
	publisher = {ACM Press},
	author = {Ong, C.-H. L. and Stewart, C. A.},
	year = {1997},
	pages = {215--227}
}
Ariola, Zena M., and Hugo Herbelin. 2003. ‘Minimal Classical Logic and Control Operators’. In Automata, Languages and Programming, edited by Jos C. M. Baeten, Jan Karel Lenstra, Joachim Parrow, and Gerhard J. Woeginger, 2719:871–85. Lecture Notes in Computer Science. Berlin, Heidelberg: Springer Berlin Heidelberg. https://doi.org/10.1007/3-540-45061-0_68. slides
@inproceedings{ariola_2003,
	address = {Berlin, Heidelberg},
	series = {Lecture {Notes} in {Computer} {Science}},
	title = {Minimal {Classical} {Logic} and {Control} {Operators}},
	volume = {2719},
	doi = {10.1007/3-540-45061-0_68},
	booktitle = {Automata, {Languages} and {Programming}},
	publisher = {Springer Berlin Heidelberg},
	author = {Ariola, Zena M. and Herbelin, Hugo},
	editor = {Baeten, Jos C. M. and Lenstra, Jan Karel and Parrow, Joachim and Woeginger, Gerhard J.},
	year = {2003},
	pages = {871--885}
}