ArticleslgStudy

mathematics

Call-by-push-value

Call-by-push-value is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Call-by-push-value rather than just read about it. In short: In programming language theory, call-by-push-value (CBPV) is an intermediate language that embeds the call-by-value (CBV) and call-by-name (CBN) evaluation strategies. CBPV is structured as a polarized λ-calculus with two main types, "values" (+) and "computations" (-).

Key takeaways

  • Call-by-push-value belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Call-by-push-value to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Call-by-push-value from memory before moving on to harder problems.

Reference excerpt

In programming language theory, call-by-push-value (CBPV) is an intermediate language that embeds the call-by-value (CBV) and call-by-name (CBN) evaluation strategies. CBPV is structured as a polarized λ-calculus with two main types, "values" (+) and "computations" (-). Restrictions on interactions between the two types enforce a controlled order of evaluation, similar to monads or CPS. The calculus can embed computational effects, such as nontermination, mutable state, or nondeterminism. There are natural semantics-preserving translations from CBV and CBN into CBPV. This means that giving a CBPV semantics and proving its properties implicitly establishes CBV and CBN semantics and properties as well. Paul Blain Levy formulated and developed CBPV in several papers and his doctoral thesis.

Definition The CBPV paradigm is based on the slogan "a value is, a computation does". One complication in the presentation is distinguishing type variables ranging over value types from those ranging over computation types. This article follows Levy in using underlines to denote computations, so B is an (arbitrary) value type but B_ is a computation type. Some authors use other conventions, such as distinct sets of letters. The exact set of constructs varies by author and desired use for the calculus, but the following constructs are typical:

Lambdas λx.M are computations of type A→B_, where x:A and M:B_. A lambda application F V or V'F is a computation of type B_, where V:A and F:A→B_. The let-binding construct let { x_1 = V_1; ... }. M binds values x_1 to values V_1, of matching types A1, inside a computation M : B_. A thunk thunk M is a value of type UA_ constructed from a computation M of type A_. Forcing a thunk is a computation, force X : A_ for a thunk X : UA_. It is also possible to wrap a value V of type A as a computation return V : FA. Such a computation can be used inside another computation as M to x. N : B_, where M : FA, and N : B_ is a computation. Values can also include algebraic data types constructed from a tag and zero or more sub-values, while computations include a deconstructing pattern-match match V as { (1,...) in M_1, ... }. Depending on presentation, ADTs may be limited to binary sums and products, Booleans only, or be omitted altogether. A program is a closed computation of type FA, where A is a ground ADT type.

Complex values Expressions such as not true : bool make sense denotationally. But, following the rules above, not can only be encoded using pattern-matching, which would make it a computation, and therefore the overall expression must also be a computation, giving not true : F bool. Similarly, there is no way to obtain 1 from (1,2) without constructing a computation. When modelling CBPV in the equational or category theory, such constructs are indispensable. Levy therefore defines an extended IR, "CBPV with complex values". This IR extends let-binding to bind values within a value expression, and also to pattern-match a value with each clause returning a value expression. Besides modelling, such constructs also make writing programs in CBPV more natural. Complex values complicate the operational semantics, in particular requiring an arbitrary decision of when to evaluate the complex value. Such a decision has no semantic significance because evaluating complex values has no side effects. Also, it is possible to syntactically convert any computation or closed expression to one of the same type and denotation without complex values. Therefore, many presentations omit complex values.

Translation The CBV translation produces CBPV values for each expression. A CBV function λx.M : A→vB is translated to thunk λx.Mv : U(Av→FBv). A CBV application M N : A is translated to a computation Mv to f in Nv to x in x'(force f) of type FA, making the order of evaluation explicit. A pattern match match V as { (1,...) in M_1, ... } is translated as Vv to z in match z as { (1,...) in M_1v, ... }. Values are wrapped with return when necessary, but otherwise remain unmodified. In some translations, sequencing may be required, such as translating inl M to M to x. return inl x. The CBN translation produces CBPV computations for each expression. A CBN function λx.M : A→B translates unaltered, λx.MN : (UAn)→Xn. A CBN application M N : C is translated to a computation Mv (thunk Nv) of type Cn. A pattern match match V as { (1,...) in M_1, ... } is translated similarly to CBN as Vn to z in match z as { (1,...) in M_1n, ... }. ADT values are wrapped with return, but force and thunk are also necessary on internal structure. Levy's translation assumes that M = force (thunk M), which does indeed hold. It is also possible to extend CBPV to model call-by-need, by introducing a M need x. N construct that allows visible sharing. This construct has semantics similar to M name x. N = (λy.N[x ↦ (force y)])(thunk M), except that with the need construct, the thunk of M is evaluated at most once.

Modifications Some authors have noted that CBPV can be simplified, by removing either the U type constructor (thunks) or the F type constructor (computations returning values). Egger and Møgelberg justify omitting U on the grounds of streamlined syntax and avoiding the clutter of inferable conversions from computations to values. This choice makes computation types a subset of value types, and it is then natural to expand function types to a full function space between values. They term their calculus the "Enriched Effects Calculus". This modified calculus is equivalent to a superset of CBPV via a bidirectional semantics-preserving translation. Ehrhard in contrast omits the F type constructor, making values a subset of computations. Ehrhard renames computations to "general types" to better reflect their semantics. This modified calculus, the "half-polarized lambda calculus", has close connections to linear logic. It can be translated bidirectionally to a subset of a fully-polarized variant of CBPV.

Award Paul Blain Levy received the 2025 Alonzo Church Award for his work on CBPV.

See also Programming Computable Functions

References

Worked examples

Example 1 — a first encounter with Call-by-push-value

Start with the simplest possible case. Write down what Call-by-push-value claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Call-by-push-value before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Call-by-push-value ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Call-by-push-value

In research
Call-by-push-value appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Call-by-push-value in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Call-by-push-value is common in secondary-school and first-year university syllabi. It links to neighbouring topics Lambda calculus, Programming language semantics, so understanding it makes those chapters shorter.
In everyday life
Look for Call-by-push-value outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Call-by-push-value” →

How to study Call-by-push-value in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Call-by-push-value means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Call-by-push-value out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Call-by-push-value in simple terms?

In programming language theory, call-by-push-value (CBPV) is an intermediate language that embeds the call-by-value (CBV) and call-by-name (CBN) evaluation strategies. CBPV is structured as a polarized λ-calculus with two main types, "values" (+) and "computations" (-).

Why does Call-by-push-value matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Call-by-push-value?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Call-by-push-value.

Tags

  • Lambda calculus
  • Programming language semantics

Keep exploring