next up previous contents index
Next: Guidelines for application developers Up: Using the Interface Previous: SQLCA interface   Contents   Index

Datalog

You can write recursive Datalog queries with exactly the same semantics as in XSB using imported database predicates or database rules. For example assuming db_parent/2 is an imported database predicate, the following recursive query computes its transitive closure.

:- table(ancestor/2).
ancestor(X,Y) :- db_parent(X,Y).
ancestor(X,Z) :- ancestor(X,Y), db_parent(Y,Z).



Luis Fernando P. de Castro 2003-06-27