A Type and Scope Safe Universe of Syntaxes with Binding: Their Semantics and Proofs

Guillaume Allais, Robert Atkey, James Chapman, Conor McBride, James McKinna
1/29/2020
cs.PL

Official code: gallais/generic-syntax (78 stars, Agda, GPL-3.0, last commit 2022-03-05).

Abstract

Almost every programming language's syntax includes a notion of binder and corresponding bound occurrences, along with the accompanying notions of $α$-equivalence, capture-avoiding substitution, typing contexts, runtime environments, and so on. In the past, implementing and reasoning about programming languages required careful handling to maintain the correct behaviour of bound variables.

Show full abstract

Modern programming languages include features that enable constraints like scope safety to be expressed in types. Nevertheless, the programmer is still forced to write the same boilerplate over again for each new implementation of a scope safe operation (e.g., renaming, substitution, desugaring, printing, etc.), and then again for correctness proofs. We present an expressive universe of syntaxes with binding and demonstrate how to (1) implement scope safe traversals once and for all by generic programming; and (2) how to derive properties of these traversals by generic proving. Our universe description, generic traversals and proofs, and our examples have all been formalised in Agda and are available in the accompanying material available online at https://github.com/gallais/generic-syntax.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

A Scope-and-Type Safe Universe of Syntaxes with Binding, Their Semantics and Proofs

7810Agda, HaskellMar 31, 20174 years agoGPL-3.0
agdageneric-programmingproofsemantic

Similar Papers

Cite this paper

@article{allais2020type,
  title  = {A Type and Scope Safe Universe of Syntaxes with Binding: Their Semantics and Proofs},
  author = {Guillaume Allais and Robert Atkey and James Chapman and Conor McBride and James McKinna},
  year   = {2020},
  eprint = {2001.11001},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2001.11001}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2001.11001.svg)](https://codeofpaper.com/paper/2001.11001)

Discussion