# PUG: A Framework and Practical Implementation for Why & Why-Not Provenance (extended version)

arXiv: https://arxiv.org/abs/1808.05752 · HTML: https://mlsanity.com/paper/1808.05752/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 16 Aug 2018.

## Built on by (most cited first, 3 of 3)

- [The Complexity of Why-Provenance for Datalog Queries](https://mlsanity.com/paper/2303.12773/) (2023)
- [On the Structure of Game Provenance and its Applications](https://mlsanity.com/paper/2410.05094/) (2024)
- [Evergreen: Efficient Claim Verification for Semantic Aggregates](https://mlsanity.com/paper/2604.26180/) (2026)

## Abstract (arXiv)

Explaining why an answer is (or is not) returned by a query is important for many applications including auditing, debugging data and queries, and answering hypothetical questions about data. In this work, we present the first practical approach for answering such questions for queries with negation (first- order queries). Specifically, we introduce a graph-based provenance model that, while syntactic in nature, supports reverse reasoning and is proven to encode a wide range of provenance models from the literature. The implementation of this model in our PUG (Provenance Unification through Graphs) system takes a provenance question and Datalog query as an input and generates a Datalog program that computes an explanation, i.e., the part of the provenance that is relevant to answer the question. Furthermore, we demonstrate how a desirable factorization of provenance can be achieved by rewriting an input query. We experimentally evaluate our approach demonstrating its efficiency.
