Datalog

from Wikipedia, the free encyclopedia

Data Log is a database - programming language for deductive databases , the prologue is similar syntactically and semantically.

It goes back to the work of Herve Gallaire and Jack Minker in 1978.

Datalog differs from Prolog in the following ways:

  1. Compound terms cannot appear as arguments to predicates. For example, it is allowed, but it is forbidden.
  2. Programs written in Datalog must be stratified with regard to negation and recursion .
  3. Datalog programs can be efficiently evaluated bottom-up, whereby only a finite amount of facts can be derived and the evaluation time is limited.
  4. The order of the rules does not matter in a datalog program.

One advantage over relational calculi is the ability to define recursion without a predefined recursion depth. The termination of the recursion can be achieved by deductive closure , i.e. by reaching the smallest fixed point.

Researchers are currently developing the Boom programming language for the efficient use of computer clouds on the basis of Datalog, which is suitable for extreme parallelism .

Sample program

% koeln ist mit duesseldorf verbunden
verbunden(koeln,duesseldorf).
% duesseldorf ist mit dortmund verbunden
verbunden(duesseldorf,dortmund).
% hannover ist mit dortmund verbunden
verbunden(hannover,dortmund).
% wenn X mit Y verbunden ist, dann auch Y mit X
verbunden(Y,X) :- verbunden(X,Y).
% X ist mit Z verbunden, wenn X mit einem beliebigen Y verbunden ist, das wiederum mit Z verbunden ist
verbunden(X,Z) :- verbunden(X,Y),verbunden(Y,Z).
% Anfrage: Ist koeln mit hannover verbunden?
?- verbunden(koeln,hannover)?

Web links

Individual evidence

  1. ^ Logic and Data Bases . Symposium on Logic and Data Bases, Center d'études et de recherches de Toulouse in "Advances in Data Base Theory". Plenum Press, New York 1978
  2. BOOM: Generating Big Clouds from Small Programs . December 23, 2009
  3. Better code for the cloud . heise.de; Technology Review online, December 23, 2009