KIT | KIT-Bibliothek | Impressum | Datenschutz

Functional Programming with Datalog

Pacak, André; Erdweg, Sebastian ORCID iD icon 1
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Datalog is a carefully restricted logic programming language. What makes Datalog attractive is its declarative fixpoint semantics: Datalog queries consist of simple Horn clauses, yet Datalog solvers efficiently compute all derivable tuples even for recursive queries. However, as we argue in this paper, Datalog is ill-suited as a programming language and Datalog programs are hard to write and maintain. We propose a “new” frontend for Datalog: functional programming with sets called functional IncA. While programmers write recursive functions over algebraic data types and sets, we transparently translate all code to Datalog relations. However, we retain Datalog’s strengths: Functions that generate sets can encode arbitrary relations and mutually recursive functions have fixpoint semantics. We also ensure that the generated Datalog program terminates whenever the original functional program terminates, so that we can apply off-the-shelve bottom-up Datalog solvers. We demonstrate the versatility and ease of use of functional IncA by implementing a type checker, a program transformation, an interpreter of the untyped lambda calculus, two data-flow analyses, and clone detection of Java bytecode.


Verlagsausgabe §
DOI: 10.5445/IR/1000188603
Veröffentlicht am 16.01.2026
Originalveröffentlichung
DOI: 10.4230/LIPIcs.ECOOP.2022.7
Cover der Publikation
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 23.06.2022
Sprache Englisch
Identifikator ISBN: 978-395977225-9
ISSN: 1868-8969
KITopen-ID: 1000188603
Erschienen in European Conference on Object-Oriented Programming (ECOOP); Berlin, Deutschland, 06.-10.06.2022
Veranstaltung 36th European Conference on Object-Oriented Programming (ECOOP 2022), Berlin, Deutschland, 06.06.2022 – 10.06.2022
Verlag Schloss Dagstuhl -- Leibniz-Zentrum fuer Informatik
Seiten 28 S.
Serie Leibniz International Proceedings in Informatics (LIPIcs) ; 222
Schlagwörter Datalog, functional programming, demand transformation
Nachgewiesen in Scopus
OpenAlex
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page