arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.14017cs.PL
收藏

让 Formulog 变快:对非传统 Datalog 求值的一种论证(扩展版)

Making Formulog Fast: An Argument for Unconventional Datalog Evaluation (Extended Version)

Aaron Bembenek, Michael Greenberg, Stephen Chong

AI总结:

本研究通过提出放弃半朴素求值的并发“急切求值”算法,大幅提升了 Formulog 的 Datalog 求值与 SMT 求解性能,证明其可作为基于 SMT 的静态分析现实平台。

摘要:

通过结合 Datalog、SMT 求解和函数式编程,语言 Formulog 提供了一种极具吸引力的特性组合,能够以自然、声明式的方式实现基于 SMT 的静态分析(例如,精化类型检查、符号执行)。同时,其定制 Datalog 求解器的性能可能成为将 Formulog 用于原型设计之外的阻碍——这是有志于解决大型问题实例的 Datalog 变体面临的普遍问题。在本研究中,我们加速了 Formulog 求值,并得出了令人惊讶的结果:虽然通过使用高性能 Datalog 的传统技术(例如,编译、专用数据结构)获得了 2.2 倍的加速,但巨大的收益来自于放弃现代高性能 Datalog 引擎的核心假设——半朴素 Datalog 求值。取而代之,我们开发了急切求值,这是一种并发 Datalog 求值算法,通过深度优先遍历顺序探索逻辑推理空间。在实践中,急切求值促成了 Formulog 的 SMT 工作负载向外部 SMT 求解器的有利分配,并改善了 SMT 求解时间:我们在 Formulog 解释器和 Soufflé 代码生成器中扩展的急切求值,相较于现成 Soufflé 生成的优化代码,在 SMT 密集型 Formulog 基准测试上分别实现了平均 5.2 倍和 7.6 倍的加速。使用编译和急切求值,精化类型检查、自底向上指针分析和符号执行的 Formulog 实现,在 23 个基准测试中有 20 个超越了先前发表的、用 F#、Java 和 C++ 编写的手工调优分析,提供了强有力的证据,证明 Formulog 可以成为基于 SMT 的静态分析现实平台的基础。此外,我们的经验为传统观念增添了细微差别,即半朴素求值是静态分析工作负载的“一刀切”最佳 Datalog 求值算法。

英文摘要:

By combining 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 surprising results: while 2.2x speedups are 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 its place, 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.2x and 7.6x speedups, respectively, over the optimized code generated by off-the-shelf Soufflé on SMT-heavy Formulog benchmarks. Using compilation and eager evaluation, 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 semi-naive evaluation is the one-size-fits-all best Datalog evaluation algorithm for static analysis workloads.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑