LLM-powered Datalog Code Translation and Incremental Program Analysis Framework
Author:
Affiliation:

Clc Number:

TP311

Fund Project:

  • Article
  • |
  • Figures
  • |
  • Metrics
  • |
  • Reference
  • |
  • Related
  • |
  • Cited by
  • |
  • Materials
  • |
  • Comments
    Abstract:

    Datalog, a declarative logic programming language, has been widely-adopted across diverse domains and experienced a surge in interest from both academia and industry in recent years. This renewed attention has led to the design and development of various Datalog engines alongside their respective dialects. However, a prevalent challenge is that code implemented in one Datalog dialect typically cannot be executed on the engine of another dialect. This limitation necessitates the translation of existing Datalog codebases when transitioning to a new Datalog engine. Traditional approaches to Datalog code translation, which include manual code rewriting and the creation of translation rules, are often time-consuming, repetitive, inflexible, and not easily scalable. This paper proposes an LLM-powered Datalog code translation technology, utilizing the powerful code understanding and generation capabilities of LLM, through a divide-and-conquer strategy, prompt engineering based on few-shot and CoT prompts, and an iterative error-correction mechanism based on check-feedback-repair, which can achieve high-precision code translation between different Datalog dialects and reduce the workload of developers in developing translation rules repeatedly. Building on this code translation technology, a general declarative incremental program analysis framework based on Datalog has been designed and implemented. The performance of the proposed LLM-powered Datalog code translation technology was evaluated on different Datalog dialects, and the evaluation results verified the effectiveness of the proposed code translation technology. We also conducted experimental evaluation on the general declarative incremental program analysis framework, verifying the speedup effect of incremental program analysis based on the proposed code translation technology.

    Reference
    Related
    Cited by
Get Citation

王熙灶,沈天琪,宾向荣,卜磊. LLM赋能的Datalog代码翻译技术及增量程序分析框架.软件学报,2025,36(6):0

Copy
Share
Article Metrics
  • Abstract:
  • PDF:
  • HTML:
  • Cited by:
History
  • Received:August 26,2024
  • Revised:October 14,2024
  • Adopted:
  • Online: December 10,2024
  • Published:
You are the firstVisitors
Copyright: Institute of Software, Chinese Academy of Sciences Beijing ICP No. 05046678-4
Address:4# South Fourth Street, Zhong Guan Cun, Beijing 100190,Postal Code:100190
Phone:010-62562563 Fax:010-62562533 Email:jos@iscas.ac.cn
Technical Support:Beijing Qinyun Technology Development Co., Ltd.

Beijing Public Network Security No. 11040202500063