Skip to content

Commit

Permalink
Add roads example.
Browse files Browse the repository at this point in the history
  • Loading branch information
namcsi committed Jan 30, 2024
1 parent c6db01e commit a56db80
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/asp/transform/meta-telingo/inputs/roads.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
road(A,B) :- road(B,A). % roads are bidirectional
city(A) :- road(A,B).
car(1). car(2).
road(lisbon,madrid). road(madrid,paris).
road(boston,ny). road(ny,nj).

wnext(at(X,A)) :- driveto(X,A).
driveto(X,B); no_driveto(X,B) :- at(X,A), road(A,B).
wnext(at(X,A)) :- at(X,A), not no_at(X,A).
no_at(X,A) :- at(X,B), A!=B, city(A).

:- at(X,A), at(X,B), A!=B.

% initial state
at(1,madrid) :- initial.
at(2,ny) :- initial.

#show show.
#show show(at(X,Y)) : at(X,Y).

0 comments on commit a56db80

Please sign in to comment.