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 条
  • [21] Efficient provenance tracking for datalog using top-k queries
    Daniel Deutch
    Amir Gilad
    Yuval Moskovitch
    The VLDB Journal, 2018, 27 : 245 - 269
  • [22] Scaling Abstraction Refinement for Program Analyses in Datalog using Graph Neural Networks
    Yan, Zhenyu
    Zhang, Xin
    Di, Peng
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (OOPSLA):
  • [23] Efficient MPC via Program Analysis: A Framework for Efficient Optimal Mixing
    Ishaq, Muhammad
    Milanova, Ana L.
    Zikas, Vassilis
    PROCEEDINGS OF THE 2019 ACM SIGSAC CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY (CCS'19), 2019, : 1539 - 1556
  • [24] Formulog: Datalog for SMT-Based Static Analysis
    Bembenek, Aaron
    Greenberg, Michael
    Chong, Stephen
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (OOPSLA):
  • [25] IMP-Logics: a metamodel for analysis and transformations of Datalog programs
    Francisco Crespo, Jose
    Juanola, Marti
    Oriol, Xavier
    Recalde, Marti
    Teniente, Ernest
    ACM/IEEE 27TH INTERNATIONAL CONFERENCE ON MODEL DRIVEN ENGINEERING LANGUAGES AND SYSTEMS: COMPANION PROCEEDINGS, MODELS 2024, 2024, : 51 - 55
  • [26] Precise complexity guarantees for pointer analysis via datalog with extensions
    Tekle, K. Tuncay
    Liu, Yanhong A.
    THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2016, 16 : 916 - 932
  • [27] Bayesian Program Analysis
    Zhang X.
    Wang G.-C.
    Wu Y.-Q.
    Chen Y.-F.
    Li T.-C.
    Zhang Y.-F.
    Xiong Y.-F.
    Tien Tzu Hsueh Pao/Acta Electronica Sinica, 2024, 52 (04): : 1155 - 1172
  • [28] REHANA: An Efficient Program Analysis Framework to Uncover Reflective Code in Android
    Bachala, Shakthi
    Tsutano, Yutaka
    Srisa-an, Witawas
    Rothermel, Gregg
    Dinh, Jackson
    Hu, Yuanjiu
    MOBILE AND UBIQUITOUS SYSTEMS: COMPUTING, NETWORKING AND SERVICES, 2022, 419 : 347 - 374
  • [29] PROGRAM PARTITION AND LOGIC PROGRAM ANALYSIS
    HAN, JL
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1995, 21 (12) : 959 - 968
  • [30] Program analysis tools
    Hankin C.
    International Journal on Software Tools for Technology Transfer, 1998, 2 (1) : 6 - 12