paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Typed Multi-level Datalog IR and Its Compiler Framework

带类型的多级 Datalog 中间表示及其编译器框架
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 论文聚焦通用 Datalog 编译器框架与带类型多级 IR,属于逻辑/约束编程与编译方向;虽然 Datalog 常用于静态分析基础设施,但本文未涉及用户画像中的 LLM/Agent、浮点程序分析、贝叶斯程序分析或 AI 与 PL 的交叉。引用 6 inbox
David Klopp, Sebastian Erdweg, André Pacak
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出首个通用 Datalog 编译器框架,以可扩展的带类型多级 IR 支持任意前端、逐层优化与多种后端。

Datalog 系统众多,但各自方言、记法与优化策略不同,导致改进难以跨系统移植。本文提出首个通用 Datalog 编译器框架,支持任意前端语言并面向任意后端求解器。核心是带类型的多级 Datalog IR,可扩展且保证可执行性:前端将方言翻译到扩展 IR,再逐级降低到核心 Datalog 并在各层优化,最后交给不同求解器。作者形式化了该 IR 的类型系统,其具有双向、流敏感、双极和三值类型环境等特性,同时校验类型兼容并跟踪逻辑变量绑定。框架已实现,集成 4 个前端、3 个后端和 16 个 IR 扩展。

问题
Datalog 系统各自定制方言、记法与优化策略,导致系统间改进难以移植,缺乏统一的编译器基础设施。
方法
设计带类型的多级 Datalog IR,支持 IR 扩展并保证可执行性;通过渐进降低到核心 Datalog 并在各层优化,同时形式化其双向、流敏感、双极、使用三值类型环境的类型系统,以校验类型兼容并跟踪逻辑变量绑定。
评估
实现编译器框架并集成 4 个 Datalog 前端、3 个后端和 16 个 IR 扩展;同时形式化 IR 类型系统。
原文摘要(Abstract)

The resurgence of Datalog in the last two decades has led to a multitude of new Datalog systems. These systems explore novel ideas for improving Datalog’s programmability and performance, making important contributions to the field. Unfortunately, the individual systems progress at a much slower pace than the overall field, because improvements in one system are rarely ported to other systems. The reason for this rift is that each system provides its own Datalog dialect with specific notation, language features, and invariants, enabling specific optimization and execution strategies. This paper presents the first compiler framework for Datalog that can be used to support any Datalog frontend language and to target any Datalog backend. The centerpiece of our framework is a novel typed multi-level Datalog IR that supports IR extensions and guarantees executability. Existing Datalog systems can provide a compiler frontend that translates their Datalog dialect to the extended IR. The IR is then progressively lowered toward core Datalog, allowing optimizations at each level. At last, compiler backends can target different Datalog solvers. We have implemented the compiler framework and integrated 4 Datalog frontends and 3 Datalog backends, using 16 IR extensions. We also formalize the IR’s flexible type system, which is bidirectional, flow-sensitive, bipolar, and uses three-valued typing contexts. The type system simultaneously validates type compatibility and precisely tracks bindings of logic variables while permitting IR extensions.

链接与引用

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

BibTeX
@article{KloppEP24a,
  title = {A Typed Multi-level Datalog IR and Its Compiler Framework},
  author = {David Klopp and Sebastian Erdweg and André Pacak},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689767}
}