{{language }} Datalog is a query and rule language for deductive databases that syntactically is a subset of [[Prolog]].

In contrast to Prolog:

  • it disallows complex terms as arguments of predicates, e.g. p(1, 2) is admissible but not p(f1(1), 2),
  • imposes certain stratification restrictions on the use of negation and recursion, and
  • only allows range-restricted variables, i.e. each variable in the conclusion of a rule must also appear in a not negated clause in the premise of this rule.

These rules make the set of all possible proofs finite, with the consequence that all datalog programs terminate (unlike Prolog programs). As a consequence, statements and predicates of a program can be stated in any order (unlike Prolog).

== See Also ==

  • [[wp:Datalog|Wikipedia:Datalog]]
  • [https://bitbucket.org/pcarbonn/pydatalog pyDatalog]
  • [http://www.ccs.neu.edu/home/ramsdell/tools/datalog/ Datalog]
  • [http://www.ccs.neu.edu/home/ramsdell/tools/datalog/datalog.html Datalog User Manual]