paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Iterating on multiple collections in synchrony

同步迭代多个集合
JFP vol.322022匹配度 2/10 · 该论文属于编程语言设计与集合迭代/数据库连接优化,关注推导式语法和同步迭代的抽象,与用户画像中的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析均无直接关联。引用 4 inbox
STEFANO PERNA, VAL TANNEN, LIMSOON WONG
crossref: 2026-09-10

AI 速览

一句话:提出 Synchrony 迭代抽象,使多有序集合的同步迭代和通用数据库连接可用推导式表达。

现代语言常提供推导式(comprehension)语法以提升集合操作可读性,但其通常对应嵌套循环,难以表达多个有序集合的高效同步迭代,如低选择率数据库连接的线性时间算法。本文提出 Synchrony fold 刻画同步迭代:核心是关联两集合序关系的单调 isBefore 谓词,以及识别匹配对的 antimonotonic canSee 谓词。限制 Synchrony fold 使其外延表达力等同于推导式,得到 Synchrony generator;它仍保留足够内涵表达力以高效同步迭代有序集合。作者证明其是数据库 merge join 的自然推广,并扩展至更一般的连接。最后导出 Synchrony iterator,其表达力与 generator 相同,但更契合推导式,使此类算法可自然用推导式表达。

问题
推导式语法一般对应嵌套循环,无法简单表达多个有序集合上的高效同步迭代,例如低选择率数据库连接的线性时间算法。
方法
提出 Synchrony fold,以单调 isBefore 和 antimonotonic canSee 谓词刻画同步迭代;通过限制得到 Synchrony generator,并由此导出 Synchrony iterator。
评估
以形式化定义与证明为主:证明 Synchrony generator 是 merge join 的自然推广,可扩展至更一般的数据库连接,并比较其外延/内涵表达力及与推导式的契合度。
原文摘要(Abstract)

Abstract Modern programming languages typically provide some form of comprehension syntax which renders programs manipulating collection types more readable and understandable. However, comprehension syntax corresponds to nested loops in general. There is no simple way of using it to express efficient general synchronized iterations on multiple ordered collections, such as linear-time algorithms for low-selectivity database joins. Synchrony fold is proposed here as a novel characterization of synchronized iteration. Central to this characterization is a monotonic isBefore predicate for relating the orderings on the two collections being iterated on and an antimonotonic canSee predicate for identifying matching pairs in the two collections to synchronize and act on. A restriction is then placed on Synchrony fold, cutting its extensional expressive power to match that of comprehension syntax, giving us Synchrony generator . Synchrony generator retains sufficient intensional expressive power for expressing efficient synchronized iteration on ordered collections. In particular, it is proved to be a natural generalization of the database merge join algorithm, extending the latter to more general database joins. Finally, Synchrony iterator is derived from Synchrony generator as a novel form of iterator. While Synchrony iterator has the same extensional and intensional expressive power as Synchrony generator, the former is better dovetailed with comprehension syntax. Thereby, algorithms requiring synchronized iterations on multiple ordered collections, including those for efficient general database joins, become expressible naturally in comprehension syntax.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1628,
  title = {Iterating on multiple collections in synchrony},
  author = {STEFANO PERNA and VAL TANNEN and LIMSOON WONG},
  journal = {Journal of Functional Programming},
  volume = {32},
  year = {2022},
  doi = {10.1017/s0956796822000041}
}