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 条
  • [41] PACIab: A Program Analysis Collaboratory
    Brunner, Rebecca
    Dyer, Robert
    Paquin, Maria
    Sherman, Elena
    PROCEEDINGS OF THE 28TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '20), 2020, : 1616 - 1620
  • [42] Conditional Quantitative Program Analysis
    Gerrard, Mitchell
    Borges, Mateus
    Dwyer, Matthew B.
    Filieri, Antonio
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (04) : 1212 - 1227
  • [43] 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
  • [44] A METHOD FOR GENERATING PROGRAM SPECIFICATION FROM SOURCE PROGRAM - ANALYSIS BY TRANSFORMING PROGRAM STRUCTURE AND ARGUMENT MANIPULATION
    NAGAI, T
    IMANAKA, T
    TOYODA, J
    HIRASHIMA, T
    UEHARA, K
    NAGASAWA, Y
    SYSTEMS AND COMPUTERS IN JAPAN, 1995, 26 (01) : 11 - 25
  • [45] Program Analysis: From Qualitative Analysis to Quantitative Analysis (NIER Track)
    Liu, Sheng
    Zhang, Jian
    2011 33RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2011, : 956 - 959
  • [46] Iterative-free program analysis
    Ogawa, M
    Hu, ZJ
    Sasano, I
    ACM SIGPLAN NOTICES, 2003, 38 (09) : 111 - 123
  • [47] Symbolic analysis techniques for program parallelization
    Fahringer, T
    FUTURE GENERATION COMPUTER SYSTEMS, 1998, 13 (4-5) : 385 - 396
  • [48] Program Analysis using WALA (Tutorial)
    Santos, Joanna C. S.
    Dolby, Julian
    PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 1819 - 1819
  • [49] Probabilistic λ-calculus and quantitative program analysis
    Di Pierro, A
    Hankin, C
    Wiklicky, H
    JOURNAL OF LOGIC AND COMPUTATION, 2005, 15 (02) : 159 - 179
  • [50] Static Program Analysis as a Fuzzing Aid
    Shastry, Bhargava
    Leutner, Markus
    Fiebig, Tobias
    Thimmaraju, Kashyap
    Yamaguchi, Fabian
    Rieck, Konrad
    Schmid, Stefan
    Seifert, Jean-Pierre
    Feldmann, Anja
    RESEARCH IN ATTACKS, INTRUSIONS, AND DEFENSES (RAID 2017), 2017, 10453 : 26 - 47