Explaining why a database query result is obtained is an essential task towards the goal of Explainable AI, especially nowadays where expressive database query languages such as Datalog play a critical role in the development of ontology-based applications. A standard way of explaining a query result is the so-called why-provenance, which essentially provides information about the witnesses to a query result in the form of subsets of the input database that are sufficient to derive that result. To our surprise, despite the fact that the notion of why-provenance for Datalog queries has been around for decades and intensively studied, its computational complexity remains unexplored. The goal of this work is to fill this apparent gap in the why-provenance literature. Towards this end, we pinpoint the data complexity of why-provenance for Datalog queries and key subclasses thereof. The takeaway of our work is that why-provenance for recursive queries, even if the recursion is limited to be linear, is an intractable problem, whereas for non-recursive queries is highly tractable. Having said that, we experimentally confirm, by exploiting SAT solvers, that making why-provenance for (recursive) Datalog queries work in practice is not an unrealistic goal.
翻译:解释为何得到数据库查询结果是实现可解释AI目标的关键任务,特别是在表述数据库查询语言(如Datalog)对本体应用程序的开发起至关重要作用的今天。解释查询结果的标准方法是所谓的why-provenance,它基本上提供了有关产生查询结果的信息,这些信息以输入数据库的子集的形式提供,以证明该结果是合法的。令人惊讶的是,尽管Datalog查询的why-provenance概念已经存在了数十年,并且得到了广泛研究,但其计算复杂性仍未被探索。本文的目标是填补why-provenance文献中的这一明显空白。为此,我们确定了why-provenance的数据复杂度以及其重要的子类。我们得出的结论是,即使递归被限制为线性,Datalog查询的why-provenance对于递归查询是一个难以处理的问题,而对于非递归查询是非常容易处理的。话虽如此,通过利用SAT求解器, 我们的实验结果显示期望让 (递归) Datalog 查询的 why-provenance 能够在实践中发挥作用并不是一个不切实际的目标。