## A fresh look at programming with names and binders (2010)

### Cached

### Download Links

Citations: | 7 - 2 self |

### BibTeX

@MISC{Pouillard10afresh,

author = {Nicolas Pouillard and François Pottier},

title = { A fresh look at programming with names and binders},

year = {2010}

}

### OpenURL

### Abstract

A wide range of computer programs, including compilers and theorem provers, manipulate data structures that involve names and binding. However, the design of programming idioms which allow performing these manipulations in a safe and natural style has, to a large extent, remained elusive. In this paper, we present a novel approach to the problem. Our proposal can be viewed either as a programming language design or as a library: in fact, it is currently implemented within Agda. It provides a safe and expressive means of programming with names and binders. It is abstract enough to support multiple concrete implementations: we present one in nominal style and one in de Bruijn style. We use logical relations to prove that “well-typed programs do not mix names with different scope”. We exhibit an adequate encoding of Pitts-style nominal terms into our system.

### Citations

144 | Mechanized metatheory for the masses: the POPLMARK challenge
- Aydemir, Bohannon, et al.
(Show Context)
Citation Context ...lated work The difficulty of programming with, or reasoning about, names and binders has been known for a long time. It has recently received a lot of attention, due in part to the PoplMark challenge =-=[2]-=-. Despite this attention, the problem is still largely unsolved: according to Guillemette and Monnier, for instance, “none of the existing representations of bindings is suitable” [7]. In the followin... |

81 | Freshml: Programming with binders made simple
- Shinwell, Pitts, et al.
- 2003
(Show Context)
Citation Context ...intended: the identity of the bound name cannot be observed. This property is required for a language that claims to permit only safe manipulations of names and binders. As Shinwell et al. have shown =-=[14]-=-, it is a weaker property than one might think. Indeed, FreshML satisfies it, even though it is an impure language: its semantics involves a global fresh name generator, and its type discipline allows... |

79 | B.: Monadic presentations of lambda terms using generalized inductive types
- Altenkirch, Reus
- 1999
(Show Context)
Citation Context ... now well-known that type-theoretic machinery (such as nested algebraic data types, generalized algebraic data types, or dependent types) can be used to ensure sound manipulation of de Bruijn indices =-=[1,3]-=-. In fact, dependent types can be used to encode not only the lexical scoping discipline, but also the type discipline of an object language: see, for instance, Chen and Xi [4] and Chlipala [5]. Howev... |

77 | Applicative programming with effects - McBride, Paterson |

76 | Parametric polymorphism and operational equivalence
- Pitts
(Show Context)
Citation Context ...language of our system supports the construction of logical relations in a standard manner. For instance, the host language may be System F or System F ω , where logical relations are well-understood =-=[6]-=-. At every type, two relations are defined: a relation between values and a relation between terms. We write v (τ) w when the values v and w are related at type τ; we write t (τ) u when the terms t an... |

71 | R.: De Bruijn notation as a nested datatype
- Bird, Paterson
- 1999
(Show Context)
Citation Context ...-theoretic machinery (such as nested algebraic data types, generalized algebraic data 13Pouillard and Pottier types, or dependent types) can be used to ensure sound manipulation of de Bruijn indices =-=[1,2]-=-. However, de Bruijn indices are, by nature, very low-level: it is desirable to build more abstract representations of top of them. For instance, Donnelly and Xi [3] define an algebraic data type of t... |

49 |
A type-theoretic foundation for programming with higher-order abstract syntax and firstclass substitutions
- Pientka
- 2008
(Show Context)
Citation Context ... is made type-correct by planning ahead and making this function polymorphic with respect to an arbitrary world extension. Elphin, Delphin, Beluga Elphin [13], its successor Delphin [8,9], and Beluga =-=[5]-=- are closely related to one another in several ways. They separate the data and computation layers, which implies that they do not support firstclass functions. At the data level, they provide substit... |

48 | Alpha-structural recursion and induction
- Pitts
(Show Context)
Citation Context ...is impossible for an export ↼ operation to succeed in one run and fail in the other. 4.3.2 Adequacy of an encoding of nominal terms It is straightforward to encode nominal terms in the style of Pitts =-=[7]-=- into our system. We now use our logical relations to prove that this encoding is adequate. We briefly recall a few definitions about nominal terms. The nominal types are τ ::= atom | τ × τ | τ + τ | ... |

40 | A certified type-preserving compiler from lambda calculus to assembly language - Chlipala |

27 | Practical programming with higher-order encodings and dependent types
- Poswolsky, Schürmann
- 2008
(Show Context)
Citation Context ...to a larger world, is made type-correct by planning ahead and making this function polymorphic with respect to an arbitrary world extension. Elphin, Delphin, Beluga Elphin [13], its successor Delphin =-=[8,9]-=-, and Beluga [5] are closely related to one another in several ways. They separate the data and computation layers, which implies that they do not support firstclass functions. At the data level, they... |

25 | The ∇-Calculus. Functional Programming with Higher-Order Encodings - Schürmann, Poswolsky, et al. - 2005 |

24 | Static name control for FreshML
- Pottier
- 2006
(Show Context)
Citation Context ...ure FreshML FreshML [14] extends ML with primitive types for names (known as atoms) and name abstractions. Unfortunately, FreshML is impure: name generation is an observable side effect. Pure FreshML =-=[10]-=- imposes additional proof obligations, which ensure that freshly created atoms do not escape their scope, and correspond to Pitts’ freshness condition for binders [7]. The present paper can be viewed ... |

17 | A universe of binding and computation
- Licata, Harper
- 2009
(Show Context)
Citation Context ...me abstractions. The extended version of this paper [12] also shows how to express a normalisation by evaluation algorithm in our system. This algorithm was used as a benchmark by several researchers =-=[14,7,4]-=-. The challenge lies in the way the algorithm mixes computational functions, name abstractions, and fresh name generation. Our system is able to express this algorithm in a nice way. In particular, se... |

14 | Syntax For Free: Representing Syntax with Binding using Parametricity - Atkey - 2009 |

13 | A type-preserving compiler in Haskell - Guillemette, Monnier - 2008 |

12 | Unembedding domain-specific languages - Atkey, Lindley, et al. - 2009 |

11 | System description: Delphin – a functional programming language for deductive systems
- Poswolsky, Schürmann
- 2009
(Show Context)
Citation Context ...to a larger world, is made type-correct by planning ahead and making this function polymorphic with respect to an arbitrary world extension. Elphin, Delphin, Beluga Elphin [13], its successor Delphin =-=[8,9]-=-, and Beluga [5] are closely related to one another in several ways. They separate the data and computation layers, which implies that they do not support firstclass functions. At the data level, they... |

11 | Implementing typeful program transformations - Chen, Xi - 2003 |

6 | Combining higher-order abstract syntax with firstorder abstract syntax
- Donnelly, Xi
- 2005
(Show Context)
Citation Context ...anipulation of de Bruijn indices [1,2]. However, de Bruijn indices are, by nature, very low-level: it is desirable to build more abstract representations of top of them. For instance, Donnelly and Xi =-=[3]-=- define an algebraic data type of terms that is based on well-scoped de Bruijn indices, but is indexed with a higher-order abstract syntax representation of terms. Licata and Harper’s system [4] is im... |

6 | Nominal system T - Pitts - 2010 |