Blame view

code/asp/roads.lp 264 Bytes
808facfe   Francisco Coelho   Main text adapted...
1
2
3
4
5
6
7
8
9
10
road(berlin, potsdam).
road(potsdam, werder).
road(werder, brandenburg).
road(X, Y) :- road(Y, X).

blocked(werder, brandenburg).

route(X, Y) :- road(X, Y), not blocked(X, Y).
route(X, Y) :- route(X, Z), route(Z, Y).

7ae9c686   Francisco Coelho   2022-11-29 | Reun...
11
drive(X) :- route(berlin, X).
808facfe   Francisco Coelho   Main text adapted...
12
13

#show drive/1.