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


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).

Baoqiu Cui