Call-by-value, call-by-name and the vectorial behaviour of the algebraic lambda-calculus

Reading time: 6 minute
...

📝 Original Info

  • Title: Call-by-value, call-by-name and the vectorial behaviour of the algebraic lambda-calculus
  • ArXiv ID: 1005.2897
  • Date: 2015-07-01
  • Authors: : - Author1 - Author2 - …

📝 Abstract

We examine the relationship between the algebraic lambda-calculus, a fragment of the differential lambda-calculus and the linear-algebraic lambda-calculus, a candidate lambda-calculus for quantum computation. Both calculi are algebraic: each one is equipped with an additive and a scalar-multiplicative structure, and their set of terms is closed under linear combinations. However, the two languages were built using different approaches: the former is a call-by-name language whereas the latter is call-by-value; the former considers algebraic equalities whereas the latter approaches them through rewrite rules. In this paper, we analyse how these different approaches relate to one another. To this end, we propose four canonical languages based on each of the possible choices: call-by-name versus call-by-value, algebraic equality versus algebraic rewriting. We show that the various languages simulate one another. Due to subtle interaction between beta-reduction and algebraic rewriting, to make the languages consistent some additional hypotheses such as confluence or normalisation might be required. We carefully devise the required properties for each proof, making them general enough to be valid for any sub-language satisfying the corresponding properties.

💡 Deep Analysis

Figure 1

📄 Full Content

Two algebraic versions of the λ-calculus arise independently in distinct contexts: the algebraic λ-calculus (alg) [Vau09] and the linear algebraic λ-calculus (lineal) [AD08]. Both languages are extensions of λ-calculus where linear combinations of terms are also terms. The former has been introduced in the context of linear logic as a fragment of the differential λ-calculus [ER03]: the algebraic structure allows to gather in a non deterministic manner different terms, i.e. each term in the linear combination represents one possible execution. The latter has been introduced as a candidate λ-calculus for quantum computation: in lineal, a linear combination of terms reflects the phenomenon of superposition, i.e. the capability for a quantum system to be in two or more states at the same time. Our purpose is to study the connections between the two systems.

In both languages, functions which are linear combinations of terms are interpreted pointwise: (α.f + β.g) x = α.(f ) x + β.(g) x, where “.” denotes the scalar multiplication. The two languages differ in the treatment of the arguments. In lineal, in order to deal with the algebraic structure, any function is considered as a linear map: (f ) (α.x + β.y) → * α.(f ) x + β.(f ) y, reflecting the fact that any quantum evolution is a linear map. It reflects a call-by-value behaviour in the sense that the argument is evaluated until one has a base term. Conversely, alg has a call-by-name evolution: (λx M ) N → M [x := N ], without any restriction on N . As a consequence, the evolutions are different as illustrated by the following example. In lineal, (λx (x) x) (α.y + β.z) → * α.(y) y + β.(z) z while in alg, (λx (x) x) (α.y + β.z) → (α.y + β.z) (α.y + β.z) = α 2 .(y) y + αβ.(y) z + βα.(z) y + β 2 .(z) z.

Because they were designed for different purposes, another difference appears between the two languages: the way the algebraic part of the calculus is treated. In lineal, the algebraic structure is captured with a rewrite system, whereas in alg terms are considered up to algebraic equivalence.

The two choices -call-by-value versus call-by-name and algebraic equality versus algebraic reduction -allow one to construct four possible calculi. We name them λ → lin , λ = lin , λ → alg , and λ = alg . See Figure 1 where they are presented according to their evaluation policy and the way they take care of the algebraic part of the language.

Inspired by lineal and alg, the operational semantics of these four languages differ slightly from the original ones to better emphasise their characteristics: the reduction strategy and the handling of algebraic structure.

A first modification is that in all four languages, we avoid reduction under lambda abstractions. As a consequence, contrary to alg, the λ-abstraction is not linear anymore: λx (α.M + β.N ) = α.λx M + β.λx N . This restriction is a common restriction: reducing under λ could be considered as “optimising the program”. , restrictions originally imposed in lineal on the rewrite system to ensure confluence are replaced by restrictions making λ → lin and λ = lin call-by-value also in the algebraic part. For example, in the rule (M + N ) L → (M ) L + (N ) L the condition that M + N be closed-normal is replaced by the restriction of L to values. Notice that even in the original language lineal, waiving the restrictions makes sense when confluence can be ensured by other means, see e.g. [ADC11,Val10b]. Since this change in the strategy is not trivial, we prove that lineal and λ → lin share the same behaviour, result formalized in Theorems 2.2 and 2.3.

Our contribution in this paper is first to introduce the four canonical languages related to the original languages lineal and alg, and then to show the relation between lineal and alg, by proving the simulation of all these languages. We show that call-by-value algebraic λ-calculi simulate call-by-name ones and vice versa by extending the continuation passing style (CPS) translation [Plo75] to the algebraic case. We also provide simulations between algebraic equality and algebraic reduction in both directions. The simulations we prove are summed up in Figure 2. The solid arrows stand for theorems that do not require confluence or normalisation in their hypothesis whereas the dotted arrows stand for theorems requiring confluence, and the dashed arrows for theorems requiring strong normalisation. The star in alg and lineal means that the languages do not allow reduction under λ.

Related works. This paper connects two collections of works: one stemming from linear logic, the other one from quantum computation.

An important line of work in linear logic is concerned with the development of quantitative semantics: semantics where types are interpreted as (topological) vector spaces and lambda-terms as power series. Such semantics include for example finiteness spaces [Ehr05,Tas09], and Köthe spaces [Ehr03]. The models naturally question the introduction of new constructs into

📸 Image Gallery

cover.png

Reference

This content is AI-processed based on open access ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut