arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2509.13261cs.PL
收藏

Rebound:高效、富有表达力且作用域良好的绑定

Rebound: Efficient, Expressive, and Well-Scoped Binding

University of Pennsylvania(宾夕法尼亚大学)

Noé De Santo, Stephanie Weirich

AI总结:

本文提出Rebound库,通过一等环境静态跟踪作用域,在Haskell中自动定义替换和alpha等价等绑定操作,兼具表达力与高效性。

摘要:

我们介绍了Rebound库,它在Haskell中支持作用域良好的项表示,并自动定义替换、alpha等价以及其他处理绑定结构的操作。我们设计的关键思想是使用一等环境(first-class environments),将变量映射到某个新作用域中的表达式。通过静态跟踪作用域,该库的用户能够确信他们已正确维护了因使用de Bruijn索引而产生的微妙不变量。在幕后,Rebound利用环境来优化替换的应用,同时在需要时提供对这些数据结构的显式访问。我们通过使用该库来实现一系列具有复杂绑定用法和多种使用此抽象语法的不同操作的语言特性,证明了该库的表达能力。我们的示例包括pi-forall,这是一个依赖类型编程语言类型检查器的教程实现。最后,我们对Rebound进行了基准测试以了解其性能特征,发现它比竞争库生成了更快的代码。

英文摘要:

We introduce the Rebound library that supports well-scoped term representations in Haskell and automates the definition of substitution, alpha-equivalence, and other operations that work with binding structures. The key idea of our design is the use of first-class environments that map variables to expressions in some new scope. By statically tracking scopes, users of this library gain confidence that they have correctly maintained the subtle invariants that stem from using de Bruijn indices. Behind the scenes, Rebound uses environments to optimize the application of substitutions, while providing explicit access to these data structures when desired. We demonstrate that this library is expressive by using it to implement a wide range of language features with sophisticated uses of binding and several different operations that use this abstract syntax. Our examples include pi-forall, a tutorial implementation of a type checker for a dependently-typed programming language. Finally, we benchmark Rebound to understand its performance characteristics and find that it produces faster code than competing libraries.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑