@MISC{Pfenning0615-819k:logic, author = {Frank Pfenning and L. Datalog}, title = {15-819K: Logic Programming Lecture 26}, year = {2006} }
Share
OpenURL
Abstract
In this lecture we describe Datalog, a decidable fragment of Horn logic. Briefly, Datalog disallows function symbols, which means that the so-called Herbrand universe of ground instances of predicates is finite. Datalog has applications in databases and, more recently, in program analysis and related problems. We also sketch a promising new way to implement Datalog via its bottom-up semantics using BDDs to represent predicates. 26.1 Stratified Negation Datalog arises from Horn logic via two restrictions and an extension. The most important restriction is to disallow function symbols: terms must be variables or be drawn from a fixed set of constant symbols. The second restriction is that any variable in the head of a clause also appears in the body. Together these mean that all predicates are decidable via a simple bottom-up, forward chaining semantics, since there are only finitely many propositions that can arise. These propositions form the so-called Herbrand universe. If all domains of quantification are finite, we can actually drop the restriction on variables in clause heads, since a head such as p(x) just stands for finitely many instances p(c1),...,p(cn), where c1,...,cn is an enumeration of the elements of the domain of p. In either case, the restriction guarantees decidability. This means it is possible to add a sound form of constructive negation, called stratified negation. For predicates p and q we say p directly depends on q if the body of a clause with head p(t) contains q(s). We write p ≥ q for the reflexive and transitive closure of the direct dependency relation. If q does not depend