racket/collects/datalog/tests/paren-examples/bidipath.rkt
2010-06-25 17:08:13 -06:00

8 lines
212 B
Racket

#lang datalog/sexp
% path test from Chen & Warren
edge(a, b). edge(b, c). edge(c, d). edge(d, a).
path(X, Y) :- edge(X, Y).
path(X, Y) :- edge(X, Z), path(Z, Y).
path(X, Y) :- path(X, Z), edge(Z, Y).
path(X, Y)?