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

01/29/2020
by   Guillaume Allais, et al.
0

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. 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/31/2018

Generic Description of Well-Scoped, Well-Typed Syntaxes

We adapt the technique of type-generic programming via descriptions poin...
research
07/06/2020

A Term-Rewriting Semantics for Imperative Style Programming

Term rewriting systems have a simple syntax and semantics and facilitate...
research
10/23/2017

Locally Nameless Permutation Types

We define "Locally Nameless Permutation Types", which fuse permutation t...
research
07/11/2018

Everybody's Got To Be Somewhere

The key to any nameless representation of syntax is how it indicates the...
research
04/27/2023

Traced Types for Safe Strategic Rewriting

Strategy languages enable programmers to compose rewrite rules into stra...
research
11/03/2022

Revisiting Language Support for Generic Programming: When Genericity Is a Core Design Goal

Context: Generic programming, as defined by Stepanov, is a methodology f...
research
09/04/2019

Explaining SDN Failures via Axiomatisations

This work introduces a concept of explanations with respect to the viola...

Please sign up or login with your details

Forgot password? Click here to reset