Lambda-mu calculus
In mathematical logic and computer science, the lambda-mu calculus is an extension of the lambda calculus introduced by Michel Parigot. It introduces two new operators: the μ operator and the bracket operator. Proof-theoretically, it provides a well-behaved formulation of classical natural deduction.
One of the main goals of this extended calculus is to be able to describe expressions corresponding to theorems in classical logic. According to the Curry-Howard isomorphism, lambda calculus on its own can express theorems in intuitionistic logic only, and several classical logical theorems can't be written at all. However with these new operators one is able to write terms that have the type of, for example, Peirce's law.
The μ operator corresponds to Felleisen's undelimited control operator and bracket corresponds to calling a captured continuation.
Formal definition
The three forms of expressions in lambda calculus are as follows:- A variable, where x is any identifier.
- An abstraction, where x is any identifier and M is any lambda expression.
- An application, where M and N are any lambda expressions.
- is a named term, where α is a μ-variable and M is an unnamed term.
- is an unnamed term, where α is a μ-variable and t is a named term.
Reduction
The basic reduction rules used in the lambda-mu calculus are the following:; beta reduction
; structural reduction
; renaming
; μη-reduction
These rules cause the calculus to be confluent.
Variations
Call-by-value lambda-mu calculus
To obtain call-by-value semantics, one must refine the beta reduction rule and add another form of structural reduction:;call-by-value beta reduction
; right structural reduction
This addition corresponds to the addition of an additional evaluation context former when moving from call-by-name to call-by-value evaluation.
De Groote's unstratified syntax
For a closer correspondence with conventional formalizations of control operators, the distinction between named and unnamed terms can be abolished, meaning that M is of the same sort as other lambda-expressions and the body of μ-abstraction can also be any expression. Another variant in this vein is the Λμ-calculus.Symmetric lambda-mu calculus
One can consider a structural reduction rule symmetric to the original one:This, however, breaks confluence and the correspondence to control operators.