Author:
POUILLARD NICOLAS,POTTIER FRANÇOIS
Abstract
AbstractAtoms 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 inAgda. 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 inAgda.
Publisher
Cambridge University Press (CUP)
Cited by
8 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Implementing a category-theoretic framework for typed abstract syntax;Proceedings of the 11th ACM SIGPLAN International Conference on Certified Programs and Proofs;2022-01-11
2. The design and implementation of the wolfram language compiler;Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization;2020-02-21
3. Visitors unchained;Proceedings of the ACM on Programming Languages;2017-08-29
4. Formalising the SECD machine with nominal Isabelle;Proceedings of the 30th Annual ACM Symposium on Applied Computing;2015-04-13
5. Romeo;ACM SIGPLAN Notices;2014-11-26