DatalogZ
DatalogZ (stylized as Template:Proper name) is an extension of Datalog with integer arithmetic and comparisons. The decision problem of whether or not a given ground atom (fact) is entailed by a DatalogZ program is RE-complete (hence, undecidable), which can be shown by a reduction to diophantine equations.[1]
Syntax
The syntax of DatalogZ extends that of Datalog with numeric terms, which are integer constants, integer variables, or terms built up from these with addition, subtraction, and multiplication. Furthermore, DatalogZ allows Template:Dfni, which are atoms of the form t < s or t <= s for numeric terms t, s.Template:Sfn
Semantics
The semantics of DatalogZ are based on the model-theoretic (Herbrand) semantics of Datalog.Template:Sfn
Limit DatalogZ
The undecidability of entailment of DatalogZ motivates the definition of limit DatalogZ. Limit DatalogZ restricts predicates to a single numeric position, which is marked maximal or minimal. The semantics are based on the model-theoretic (Herbrand) semantics of Datalog. The semantics require that Herbrand interpretations be Template:Dfni to qualify as models, in the following sense: Given a ground atom of a limit predicate where the last position is a max (resp. min) position, if is in a Herbrand interpretation , then the ground atoms for (resp. ) must also be in for to be limit-closed.Template:Sfn
Example
Given a constant w, a binary relation edge that represents the edges of a graph, and a binary relation sp with the last position of sp minimal, the following limit DatalogZ program computes the relation sp, which represents the length of the shortest path from w to any other node in the graph:
sp(w, 0) :- .
sp(y, m + 1) :- sp(x, m), edge(x, y).
See also
References
Notes
Sources
- ↑ Template:Cite journal. "For example, datalog (which is EXPTIME-complete) with linear arithmetic constraints [...] is undecidable." (Theorem 10.1)