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.
翻译:解释数据库查询结果为何产生,是实现可解释人工智能的关键任务,尤其在当前Datalog等表达力丰富的数据库查询语言在基于本体的应用开发中发挥重要作用的背景下。解释查询结果的标准方法称为"why-溯源",其核心是以输入数据库子集的形式提供查询结果"见证者"信息,这些子集足以推导出该结果。令人惊讶的是,尽管Datalog查询的why-溯源概念已存在数十年并被深入研究,但其计算复杂度仍属空白领域。本研究旨在填补why-溯源文献中的这一明显缺失。为此,我们精确刻画了Datalog查询及其主要子类的why-溯源数据复杂度。本研究的核心发现是:递归查询(即使限于线性递归)的why-溯源是难解问题,而非递归查询则高度可解。在此基础上,我们通过利用SAT求解器进行实验验证,证明(递归)Datalog查询的why-溯源在实际应用中是可行的目标。