Hostname: page-component-77f85d65b8-2tv5m Total loading time: 0 Render date: 2026-04-18T00:08:43.256Z Has data issue: false hasContentIssue false

A unified treatment of syntax with binders

Published online by Cambridge University Press:  15 August 2012

NICOLAS POUILLARD
Affiliation:
INRIA, Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay, Cedex, France (e-mail: np@nicolaspouillard.fr, francois.pottier@inria.fr)
FRANÇOIS POTTIER
Affiliation:
INRIA, Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay, Cedex, France (e-mail: np@nicolaspouillard.fr, francois.pottier@inria.fr)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

Atoms and de Bruijn indices are two well-known representation techniques for data structures that involve names and binders. However, using either technique, it is all too easy to make a programming error that causes one name to be used where another was intended. We propose an abstract interface to names and binders that rules out many of these errors. This interface is implemented as a library in Agda. It allows defining and manipulating term representations in nominal style and in de Bruijn style. The programmer is not forced to choose between these styles: on the contrary, the library allows using both styles in the same program, if desired. Whereas indexing the types of names and terms with a natural number is a well-known technique to better control the use of de Bruijn indices, we index types with worlds. Worlds are at the same time more precise and more abstract than natural numbers. Via logical relations and parametricity, we are able to demonstrate in what sense our library is safe, and to obtain theorems for free about world-polymorphic functions. For instance, we prove that a world-polymorphic term transformation function must commute with any renaming of the free variables. The proof is entirely carried out in Agda.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2012
Submit a response

Discussions

No Discussions have been published for this article.