% This is the standard transitive closure example. use_query_const yes. derive_idb_literals yes. db edge/2. path(X,Y) :- edge(X,Y). path(X,Z) :- edge(X,Y), path(Y,Z). :- path(0, X).