HackerPapers

arXiv:1909.08246cs.LO

Extended Magic for Negation: Efficient Demand-Driven Evaluation of Stratified Datalog with Precise Complexity Guarantees

K. Tuncay Tekle, Yanhong A. Liu

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

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.

arXiv comments
In Proceedings ICLP 2019, arXiv:1909.07646
Journal reference
EPTCS 306, 2019, pp. 241-254
DOI
doi:10.4204/EPTCS.306.28
Subjects
cs.LOLogic in Computer Science cs.AIArtificial Intelligence cs.DBDatabases cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Jan 2021 to Jan 2021.

Comments linking this paper, per year.

Discussed in comments1 thread

  1. Why Learn Prolog in 2021? 1 comment
    • No recommendations, sorry, merely a couple of thoughts. Prolog and datalog start out as rather different beasts, though prolog tabling gets them closer. It's an area of current research[1]. A datalog implementation can serve as DSL, learning tool, and/or efficient solver of…

      mncharityView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.