Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. onstreet(X,s(X,_,_,_,_)).
  2. onstreet(X,s(_,X,_,_,_)).
  3. onstreet(X,s(_,_,X,_,_)).
  4. onstreet(X,s(_,_,_,X,_)).
  5. onstreet(X,s(_,_,_,_,X)).
  6.  
  7. middle(X,s(_,_,X,_,_)).
  8. first(X,s(X,_,_,_,_)).
  9. nextto(X,Y,S):-toright(X,Y,S).
  10. nextto(Y,X,S):-toright(X,Y,S).
  11.  
  12. toright(X,Y,s(X,Y,_,_,_)).
  13. toright(X,Y,s(_,X,Y,_,_)).
  14. toright(X,Y,s(_,_,X,Y,_)).
  15. toright(X,Y,s(_,_,_,X,Y)).
  16.  
  17. clue(S):-onstreet(house(english,_,red,_,_),S),
  18. onstreet(house(spanish,dog,_,_,_),S),
  19. onstreet(house(_,_,green,coffee,_),S),
  20. onstreet(house(ukrainian,_,_,tea,_),S),
  21. toright(house(_,_,ivory,_,_),house(_,_,green,_,_),S),
  22. onstreet(house(_,snail,_,_,tennis),S),
  23. onstreet(house(_,_,yellow,_,chess),S),
  24. middle(house(_,_,_,milk,_),S),
  25. first(house(norwegian,_,_,_,_),S),
  26. nextto(house(_,fox,_,_,_),house(_,_,_,_,rugby),S),
  27. nextto(house(_,horse,_,_,_),house(_,_,_,_,chess),S),
  28. onstreet(house(_,_,_,juice,volleyball),S),
  29. onstreet(house(japaneese,_,_,_,go),S),
  30. nextto(house(_,_,blue,_,_),house(norwegian,_,_,_,_),S),
  31. nextto(house(_,_,_,milo,_),house(_,_,_,tea,_),S).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement