paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Object-Oriented Fixpoint Programming with Datalog

用 Datalog 进行面向对象定点编程
OOPSLA 8(OOPSLA2)2024匹配度 2/10 · 该论文聚焦于 Datalog 的对象/定点语言设计与编译,属于逻辑编程和语言设计,与用户核心关注的 PL 与 AI/LLM 交叉、浮点程序分析、贝叶斯程序分析均无直接关联;仅因 Datalog 常作为静态分析基础设施而有非常间接的联系。引用 3 inbox
David Klopp, Sebastian Erdweg, André Pacak
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:设计 OODL 语言,将对象、动态分派和受控可变性融入 Datalog 式定点语义,并编译到 Datalog。

现代 Datalog 应用在规模和复杂度上已超出其原始设计目标,尤其缺少代码组织与复用抽象,导致程序难以维护。论文提出 OODL,结合动态对象分配、对象标识、动态分派和可变性等面向对象特性,同时保留 Datalog 式定点语义:递归计算迭代至结果稳定。作者给出两种语义:定点解释器和将 OODL 编译为 Datalog 的编译器。针对 OOP 副作用与定点语义的冲突,OODL 使用不可变代数数据类型替代定点计算中的对象分配,并引入单调可变类型(mono types)以支持一种放宽的可变性。性能评估表明,解释器无法高效求解定点问题,而编译后的代码能够利用 Datalog 的半朴素求值。

问题
Datalog 缺少代码组织与复用抽象,程序难以维护;核心问题是能否在保留 Datalog 式定点语义的同时利用 OOP 的抽象与设计模式。
方法
设计 OODL,包含动态对象分配、对象标识、动态分派和可变性,并赋予 Datalog 式定点语义;提供定点解释器以及将 OODL 翻译为 Datalog 的编译器,通过不可变代数数据类型和 mono 类型调和副作用与定点求解。
评估
通过性能评估比较定点解释器与编译生成的 Datalog 代码;结果显示解释器难以高效求解定点问题,而编译代码可利用 Datalog 的半朴素求值。
原文摘要(Abstract)

Modern usages of Datalog exceed its original design purpose in scale and complexity. In particular, Datalog lacks abstractions for code organization and reuse, making programs hard to maintain. Is it possible to exploit abstractions and design patterns from object-oriented programming (OOP) while retaining a Datalog-like fixpoint semantics? To answer this question, we design a new OOP language called OODL with common OOP features: dynamic object allocation, object identity, dynamic dispatch, and mutation. However, OODL has a Datalog-like fixpoint semantics, such that recursive computations iterate until their result becomes stable. We develop two semantics for OODL: a fixpoint interpreter and a compiler that translates OODL to Datalog. Although the side effects found in OOP (object allocation and mutation) conflict with Datalog's fixpoint semantics, we can mostly resolve these incompatibilities through extensions of OODL. Within fixpoint computations, we employ immutable algebraic data structures (e.g. case classes in Scala), rather than relying on object allocation, and we introduce monotonically mutable data types ( mono types ) to enable a relaxed form of mutation. Our performance evaluation shows that the interpreter fails to solve fixpoint problems efficiently, whereas the compiled code exploits Datalog's semi-naïve evaluation.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{KloppEP24,
  title = {Object-Oriented Fixpoint Programming with Datalog},
  author = {David Klopp and Sebastian Erdweg and André Pacak},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689713}
}