一句话:用代数自由扩张统一刻画部分静态数据结构,并据此构建常见代数结构的库。
部分静态数据结构通过混合静态与动态信息改善绑定时间,但常缺乏统一框架,难以充分利用各操作对应的等式。本文提出一种基础视角:将部分静态数据结构视为合适等式理论下代数的自由扩张,即代数与自由代数在代数同态范畴中的余积。通过预计算这些自由扩张,作者构造了一个高层库,为常见代数结构提供部分静态数据表示。该库在字符串与列表操作、线性代数、数值化简等文献用例上得到展示,说明该方法能系统化、可复用地实现部分静态优化。
Partially-static data structures are a well-known technique for improving binding times. However, they are often defined in an ad-hoc manner, without a unifying framework to ensure full use of the equations associated with each operation. We present a foundational view of partially-static data structures as free extensions of algebras for suitable equational theories, i.e. the coproduct of an algebra and a free algebra in the category of algebras and their homomorphisms. By precalculating these free extensions, we construct a high-level library of partially-static data representations for common algebraic structures. We demonstrate our library with common use-cases from the literature: string and list manipulation, linear algebra, and numerical simplification.
@article{paperbot288,
title = {Partially-static data as free extension of algebras},
author = {Jeremy Yallop and Tamara von Glehn and Ohad Kammar},
journal = {Proceedings of the ACM on Programming Languages},
volume = {2},
number = {ICFP},
year = {2018},
doi = {10.1145/3236795}
}