Short and Simple Explanations for Datalog Derivations
摘要
Simple and short query explanations that detail how a query result is obtained from an input dataset are a powerful way to gain insight into the results of queries. Unfortunately, simple and short explanations for recursive queries are non-trivial: query results of recursive queries typically have a huge set of equally-valid explanations. Toward providing simple and short query explanations, we believe that there is a strong need for an improved understanding of explanations of recursive queries. In this paper, we present such a framework by studying explanations of facts derived using Datalog derivation rules. To enable simple explanations, we present a standard tree-based formal representation of explanations and we formalize four conceptually distinct types of simple explanations based on their tree structure. Next, we show how to effectively compute two types of simple explanations, which opens the door for practical algorithms to explain Datalog query results. Finally, we prove that computing the other two types of simple explanations involves solving NP-complete decision problems and, hence, is inherently hard.