Questions tagged [datalog]

9 questions
4
votes
2 answers

Conjunctive Query Containment as SAT

The problem of conjunctive query containment is known to be NP-Complete (originated at Chandra&Merlin 1977). Typically it's shown by reducing 3SAT or 3-colorability into this problem, and the other direction is typically proven by declaring it…
Troy McClure
  • 644
  • 4
  • 10
3
votes
1 answer

Detect non existence of a cycle in a graph using Datalog : SMTLIB Format for Z3

I want to detect the non existence of a cycle in a graph using Datalog (which is a declarative logic programming language). The proposed solution was: (set-option :fixedpoint.engine datalog) (define-sort s () Int) (declare-rel edge (s s))…
Josep Ng
  • 31
  • 2
3
votes
1 answer

How to describe Deterministic Transitive Closure in FOL?

In "Finite Model Theory and Its Applications", page 152, it is said that Deterministic Transitive Closure, on ordered finite structures, captures LOGSPACE. Hence, taking into account that FOL captures LOGSPACE, the following should be…
2
votes
0 answers

Datalog maintaining views incrementally with negation

Given a single IDB rule $$R(x) \ \mathop{:\!\!-} \ A(x), \lnot B(x)$$ Where $A$ and $B$ are EDB predicates, how would I go about calculating changes to $R$ as tuples are added to $B$? As I understand, when tuples are added to $B$, tuples may need…
t123
  • 203
  • 1
  • 5
2
votes
0 answers

What is the complexity of checking whether a non-linear recursive datalog rule is one-bounded?

It is known that deciding whether a linear recursive datalog rule is one-bounded is NP-hard [1]. That is, given a rule such as: "p(x,y) :- q(x), p(y,z), r(z, ...) ,...", where the predicate p only appears once in the body of the rule, deciding…
441Juggler
  • 559
  • 2
  • 13
2
votes
1 answer

Datalog Self Interpretation

According to https://link.springer.com/article/10.1007%2Fs001530050135 (Logics that define their own semantics, Imhof 1999) the logic FO[LFP] can define its own semantics, though the proof (of corollary 6.4) is somehow fuzzy. It is known from finite…
Troy McClure
  • 644
  • 4
  • 10
1
vote
1 answer

Is Datalog negation and the built-in predicate $ \neq $ similar?

I was reading "Principles of Database & Knowledge-Base Systems, Vol. 1" by Jeffrey D. Ullman. There is a chapter about Datalog negation and as I was seeing the problems of negation I kept thinking that using the predicate $ \neq $ would solve those…
1
vote
0 answers

How could higher-order Datalog be more expressive than first-order Datalog?

According to this paper [1], higher-order Datalog is more expressive: ... we demonstrate that on ordered databases, for all k ≥ 2, k-order Datalog captures (k − 1)-EXPTIME. This result suggests that higher-order extensions of Datalog possess…
1
vote
0 answers

Datalog Program Equivalence with Fixed Universe Size

It is well known that to compute equivalence of two Datalog programs (or equivalently of two first order formulas with the least fixed point operator) wrt all possible inputs and universes, is undecidable. If we fix the universe size to be N, it is…
Troy McClure
  • 644
  • 4
  • 10