Proceedingsbeitrag
Zitieren …

Mono Types - First-Class Containers for Datalog

Runqing Xu ORCID-iD-Icon, David Klopp, Sebastian Erdweg ORCID-iD-Icon 1, Jonathan Aldrich [Hrsg.] und Alexandra Silva [Hrsg.]
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)
DOI: 10.5445/IR/1000187537/v2
Verlagsausgabe veröffentlicht am 01.12.2025
CC BY 4.0
DOI: 10.5445/IR/1000187537
Verlagsausgabe veröffentlicht am 25.11.2025
CC BY 4.0
Abstract

We propose mono types, a new abstraction for programming Datalog. Mono types behave like first-class containers that can be stored in relations and to which elements can be added decentrally. But, mono types are more than just containers: They provide a read operation that can yield any result as long as it monotonically grows with each added element and is independent of the order in which elements are added to the container. This design permits a wide range of mono types (e.g., sets, maps, and aggregations), yet guarantees mono types can be integrated into Datalog without jeopardizing Datalog’s least fixed-point semantics. We develop a theory for mono types, which includes constructions for complex mono types, equivalence relation for mono types, and properties about semantics-preserving mono-type transformations. This theory ensures sound Datalog integration and justifies crucial compiler optimizations for mono types. Together, these techniques demonstrate that mono types provide abstraction without regret: We demonstrate in two case studies that programs become easier to write with mono types, while their performance also improves drastically.