Flan: An Expressive and Efficient Datalog Compiler for Program Analysis

被引:1
作者
Abeysinghe, Supun [1 ]
Xhebraj, Anxhelo [1 ]
Rompf, Tiark [1 ]
机构
[1] Purdue Univ, Dept Comp Sci, 610 Purdue Mall, W Lafayette, IN 47907 USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / POPL期
关键词
Datalog; Logic Programming; Generative Programming; Program Analysis; QUERY PLANS;
D O I
10.1145/3632928
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Datalog has gained prominence in program analysis due to its expressiveness and ease of use. Its generic fixpoint resolution algorithm over relational domains simplifies the expression of many complex analyses. The performance and scalability issues of early Datalog approaches have been addressed by tools such as Souffle through specialized code generation. Still, while pure Datalog is expressive enough to support a wide range of analyses, there is a growing need for extensions to accommodate increasingly complex analyses. This has led to the development of various extensions, such as Flix, Datafun, and Formulog, which enhance Datalog with features like arbitrary lattices and SMT constraints. Most of these extensions recognize the need for full interoperability between Datalog and a full-fledged programming language, a functionality that high-performance systems like Souffle lack. Speciflcally, in most cases, they construct languages from scratch with first-class Datalog support, allowing greater flexibility. However, this flexibility often comes at the cost of performance due to the conflicting requirements of prioritizing modularity and abstraction over efficiency. Consequently, achieving both flexibility and compilation to highly-performant specialized code poses a significant challenge. In this work, we reconcile the competing demands of expressiveness and performance with Flan, a Datalog compiler fully embedded in Scala that leverages multi-stage programming to generate specialized code for enhanced performance. Our approach combines the flexibility of Flix with Souffle's performance, offering seamless integration with the host language that enables the addition of powerful extensions while generating specialized code for the entire computation. Flan's simple operator interface allows the addition of an extensive set of features, including arbitrary aggregates, user-defined functions, and lattices, with multiple execution strategies such as binary and multi-way joins, supported by difierent indexing structures like specialized trees and hash tables, with minimal effort. We evaluate our system on a variety of benchmarks and compare it to established Datalog engines. Our results demonstrate competitive performance and speedups in the range of 1.4x to 12.5x compared to state-of-the-art systems for workloads of practical importance.
引用
收藏
页码:2577 / 2609
页数:33
相关论文
共 50 条
  • [31] Experimental program analysis
    Ruthruff, Joseph R.
    Elbaum, Sebastian
    Rothermel, Gregg
    INFORMATION AND SOFTWARE TECHNOLOGY, 2010, 52 (04) : 359 - 379
  • [32] Program Analysis for Adaptive Data Analysis
    Liu, Jiawen
    Qu, Weihao
    Gaboardi, Marco
    Garg, Deepak
    Ullman, Jonathan
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (PLDI):
  • [33] Generative Program Analysis and Beyond: The Power of Domain-Specific Languages
    Steffen, Bernhard
    Murtovi, Alnis
    VERIFICATION, MODEL CHECKING, AND ABSTRACT INTERPRETATION, VMCAI 2021, 2021, 12597 : 29 - 51
  • [34] An extensible metamodel for program analysis
    Strein, Dennis
    Lincke, Rudiger
    Lundberg, Jonas
    Lowe, Welf
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2007, 33 (09) : 592 - 607
  • [35] DG: A program analysis library
    Chalupa, Marek
    SOFTWARE IMPACTS, 2020, 6
  • [36] Monotonicity and the Precision of Program Analysis
    Campion, Marco
    Preda, Mila Dalla
    Giacobazzi, Roberto
    Urban, Caterina
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (POPL): : 1629 - 1662
  • [37] Conditional Quantitative Program Analysis
    Gerrard, Mitchell
    Borges, Mateus
    Dwyer, Matthew B.
    Filieri, Antonio
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (04) : 1212 - 1227
  • [38] Newtonian Program Analysis - An Introduction
    Esparza, Javier
    Luttenberger, Michael
    LOGICS AND LANGUAGES FOR RELIABILITY AND SECURITY, 2010, 25 : 31 - 72
  • [39] Recent Progress in Program Analysis
    Zhang J.
    Zhang C.
    Xuan J.-F.
    Xiong Y.-F.
    Wang Q.-X.
    Liang B.
    Li L.
    Dou W.-S.
    Chen Z.-B.
    Chen L.-Q.
    Cai Y.
    Ruan Jian Xue Bao/Journal of Software, 2019, 30 (01): : 80 - 109
  • [40] Towards Efficient Model Comparison using Automated Program Rewriting
    Ali, Qurat ul Ain
    Kolovos, Dimitris
    Barmpis, Konstantinos
    PROCEEDINGS OF THE 16TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON SOFTWARE LANGUAGE ENGINEERING, SLE 2023, 2023, : 181 - 193