每个人都要去某个地方
Everybody's Got To Be Somewhere
摘要:
语法的任何无名表示的关键在于它如何指示我们选择使用的变量,从而隐含地指示我们丢弃的变量。标准的de Bruijn表示最大限度地延迟丢弃,直到从作用域中的变量中选择一个以牺牲其余变量为代价的项的叶子。因此,引入新的但未使用的变量需要术语遍历。本文介绍了一个无名的“co-de-Bruijn”表示,使相反的典型选择,延迟丢弃最小,尽可能接近根。这是识字的阿格达:依赖类型使表达和被强大的内在不变量驱动成为一种实际的乐趣,这些内在不变量确保范围被积极地削减到仅支持每个子项,其中每个剩余的变量都出现在某个地方。构造是通用的,提供了一个具有高阶元变量的语法域,对于高阶元变量,适当的替换概念是遗传的。同时替换的实现利用了严格的范围控制,以避免在没有遍历的情况下的繁忙工作和移位项。令人惊讶的是,它本身也是终止的,仅仅通过结构递归。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。