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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
每个人都有自己的地方
任何语法的无名表示的关键是它如何指示我们选择使用的变量,从而隐式地指示我们丢弃的变量。标准de Bruijn表示最大限度地延迟丢弃,直到项的叶子,其中一个是从范围内的变量中选择的,而牺牲了其他变量。因此,引入新的但未使用的变量需要遍历项。本文介绍了一种无名的“co-de-Bruijn”表示,它使相反的规范选择最小化地延迟丢弃,尽可能靠近根。这是一个有文化的议程:依赖类型使表达它成为一种实际的乐趣,并由强大的内在不变量驱动,确保范围被积极地削减到只支持每个子项,其中每个剩余变量都出现在某个地方。该构造是通用的,提供了一系列具有高阶元变量的语法,对于这些语法,适当的替换概念是遗传的。同时替换的实现利用严格的范围控制,避免了没有遍历的繁忙工作和移位项。令人惊讶的是,仅通过结构递归,它本身也是终止的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Intersection Types for Unboundedness Problems Natural Deduction and Normalization Proofs for the Intersection Type Discipline Intersection Subtyping with Constructors Formalization of Automated Trading Systems in a Concurrent Linear Framework Taking Linear Logic Apart
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1