论文标题

具有约束力的语法的类型和范围安全的宇宙:它们的语义和证明

A Type and Scope Safe Universe of Syntaxes with Binding: Their Semantics and Proofs

论文作者

Allais, Guillaume, Atkey, Robert, Chapman, James, McBride, Conor, McKinna, James

论文摘要

几乎每个编程语言的语法都包括粘合剂和相应的绑定发生的概念,以及随附的$α$等效性,避免捕获的替换,键入上下文,运行时环境等的概念。过去,实施和推理编程语言需要仔细处理以维护界变量的正确行为。现代编程语言包括能够以类型表达范围安全的约束的功能。然而,程序员仍然被迫再次编写相同的样板,以进行示波器安全操作的每个新实现(例如,重命名,替换,删除,打印等),然后再次进行正确的证明。 我们提出了具有绑定的语法的表现力宇宙,并通过通用编程一劳永逸地展示了如何(1)实施范围安全遍历; (2)如何通过通用证明来得出这些遍历的性质。我们的宇宙描述,通用的遍历和证明以及我们的示例都在AGDA中正式化,并且可以在随附的材料中提供,网址为https://github.com/gallais/generic-syntax。

Almost every programming language's syntax includes a notion of binder and corresponding bound occurrences, along with the accompanying notions of $α$-equivalence, capture-avoiding substitution, typing contexts, runtime environments, and so on. In the past, implementing and reasoning about programming languages required careful handling to maintain the correct behaviour of bound variables. Modern programming languages include features that enable constraints like scope safety to be expressed in types. Nevertheless, the programmer is still forced to write the same boilerplate over again for each new implementation of a scope safe operation (e.g., renaming, substitution, desugaring, printing, etc.), and then again for correctness proofs. We present an expressive universe of syntaxes with binding and demonstrate how to (1) implement scope safe traversals once and for all by generic programming; and (2) how to derive properties of these traversals by generic proving. Our universe description, generic traversals and proofs, and our examples have all been formalised in Agda and are available in the accompanying material available online at https://github.com/gallais/generic-syntax.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源