Everybody's Got To Be Somewhere

CoRR Pub Date : 2018-07-10 DOI:10.4204/EPTCS.275.6
Conor McBride
{"title":"Everybody's Got To Be Somewhere","authors":"Conor McBride","doi":"10.4204/EPTCS.275.6","DOIUrl":null,"url":null,"abstract":"The key to any nameless representation of syntax is how it indicates the variables we choose to use and thus, implicitly, those we discard. Standard de Bruijn representations delay discarding maximally till the leaves of terms where one is chosen from the variables in scope at the expense of the rest. Consequently, introducing new but unused variables requires term traversal. This paper introduces a nameless 'co-de-Bruijn' representation which makes the opposite canonical choice, delaying discarding minimally, as near as possible to the root. It is literate Agda: dependent types make it a practical joy to express and be driven by strong intrinsic invariants which ensure that scope is aggressively whittled down to just the support of each subterm, in which every remaining variable occurs somewhere. The construction is generic, delivering a universe of syntaxes with higher-order metavariables, for which the appropriate notion of substitution is hereditary. The implementation of simultaneous substitution exploits tight scope control to avoid busywork and shift terms without traversal. Surprisingly, it is also intrinsically terminating, by structural recursion alone.","PeriodicalId":10720,"journal":{"name":"CoRR","volume":"9 1","pages":"53-69"},"PeriodicalIF":0.0000,"publicationDate":"2018-07-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"13","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"CoRR","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4204/EPTCS.275.6","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 13

Abstract

The key to any nameless representation of syntax is how it indicates the variables we choose to use and thus, implicitly, those we discard. Standard de Bruijn representations delay discarding maximally till the leaves of terms where one is chosen from the variables in scope at the expense of the rest. Consequently, introducing new but unused variables requires term traversal. This paper introduces a nameless 'co-de-Bruijn' representation which makes the opposite canonical choice, delaying discarding minimally, as near as possible to the root. It is literate Agda: dependent types make it a practical joy to express and be driven by strong intrinsic invariants which ensure that scope is aggressively whittled down to just the support of each subterm, in which every remaining variable occurs somewhere. The construction is generic, delivering a universe of syntaxes with higher-order metavariables, for which the appropriate notion of substitution is hereditary. The implementation of simultaneous substitution exploits tight scope control to avoid busywork and shift terms without traversal. Surprisingly, it is also intrinsically terminating, by structural recursion alone.
每个人都有自己的地方
任何语法的无名表示的关键是它如何指示我们选择使用的变量,从而隐式地指示我们丢弃的变量。标准de Bruijn表示最大限度地延迟丢弃,直到项的叶子,其中一个是从范围内的变量中选择的,而牺牲了其他变量。因此,引入新的但未使用的变量需要遍历项。本文介绍了一种无名的“co-de-Bruijn”表示,它使相反的规范选择最小化地延迟丢弃,尽可能靠近根。这是一个有文化的议程:依赖类型使表达它成为一种实际的乐趣,并由强大的内在不变量驱动,确保范围被积极地削减到只支持每个子项,其中每个剩余变量都出现在某个地方。该构造是通用的,提供了一系列具有高阶元变量的语法,对于这些语法,适当的替换概念是遗传的。同时替换的实现利用严格的范围控制,避免了没有遍历的繁忙工作和移位项。令人惊讶的是,仅通过结构递归,它本身也是终止的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信