<p>Multiple efforts in the PL community have adopted Datalog for compiler specification, due to its ability to easily define recursive properties. However, datalog also conflates identity and value, and as a result it struggles with aggregation. Draupnir is a compiler for a datalog-adjacent language that draws on group-/ring-theoretic provenance models (e.g., <a href="https://dl.acm.org/doi/10.1145/1265530.1265535">Semiring Provenance</a>, <a href="https://dl.acm.org/doi/10.1145/1807085.1807100">Ring Databases</a>) to capture aggregation.</p>