paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Making Formulog Fast: An Argument for Unconventional Datalog Evaluation

让 Formulog 变快:为非常规 Datalog 求值辩护
OOPSLA 8(OOPSLA2)2024匹配度 4/10 · 论文聚焦 Datalog/SMT 静态分析引擎的性能优化,属于程序分析与形式化方法基础设施,理论上可为静态分析相关研究提供工具支撑;但它不涉及 LLM/Agent 与静态分析的交叉,也不涉及浮点程序分析或贝叶斯程序分析,与用户当前核心研究方向仅有较弱的间接关联。引用 5 inbox
Aaron Bembenek, Michael Greenberg, Stephen Chong
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:提出 eager evaluation,替代半朴素 Datalog 求值,大幅加速 Formulog 的 SMT 静态分析。

Formulog 结合 Datalog、SMT 与函数式编程,便于声明式实现精化类型检查、符号执行等 SMT 静态分析,但定制 Datalog 求解器性能阻碍其超越原型。本文发现常规高性能 Datalog 技术(编译、专用数据结构)仅加速约 2.2×;核心贡献是放弃半朴素求值,提出 eager evaluation:按深度优先遍历逻辑推理空间的并发 Datalog 求值算法,更好分发 SMT 工作负载并改善求解时间。在 Formulog 解释器和 Soufflé 代码生成器中实现后,SMT 密集型基准相较优化 Soufflé 平均加速 5.2× 和 7.6×。结合编译与 eager evaluation,精化类型检查、指针分析和符号执行在 23 个基准中的 20 个上超过已发表 F♯、Java、C++ 手写分析,表明 Formulog 可成为现实 SMT 静态分析平台,并挑战半朴素求值普遍最优的传统观点。

问题
Formulog 的定制 Datalog 求解器性能不足,限制其在原型之外用于大规模 SMT 静态分析。
方法
在使用编译与专用数据结构等常规优化之外,提出 eager evaluation——按深度优先遍历逻辑推理空间的并发 Datalog 求值算法,替代半朴素求值,并将其扩展到 Formulog 解释器与 Soufflé 代码生成器。
评估
在 SMT 密集型 Formulog 基准上测量相对优化 Soufflé 的加速比,并用精化类型检查、自底向上指针分析和符号执行在 23 个基准上与手写 F♯、Java、C++ 分析进行对比。
原文摘要(Abstract)

With its combination of Datalog, SMT solving, and functional programming, the language Formulog provides an appealing mix of features for implementing SMT-based static analyses (e.g., refinement type checking, symbolic execution) in a natural, declarative way. At the same time, the performance of its custom Datalog solver can be an impediment to using Formulog beyond prototyping—a common problem for Datalog variants that aspire to solve large problem instances. In this work we speed up Formulog evaluation, with some surprising results: while 2.2× speedups can be obtained by using the conventional techniques for high-performance Datalog (e.g., compilation, specialized data structures), the big wins come by abandoning the central assumption in modern performant Datalog engines, semi-naive Datalog evaluation. In the place of semi-naive evaluation, we develop eager evaluation, a concurrent Datalog evaluation algorithm that explores the logical inference space via a depth-first traversal order. In practice, eager evaluation leads to an advantageous distribution of Formulog’s SMT workload to external SMT solvers and improved SMT solving times: our eager evaluation extensions to the Formulog interpreter and Soufflé’s code generator achieve mean 5.2× and 7.6× speedups, respectively, over the optimized code generated by off-the-shelf Soufflé on SMT-heavy Formulog benchmarks. All in all, using compilation and eager evaluation (as appropriate), Formulog implementations of refinement type checking, bottom-up pointer analysis, and symbolic execution achieve speedups on 20 out of 23 benchmarks over previously published, hand-tuned analyses written in F♯, Java, and C++, providing strong evidence that Formulog can be the basis of a realistic platform for SMT-based static analysis. Moreover, our experience adds nuance to the conventional wisdom that traditional semi-naive evaluation is the one-size-fits-all best Datalog evaluation algorithm for static analysis workloads.

链接与引用

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

BibTeX
@article{Bembenek0C24,
  title = {Making Formulog Fast: An Argument for Unconventional Datalog Evaluation},
  author = {Aaron Bembenek and Michael Greenberg and Stephen Chong},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689754}
}