Everybody's got to be somewhere
McBride, Conor (2018) Everybody's got to be somewhere. Electronic Proceedings in Theoretical Computer Science, 275. pp. 53-69. ISSN 2075-2180 (https://doi.org/10.4204/EPTCS.275.6)
Preview |
Text.
Filename: McBride_EPTCS_2018_Everybodys_got_to_be_somewhere.pdf
Final Published Version License: Download (216kB)| Preview |
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.
ORCID iDs
McBride, Conor ORCID: https://orcid.org/0000-0003-1487-0886;-
-
Item type: Article ID code: 65011 Dates: DateEvent10 July 2018Published17 May 2018AcceptedSubjects: Science > Mathematics > Electronic computers. Computer science Department: Faculty of Science > Computer and Information Sciences Depositing user: Pure Administrator Date deposited: 02 Aug 2018 14:20 Last modified: 17 Nov 2024 01:14 Related URLs: URI: https://strathprints.strath.ac.uk/id/eprint/65011