11 lines
285 B
Plaintext
11 lines
285 B
Plaintext
% examples/reach.dl -- stratified negation + recursion, the CLI demo program.
|
|
node(a). node(b). node(c). node(d).
|
|
source(a).
|
|
edge(a, b). edge(b, c).
|
|
|
|
reach(X) :- source(X).
|
|
reach(X) :- edge(Y, X), reach(Y).
|
|
|
|
unreachable(X) :- node(X), not reach(X).
|
|
sink(X) :- node(X), not edge(X, _).
|