Re: Prolog - Relationship Analyze

From NAT, 6 Years ago, written in Prolog, viewed 923 times. This paste is a reply to Prolog - Relationship Analyze from NAT - view diff
URL https://code.nat.moe/view/a8a805f1 Embed
Download Paste or View Raw
  1. couple(X,Y):-love(X,Y),love(Y,X).
  2. enemy(X,Y):-love(X,Z),not(love(Z,X)),love(Z,Y).
  3. enemy(X,Y):-loved(X,Z),not(love(Z,X)),love(Z,Y).
  4. possible_enemy(X,Y):-possiblelove(X,Z),not(love(Z,X)),love(Z,Y),not(X=Y).
  5. possible_enemy(X,Y):-loved(X,Z),not(love(Z,X)),possiblelove(Z,Y),not(X=Y).
  6. boom(X,Y):-hate(X,Y),hate(Y,X).
  7. jealousy(X,Y):-love(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
  8. possible_jealousy(X,Y):-possiblelove(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
  9. possible_jealousy(X,Y):-loved(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
  10. never(X,Y):-love(X,Y),hate(Y,X).
  11. uneqlove(X,Y):-love(X,Y),not(love(Y,X)).
  12. uneqplove(X,Y):-possiblelove(X,Y),not(love(Y,X)).
  13. uneqplove(X,Y):-possiblelove(X,Y),not(possiblelove(Y,X)).
  14. compet(X,Y):-love(X,Z),love(Y,Z).
  15. competful(X,Y):-love(Y,X),love(Z,X),not(Y=Z).
  16. competful(X,Y):-possiblelove(Y,X),love(Z,X),not(Y=Z).
  17. competful(X,Y):-possiblelove(Y,X),possiblelove(Z,X),not(Y=Z).
  18. unclear(X,Y):-friend(X,Y),love(Y,X),not(couple(X,Y)).
  19. unclear(X,Y):-friend(X,Y),possiblelove(Y,X),not(couple(X,Y)).
  20. unclearful(X,Y):-unclear(Y,X),unclear(Z,X),not(Y=Z).
  21. misunderstood(X,Y):-friend(Y,X),love(X,Y),not(friend(X,Y)).
  22. possible_couple(X,Y):-friend(X,Y),love(X,Y),friend(Y,X).
  23. possible_couple(X,Y):-possible_friend(X,Y),love(X,Y),possible_friend(X,Y).
  24. possible_couple(X,Y):-friend(Y,X),possiblelove(X,Y).
  25. possible_couple(X,Y):-possiblelove(X,Y),possiblelove(Y,X).
  26. play(X,Y):-love(X,Y),love(X,Z),not(Y=Z).
  27. realfriend(X,Y):-friend(X,Y),friend(Y,X).
  28. turefriend(X,Y):-friend(X,Y),friend(Y,X),not(love(X,Y)),not(love(Y,X)),not(possiblelove(X,Y)),not(possiblelove(Y,X)).
  29. uneqfriend(X,Y):-friend(X,Y),not(friend(Y,X)).
  30. fakefriend(X,Y):-friend(X,Y),hate(Y,X).
  31. dangerous_friend(X,Y):-friend(X,Y),love(X,Z),love(Z,Y),not(Y=Z).
  32. dangerous_friend(X,Y):-friend(X,Y),love(X,Z),friend(Z,Y),not(Y=Z).
  33. dangerous_friend(X,Y):-friend(X,Y),friend(X,Z),hate(Z,Y),not(Y=Z).
  34. possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),possiblelove(Z,Y),not(Y=Z).
  35. possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),friend(Z,Y),not(Y=Z).
  36. possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),loved(Z,Y),not(Y=Z).
  37. possible_dangerous_friend(X,Y):-friend(X,Y),loved(X,Z),friend(Z,Y),not(Y=Z).
  38. possible_dangerous_friend(X,Y):-friend(X,Y),loved(X,Z),loved(Z,Y),not(Y=Z).
  39. possible_friend(X,Y):-friend(X,Z),friend(Z,Y),not(friend(X,Y)),not(X=Y).
  40. possible_friend(X,Y):-not(friend(X,Y)),love(Y,X).
  41. possible_friend(X,Y):-not(friend(X,Y)),possiblelove(Y,X).
  42. know(X,Y):-friend(X,Y).
  43. know(X,Y):-loved(X,Y),not(friend(X,Y)).
  44. know(X,Y):-possiblelove(X,Y),not(friend(X,Y)).
  45. know(X,Y):-love(X,Y),not(friend(X,Y)).
  46. know(X,Y):-uneqlove(X,Y).
  47. know(X,Y):-uneqfriend(Y,X).
  48. know(X,Y):-hate(Y,X).
  49. possible_know(X,Y):-possible_friend(X,Y),not(know(X,Y)).
  50. possible_know(X,Y):-friend(X,Z),love(Z,Y),not(know(X,Y)),not(X=Y).
  51. possible_know(X,Y):-friend(X,Z),hate(Z,Y),not(know(X,Y)),not(X=Y).
  52. possible_know(X,Y):-friend(X,Z),loved(Z,Y),not(know(X,Y)),not(X=Y).
  53. possible_know(X,Y):-friend(X,Z),possiblelove(Z,Y),not(know(X,Y)),not(X=Y).
  54. possible_know(X,Y):-friend(X,Z),dangerous_friend(Z,Y),not(know(X,Y)),not(X=Y).
  55. possible_know(X,Y):-friend(X,Z),possible_dangerous_friend(Z,Y),not(know(X,Y)),not(X=Y).

Replies to Re: Prolog - Relationship Analyze rss

Title Name Language When
Re: Re: Prolog - Relationship Analyze NAT prolog 6 Years ago.

Reply to "Re: Prolog - Relationship Analyze"

Here you can reply to the paste above

captcha