Call-by-name, call-by-value, call-by-need and the linear lambda calculus

J. Maraist, M. Odersky, D.N. Turner, P. Wadler
1999 Theoretical Computer Science  
Girard described two translations of intuitionistic logic into linear logic, one where A → B maps to (!A) ( B and another where it maps to !(A ( B). We detail the action of these translations on terms and show that the ÿrst corresponds to a call-by-name calculus, while the second corresponds to call-by-value. We further show that if the target of the translation is taken to be an a ne calculus, where! controls contraction but weakening is allowed everywhere, then the second translation
more » ... ds to a call-by-need calculus, as recently deÿned by Ariola, Felleisen, Maraist, Odersky and Wadler. Thus the di erent calling mechanisms can be explained in terms of logical translations, bringing them into the scope of the Curry-Howard isomorphism. Our results extend neatly to translations of extensions for recursion in the call-by-name and call-by-value calculi, and in general to extensions for products and for the corresponding untyped systems. : S 0 3 0 4 -3 9 7 5 ( 9 8 ) 0 0 3 5 8 -2 J. Maraist et al. / Theoretical Computer Science 228 (1999) 175-210 While we hesitate to compare our work to Plotkin's, our goal here is somewhat similar. We demonstrate how the two di erent calling mechanisms can be explained by two di erent translations into linear logic. At the time we are writing, the call-by-name translation is widely appreciated, but the call-by-value translation is less well known. Both translations can be found in the original paper of Girard [14], the ÿrst based on mapping A → B into (!A) ( B and the second based on mapping it into !(A ( B). Girard devotes several pages to the ÿrst translation and less than a paragraph to the second, stating that "its interest is limited". That the ÿrst translation corresponds to callby-name appears to be widely known, while the knowledge that the second translation corresponds to call-by-value appears to be restricted to a narrower circle. A number of di erent lambda calculi based on linear logic have been proposed, including work by Lafont [19], Holmstr om [17], Wadler [39-42], Abramsky [1], Mackie [22], Lincoln and Mitchell [21], Troelstra [37], Benton, Bierman, de Paiva and Hyland [9-12] and della Rocca and Roversi [32]. Various embeddings of intuitionistic logic into linear logic have also been studied, including work by Girard [14], Troelstra [37] and Schellinx [35]. The linear lambda calculus used in this paper is a minor reÿnement of one previously presented by Wadler [41, 42], which is based on Girard's successor to linear logic, the Logic of Unity [15]. A similar calculus has been devised by Plotkin and Barber [6]. In many presentations of logic a key role is played by the structural rules: contraction provides the only way to duplicate an assumption, while weakening provides the only way to discard one. In linear logic [14] , the presence of contraction or weakening is revealed in a formula by the presence of the 'of course' connective, written '!'. The Logic of Unity [15] takes this separation one step further by distinguishing linear assumptions, which one cannot contract or weaken, from nonlinear or intuitionistic assumptions, which one can. Corresponding to Girard's ÿrst translation we deÿne a mapping • from the call-byname to the linear calculus and show that this mapping is sound, in that M Name N implies M • Lin N • , and complete, in that the converse also holds. Corresponding to Girard's second translation we deÿne a second mapping * from the call-by-value calculus to the linear calculus and show that this mapping is also sound, in that if M Val N then M * Lin N * , but not complete. To recapture completeness of the second translation, we consider translations of standard reduction sequences, which are essentially the same as the evaluation machines of Plotkin's original presentation. Mackie [23] has also observed that the ÿrst translation corresponds to call-by-name and the second to call-by-value. (He also states that these observations are common in the literature, but he gives no references and we have been unable to locate any.) Mackie's work is complementary to our own. Our translations are into a linear lambda calculus, corresponding to intuitionistic linear logic, while Mackie's translation is into proof nets, corresponding to classical linear logic. We prove soundness and completeness for beta (but not eta); while Mackie proves soundness (but not completeness) for beta and eta. Mackie also says nothing about call-by-need, which we do discuss.
doi:10.1016/s0304-3975(98)00358-2 fatcat:wpm6kbycovabhlkibythzok3mu