Talk:Datalog

From Wikipedia, the free encyclopedia

It would be nice if the examples were explained, such as "If X is a parent of Y, then we know that X is also an ancestor of Y".



in the rule:

ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- ancestor(X,Z),ancestor(Z,Y).

shouldn't it be:

ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- ancestor(X,Z),parent(Z,Y).



The two formulations are equivalent, as is the formulation:

ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(X,Z),ancestor(Z,Y). 
Logperson (talk) 14:59, 30 April 2008 (UTC)