natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
constructive mathematics, realizability, computability
propositions as types, proofs as programs, computational trinitarianism
Call-by-push-value is a type theory and programming language paradigm which has full embeddings of call-by-value? and call-by-name? lambda-calculi, including their operational semantics, equational theories and denotational models.
Its semantics decomposes the semantics of effectful languages using a strong monad into a strong adjunction. Then the embeddings of call-by-value and call-by-name correspond to the construction of Kleisli and co-Kleisli categories from an adjunction.
CBPV has two “kinds” of types: value types — written — and computation types — written . As originally presented. there are 3 term judgments of CBPV: Values, Terms, and Stacks.
The value judgment is an ordinary simple type theory. A context is a sequence of value typed variables and the judgment admits symmetry, contraction, weakening and the corresponding substitution principle: if for every in , , then there is a value .
The term judgment has again a value typed context , but the output type is a computation type . Again it admits symmetry, contraction and weakening, and admits a substitution principle on its inputs, if we have a as above, then there is a term .
Finally the stack judgment has a value context as input, but also a computation type as input and output: . Stacks have an admissible substitution operation as above. Stacks also have a composition operation: if and then , which is associative and has a unit: the empty stack . Finally, stacks have an action on terms: if and then , which is associative with as identity.
We can get a slightly simpler presentation by combining the stack and term judgments into a single term judgment with a stoup?: a context that is either a single type or empty. Then a term as before is a term typed with the empty stoup and a stack is a term typed with a full stoup. This has the benefit of combining the action of stacks on terms and the composition of stacks as one operation. Below we write a stoup as , and if it is empty we don’t write it at all.
Call-by-push-value is characterized not just by its judgmental structure, but by a specific choice of which connectives to use. Except for the shifts , all value type connectives are left adjoints, and all computation type connectives are right adjoints.
For this reason, some connectives are definable from the judgments but excluded because they violate this discipline. These are a tensor product which is a computation type, a unit computation type, and a linear function space which is a computation type. When these are added, the system is called the Enriched Effect Calculus (modulo some superficial syntactic differences).
The shift types express the adjunction between values and stacks. The type is a value type that is pronounced as “thunk of ”, and can be thought of as the type of closures that when called behave as . It is a value type, but a right adjoint, with invertible introduction rule
and elimination rule:
With rule and rule .
The type is a computation type that is the type of “returners of s”. It is a computation type, but a left adjoint, with invertible elimination rule that enables the sequencing of effects:
with introduction rule:
with rule and rule that for any stack , we have .
The semantics of Call-by-push-value was originally presented using fibred categories, but we can get a presentation of its semantics in a more multi-categorical flavor by expressing it as an adjoint logic from a specific mode theory in the sense of LSR.
As a summary, the mode theory of CBPV is the theory of a cartesian monoid acting on a pointed object. In more detail, we have two modes: for values and for computations. Then the mode is axiomatized as a cartesian monoid , which gives the value judgment. To axiomatize the term and stack judgments, we add an asymmetric tensor product
to represent the combined context and also a “point” for the computation types:
which represents the empty stoup.
To correctly model the substitution structure, we add equations that say that the tensor product constitutes an action of the monoid, i.e., associativity and unitality:
Then for example, the type above is and the type is .
Furthermore, the mode theory also gives the “missing” types of the Enriched Effect Calculus. The tensor product is , the unit is and the linear function space is .
Note that this mode theory is equivalent to the one given for a strong monad in LSR, which instead of the point adds a morphism , and requires this be a homomorphism of -actions in that
However, this is equivalent to our above presentation because for any , we have , so , so is completely determined by where it takes , so we can axiomatize that directly as the point .
Paul-Blain Levy, Call-by-Push-Value: A Subsuming Paradigm, TLCA 1999
Paul-Blain Levy, Adjunction Models for Call-by-push-value with Stacks, CTCS version, EPTCS journal version, 2003
Jeff Egger, Rasmus Ejlers Møgelberg and Alex Simpson, The Enriched Effect Calculus: Syntax and Semantics, Journal of Logic and Computation, Volume 24.
Daniel Licata, Mike Shulman, and Mitchell Riley, A Fibrational Framework for Substructural and Modal Logics (extended version), in Proceedings of 2nd International Conference on Formal Structures for Computation and Deduction (FSCD 2017) (doi: 10.4230/LIPIcs.FSCD.2017.25, pdf)
Last revised on February 11, 2023 at 14:47:08. See the history of this page for a list of all contributions to it.