paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Multi-stage Relational Programming

多阶段关系编程
PLDI 9(PLDI)2025匹配度 2/10 · 该论文属于逻辑/关系式编程与程序合成,讨论 miniKanren 的多阶段解释与含洞程序综合,与用户核心方向(LLM/Agent 与静态分析、AI 辅助形式化验证、浮点程序分析、贝叶斯程序分析)没有直接交集;仅程序合成和 PL 方法层面存在较弱边缘相关。引用 0 inbox
Michael Ballantyne, Rafaello Sanna, Jason Hemann, William E. Byrd, Nada Amin
crossref: 2026-09-10

AI 速览

一句话:将多阶段编程引入关系式编程,扩展 miniKanren 以分阶段解释含洞程序,并在综合任务中显著加速。

论文将多阶段编程从函数式编程迁移到关系式编程,提出控制分阶段与非确定性的新构造。方法是对关系解释器分阶段:被解释程序中未知表达式或值以洞表示,已知部分编译执行以消除解释开销,未知部分延迟到运行时解释。由此兼顾分阶段(把解释器变成编译器)与关系式解释(把函数变成关系、从草图综合)的优势。作者扩展 miniKanren,实现 Racket 与 miniKanren 子集的关系解释器及上下文无关文法识别器。在多个综合问题上,分阶段版本较未分阶段版本显著加速,并与手工调优的关系解释器做了指示性比较。

问题
关系式解释器灵活且适合综合,但解释开销大;在含大量已知结构的程序上,传统解释方式成为性能瓶颈。
方法
在 miniKanren 中引入分阶段构造,对关系解释器进行多阶段化:已知部分编译执行,含洞的未知部分留待运行时解释。
评估
实现面向 Racket/miniKanren 子集的关系解释器和 CFG 识别器,在多个综合问题上系统比较分阶段与未分阶段版本,并与手工调优解释器做指示性对比。
原文摘要(Abstract)

We transport multi-stage programming from functional to relational programming, with novel constructs to give programmers control over staging and non-determinism. We stage interpreters written as relations, in which the programs under interpretation can contain holes representing unknown expressions or values. By compiling the known parts without interpretive overhead and deferring interpretation to run time only for the unknown parts, we compound the benefits of staging (e.g., turning interpreters into compilers) and relational interpretation (e.g., turning functions into relations and synthesizing from sketches). We extend miniKanren with staging constructs and apply the resulting multi-stage language to relational interpreters for subsets of Racket and miniKanren as well as a relational recognizer for context-free grammars. We demonstrate significant performance gains across multiple synthesis problems, systematically comparing unstaged and staged computation, as well as indicatively comparing with an existing hand-tuned relational interpreter.

链接与引用

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

BibTeX
@article{paperbot3150,
  title = {Multi-stage Relational Programming},
  author = {Michael Ballantyne and Rafaello Sanna and Jason Hemann and William E. Byrd and Nada Amin},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729314}
}