Extended Magic for Negation:具有精确复杂度保证的分层数据库的高效需求驱动评估
Extended Magic for Negation: Efficient Demand-Driven Evaluation of Stratified Datalog with Precise Complexity Guarantees
摘要:
给定一组Datasheet规则、事实和查询,可以从事实开始自底向上或从查询开始自顶向下推断查询的答案。为了提高效率,自上而下的评估扩展了推断事实的记忆,自下而上的评估在转换后执行,以根据查询的需求制定规则。先前的工作已经显示了它们精确的复杂性分析和关系。然而,当Datasheet扩展甚至分层否定,它有一个简单的和普遍接受的语义,转换,使规则的需求驱动可能会导致非分层否定,它有许多复杂的语义和评估方法。本文提出了(1)一个简单的扩展需求转换,转换,使规则需求驱动的数据库没有否定,支持分层否定,和(2)一个简单的扩展,最佳的自底向上评估方法的数据库与分层否定,处理非分层否定的结果规则。我们表明,该方法提供了精确的复杂性保证。它也是最优的,因为只有查询的自顶向下评估所需的事实被推断,并且每次触发规则来推断这样的事实需要最坏情况的恒定时间。我们将自上而下的评估和需求驱动的自下而上的评估之间的精确关系扩展到具有分层否定的数据库。最后,我们展示了性能的实验结果,以及对先前具有挑战性的示例的应用。
英文摘要:
Given a set of Datalog rules, facts, and a query, answers to the query can be inferred bottom-up starting from the facts or top-down starting from the query. For efficiency, top-down evaluation is extended with memoization of inferred facts, and bottom-up evaluation is performed after transformations to make rules driven by the demand from the query. Prior work has shown their precise complexity analysis and relationships. However, when Datalog is extended with even stratified negation, which has a simple and universally accepted semantics, transformations to make rules demand-driven may result in non-stratified negation, which has had many complex semantics and evaluation methods. This paper presents (1) a simple extension to demand transformation, a transformation to make rules demand-driven for Datalog without negation, to support stratified negation, and (2) a simple extension to an optimal bottom-up evaluation method for Datalog with stratified negation, to handle non-stratified negation in the resulting rules. We show that the method provides precise complexity guarantees. It is also optimal in that only facts needed for top-down evaluation of the query are inferred and each firing of a rule to infer such a fact takes worst-case constant time. We extend the precise relationship between top-down evaluation and demand-driven bottom-up evaluation to Datalog with stratified negation. Finally, we show experimental results for performance, as well as applications to previously challenging examples.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。