## The Next 700 Krivine Machines (2005)

Venue: | N/P |

Citations: | 2 - 0 self |

### BibTeX

@MISC{Douence05thenext,

author = {Rémi Douence and Pascal Fradet},

title = { The Next 700 Krivine Machines},

year = {2005}

}

### OpenURL

### Abstract

The Krivine machine is a simple and natural implementation of the normal weak-head reduction strategy for pure λ-terms. While its original description has remained unpublished, this machine has served as a basis for many variants, extensions and theoretical studies. In this paper, we present the Krivine machine and some well-known variants in a common framework. Our framework consists of a hierarchy of intermediate languages that are subsets of the λ-calculus. The whole implementation process (compiler + abstract machine) is described via a sequence of transformations all of which express an implementation choice. We characterize the essence of the Krivine machine and locate it in the design space of functional language implementations. We show that, even within the particular class of Krivine machines, hundreds of variants can be designed.

### Citations

634 |
Compiling with continuations
- Appel
- 1992
(Show Context)
Citation Context ...pression λx 1…λx n .M, the K-machine does not build any closure whereas the eval-apply model builds n temporary closures corresponding to the n partial applications of this function. Uncurrying (e.g. =-=[1]-=-) may remove some of this overhead but this optimization is not always possible for functions passed as arguments. On the other hand, the eval-apply model facilitates the compilation of call-byvalue a... |

580 | Term Rewriting Systems - Klop - 1992 |

347 |
The mechanical evaluation of expressions
- Landin
- 1963
(Show Context)
Citation Context ...zation is not always possible for functions passed as arguments. On the other hand, the eval-apply model facilitates the compilation of call-byvalue and call-by-need. This choice is taken by the SECD =-=[22]-=-, the Cam [3] and also some non-strict implementations [14]. 3.3 β-reduction In the λ-calculus, β-reduction is defined as a textual substitution. This operation can be compiled using transformations f... |

337 |
An algorithmic interpretation of classical natural deduction
- Parigot
- 1992
(Show Context)
Citation Context ...xplicit substitutions aim at formalizing and proving functional language implementations. The K-machine has been a natural candidate to present and test some of these calculi [6][17]. The λμ-calculus =-=[27]-=- is an extension of the λ-calculus with control operators. Several implementations of this calculus are based on extensions of the K-machine [8] [34]. All this work demonstrates that the simplicity of... |

202 | Implementing Lazy Functional Languages on Stock Hardware: the Spineless Tagless G-machine, Version 2.5
- Jones
- 1992
(Show Context)
Citation Context ... be found in previous publications [9][10][12]. The transformation N is a very simple way to compile call-by-name. This option is also taken by Tim [13] and most graph-based implementations (e.g. [18]=-=[28]-=-). Another choice is the eval-apply model, where a λ-abstraction is considered as a result and the application of a function to its argument is an explicit operation. For an expression λx 1…λx n .M, t... |

200 |
A new implementation technique for applicative languages’, Software-Practice
- Turner
(Show Context)
Citation Context ...xtual substitution. This operation can be compiled using transformations from Λ s to Λ e . These transformations are akin to abstraction algorithms and consist of replacing variables with combinators =-=[35]-=-. In environment-based implementations, substitutions are compiled by storing values to be substituted in an environment. Values are accessed in the environment only when needed. This technique can be... |

177 | Unboxed objects and polymorphic typing
- Leroy
- 1992
(Show Context)
Citation Context ...es. Data structures can be represented using tags or higher-order functions [29][13]. These new choices would definitely allow the derivation of more than 700 K-machines. Optimisations (e.g. unboxing =-=[25]-=-, let-floating [30], sophisticated data representations [15][33], etc.) and other compilation steps (register allocation) would also bring new options. In this paper, we have presented the K-machine f... |

154 | F.Nielson. Semantics with Applications, A Formal Introduction for Computer Science
- Nielson
(Show Context)
Citation Context ...(snd ; appclos) correspond respectively to the λ, i+1 and 0 of Figure 1. The definition of a relation between states is a standard technique to prove the correctness or equivalence of implementations =-=[26]-=-. A reduction step E → F of the machine in Figure 6 is simulated by a sequence of reduction steps of the machine of Figure 1 (i.e. a state related to E is rewritten into a state related to F). Actuall... |

128 |
The categorical abstract machine
- Cousineau, Curien, et al.
- 1987
(Show Context)
Citation Context ...ine in the design space of functional language implementations. In particular, we mention alternative implementation choices and compare the K-machine with other abstract machines (e.g. Tim [13], Cam =-=[3]-=-). 2 Overview The most common description of the K-machine [5] is given in Figure 1. It takes the form of an operational semantics whose state transition rules involve de Bruijn’s λ-expressions * .A m... |

95 |
The ZINC experiment: an economical implementation of the ML language
- Leroy
- 1990
(Show Context)
Citation Context ... K-machine as a basis for the implementation of other reduction strategies (call-by-need, head and strong reduction [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine =-=[24]-=-; many others used it as a basis or framework for their work either practical or theoretical [8][16][23][31][32][34]. The presentations of the K-machine or its variants differ depending on the sources... |

73 | Deriving a Lazy Abstract Machine
- Sestoft
- 1997
(Show Context)
Citation Context ...ion [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8][16][23][31]=-=[32]-=-[34]. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environments and closur... |

66 |
Compiling Lazy Functional Languages
- Johnsson
- 1987
(Show Context)
Citation Context ... can be found in previous publications [9][10][12]. The transformation N is a very simple way to compile call-by-name. This option is also taken by Tim [13] and most graph-based implementations (e.g. =-=[18]-=-[28]). Another choice is the eval-apply model, where a λ-abstraction is considered as a result and the application of a function to its argument is an explicit operation. For an expression λx 1…λx n .... |

64 |
An abstract framework for environment machines
- Curien
- 1991
(Show Context)
Citation Context ...ed [32]. λ-calculi with explicit substitutions aim at formalizing and proving functional language implementations. The K-machine has been a natural candidate to present and test some of these calculi =-=[6]-=-[17]. The λμ-calculus [27] is an extension of the λ-calculus with control operators. Several implementations of this calculus are based on extensions of the K-machine [8] [34]. All this work demonstra... |

56 |
Implementing Functional Languages: a Tutorial
- Jones, Lester
- 1992
(Show Context)
Citation Context ... exploited by the garbage collector. Recursion can be implemented using circular environments or jumps to functions’ addresses. Data structures can be represented using tags or higher-order functions =-=[29]-=-[13]. These new choices would definitely allow the derivation of more than 700 K-machines. Optimisations (e.g. unboxing [25], let-floating [30], sophisticated data representations [15][33], etc.) and ... |

56 | Let-floating: moving bindings to give faster programs
- Jones, Partain, et al.
- 1996
(Show Context)
Citation Context ... can be represented using tags or higher-order functions [29][13]. These new choices would definitely allow the derivation of more than 700 K-machines. Optimisations (e.g. unboxing [25], let-floating =-=[30]-=-, sophisticated data representations [15][33], etc.) and other compilation steps (register allocation) would also bring new options. In this paper, we have presented the K-machine from an implementer’... |

55 | Classical logic, continuation semantics and abstract machines
- Streicher, Reus
- 1998
(Show Context)
Citation Context ...[4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8][16][23][31][32]=-=[34]-=-. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environments and closures a... |

49 | Analysis and efficient implementation of functional programs
- Sestoft
- 1991
(Show Context)
Citation Context ...duction [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8][16][23]=-=[31]-=-[32][34]. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environments and cl... |

47 |
TIM: A Simple, Lazy Abstract Machine to Execute Supercombinators
- Fairbairn, Wray
- 1987
(Show Context)
Citation Context ...efore mkclos in A. In this case, each closure has its own environment which can be represented by a vector. Access to values is therefore a constant access time operation. This choice is taken by Tim =-=[13]-=-, the SML-NJ compiler [1] and several other implementations [14][28].s3.4 Composition The push-enter model and shared environments are natural options for the compilation of call-by-name and β-reducti... |

37 |
Compilation of functional languages by program transformation
- Fradet, Métayer
- 1991
(Show Context)
Citation Context ...ents. On the other hand, the eval-apply model facilitates the compilation of call-byvalue and call-by-need. This choice is taken by the SECD [22], the Cam [3] and also some non-strict implementations =-=[14]-=-. 3.3 β-reduction In the λ-calculus, β-reduction is defined as a textual substitution. This operation can be compiled using transformations from Λ s to Λ e . These transformations are akin to abstract... |

29 | Unrolling lists
- Shao, Reppy, et al.
- 1994
(Show Context)
Citation Context ...r functions [29][13]. These new choices would definitely allow the derivation of more than 700 K-machines. Optimisations (e.g. unboxing [25], let-floating [30], sophisticated data representations [15]=-=[33]-=-, etc.) and other compilation steps (register allocation) would also bring new options. In this paper, we have presented the K-machine from an implementer’s point of view. We have focused on pure λ-ex... |

21 |
An abstract machine for lambda-terms normalization
- Crégut
- 1990
(Show Context)
Citation Context .... In particular, we mention alternative implementation choices and compare the K-machine with other abstract machines (e.g. Tim [13], Cam [3]). 2 Overview The most common description of the K-machine =-=[5]-=- is given in Figure 1. It takes the form of an operational semantics whose state transition rules involve de Bruijn’s λ-expressions * .A machine state (C, S, E) is made of a code C, an environment E a... |

20 | Functional back-ends within the lambda-sigma calculus
- Hardin, Maranget, et al.
- 1996
(Show Context)
Citation Context ...[32]. λ-calculi with explicit substitutions aim at formalizing and proving functional language implementations. The K-machine has been a natural candidate to present and test some of these calculi [6]=-=[17]-=-. The λμ-calculus [27] is an extension of the λ-calculus with control operators. Several implementations of this calculus are based on extensions of the K-machine [8] [34]. All this work demonstrates ... |

19 |
Machines à environnement pour la réduction symbolique et l’évaluation partielle
- Crégut
- 1991
(Show Context)
Citation Context ...for many variants, extensions and theoretical studies. For instance, Crégut used the K-machine as a basis for the implementation of other reduction strategies (call-by-need, head and strong reduction =-=[4]-=-); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8][16][23][31][32][34... |

15 |
From operational semantics to abstract machines: Preliminary results
- Hannan, Miller
- 1990
(Show Context)
Citation Context ...trong reduction [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8]=-=[16]-=-[23][31][32][34]. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environment... |

12 | An environment machine for the lambda-mu-calculus
- Groote
- 1998
(Show Context)
Citation Context ...d strong reduction [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical =-=[8]-=-[16][23][31][32][34]. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environ... |

12 |
Efficient combinator code
- Joy, Rayward-Smith, et al.
- 1985
(Show Context)
Citation Context ...ded. This technique can be compared with the activation records used by imperative language compilers. Some graph based implementations do not use environments but encode each substitution separately =-=[19]-=-[35]. The K-machine uses linked environments. Closures are built in constant time and include (a reference to) the complete environment. On the other hand, a chain of links has to be followed when acc... |

11 | A taxonomy of functional language implementations. Part II: call-byname, call-by-need, and graph reduction. INRIA research report 3050
- Douence, Fradet
- 1996
(Show Context)
Citation Context ...paper, we present the Kmachine and some well-known variants in a common framework. This framework has been used to describe, prove, compare, classify and hybridize functional language implementations =-=[9]-=-[10][11][12]. Here our main goal is: * ÉCOLE DES MINES DE NANTES, 4 rue Alfred Kastler, BP 20722, 44307 Nantes Cedex 3, France. ** Work performed while at INRIA/IRISA, Campus de Beaulieu, 35042 Rennes... |

10 |
A categorical understanding of environment machines
- Asperti
(Show Context)
Citation Context ...erved as a workbench to implement head and strong reduction strategies [5] and to study the integration and impact of static analyses [31]. The K-machine has 19s20 been presented in categorical terms =-=[2]-=- and its relationship with the Tim has been studied [4]. Not surprisingly, the K-machine has been one of the easiest machine to derive from formal semantics. The standard and lazy versions have been d... |

9 | Using Hindley-Milner type inference to optimise list representation
- Hall
(Show Context)
Citation Context ...order functions [29][13]. These new choices would definitely allow the derivation of more than 700 K-machines. Optimisations (e.g. unboxing [25], let-floating [30], sophisticated data representations =-=[15]-=-[33], etc.) and other compilation steps (register allocation) would also bring new options. In this paper, we have presented the K-machine from an implementer’s point of view. We have focused on pure ... |

7 | A systematic study of functional language implementations
- Douence, Fradet
- 1998
(Show Context)
Citation Context ...resent the Kmachine and some well-known variants in a common framework. This framework has been used to describe, prove, compare, classify and hybridize functional language implementations [9][10][11]=-=[12]-=-. Here our main goal is: * ÉCOLE DES MINES DE NANTES, 4 rue Alfred Kastler, BP 20722, 44307 Nantes Cedex 3, France. ** Work performed while at INRIA/IRISA, Campus de Beaulieu, 35042 Rennes Cedex, Fran... |

3 |
λ-calculus notation with nameless dummies: a tool for automatic formula manipulation, with application to Church Rosser theorem
- Brujin
- 1972
(Show Context)
Citation Context ...aluation of a variable i amounts to following i links to find the corresponding closure in the environment. The closure’s components become the current code and environment. * In de Bruijn’s notation =-=[7]-=-, a variable occurrence is represented by the number of lambdas between this occurrence and the lambda binding the variable. For example, the λ-term λx.x (λy.y x) is written in de Bruijn’s notation as... |

3 |
Décrire et comparer les mises en œuvre de langages fonctionnels
- Douence
- 1996
(Show Context)
Citation Context ...we present the Kmachine and some well-known variants in a common framework. This framework has been used to describe, prove, compare, classify and hybridize functional language implementations [9][10]=-=[11]-=-[12]. Here our main goal is: * ÉCOLE DES MINES DE NANTES, 4 rue Alfred Kastler, BP 20722, 44307 Nantes Cedex 3, France. ** Work performed while at INRIA/IRISA, Campus de Beaulieu, 35042 Rennes Cedex, ... |

2 |
Un interprète du lambda-calcul. Unpublished draft, available at ftp:// ftp.logique.jussieu.fr/pub/distrib/krivine/interprt.pdf
- Krivine
(Show Context)
Citation Context ....3.1 Two-level environments Accesses in the environment of the standard K-machine are linear time operations. We present here another environment-based abstraction A 2 (Figure 12) proposed by Krivine =-=[21]-=- that improves environment lookups. The transformation A 2 relies on two-level environments to deal with sequences of λ-abstractions. A 2 : Λ s → env → Λ e A 2 [M 1 ; M 2 ] ρ = dupl e ; A 2 [M 1 ] ρ ;... |

2 | Super-Closures
- Lang, Benaissa, et al.
- 1998
(Show Context)
Citation Context ...g reduction [4]); Leroy presents his Zinc abstract machine as a strict variant of the K-machine [24]; many others used it as a basis or framework for their work either practical or theoretical [8][16]=-=[23]-=-[31][32][34]. The presentations of the K-machine or its variants differ depending on the sources. The machine instructions may be de Bruijn’s λ-expressions or completely compiled code. Environments an... |