Re: Prolog - Relationship Analyze

From NAT, 7 Years ago, written in Prolog, viewed 1'008 times. This paste is a reply to Prolog - Relationship Analyze from NAT - go back
URL https://code.nat.moe/view/a8a805f1/diff Embed
Viewing differences between Prolog - Relationship Analyze and Re: Prolog - Relationship Analyze
couple(X,Y):-love(X,Y),love(Y,X).
enemy(X,Y):-love(X,Z),not(love(Z,X)),love(Z,Y).
enemy(X,Y):-loved(X,Z),not(love(Z,X)),love(Z,Y).
possible_enemy(X,Y):-possiblelove(X,Z),not(love(Z,X)),love(Z,Y),not(X=Y).
possible_enemy(X,Y):-loved(X,Z),not(love(Z,X)),possiblelove(Z,Y),not(X=Y).
boom(X,Y):-hate(X,Y),hate(Y,X).
jealousy(X,Y):-love(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
possible_jealousy(X,Y):-possiblelove(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
possible_jealousy(X,Y):-loved(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
never(X,Y):-love(X,Y),hate(Y,X).
uneqlove(X,Y):-love(X,Y),not(love(Y,X)).
uneqplove(X,Y):-possiblelove(X,Y),not(love(Y,X)).
uneqplove(X,Y):-possiblelove(X,Y),not(possiblelove(Y,X)).
compet(X,Y):-love(X,Z),love(Y,Z).
competful(X,Y):-love(Y,X),love(Z,X),not(Y=Z).
competful(X,Y):-possiblelove(Y,X),love(Z,X),not(Y=Z).
competful(X,Y):-possiblelove(Y,X),possiblelove(Z,X),not(Y=Z).
unclear(X,Y):-friend(X,Y),love(Y,X),not(couple(X,Y)).
unclear(X,Y):-friend(X,Y),possiblelove(Y,X),not(couple(X,Y)).
unclearful(X,Y):-unclear(Y,X),unclear(Z,X),not(Y=Z).
misunderstood(X,Y):-friend(Y,X),love(X,Y),not(friend(X,Y)).
possible_couple(X,Y):-friend(X,Y),love(X,Y),friend(Y,X).
possible_couple(X,Y):-possible_friend(X,Y),love(X,Y),possible_friend(X,Y).
possible_couple(X,Y):-friend(Y,X),possiblelove(X,Y).
possible_couple(X,Y):-possiblelove(X,Y),possiblelove(Y,X).
play(X,Y):-love(X,Y),love(X,Z),not(Y=Z).
realfriend(X,Y):-friend(X,Y),friend(Y,X).
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)).
uneqfriend(X,Y):-friend(X,Y),not(friend(Y,X)).
fakefriend(X,Y):-friend(X,Y),hate(Y,X).
dangerous_friend(X,Y):-friend(X,Y),love(X,Z),love(Z,Y),not(Y=Z).
dangerous_friend(X,Y):-friend(X,Y),love(X,Z),friend(Z,Y),not(Y=Z).
dangerous_friend(X,Y):-friend(X,Y),friend(X,Z),hate(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),possiblelove(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),friend(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),possiblelove(X,Z),loved(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),loved(X,Z),friend(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),loved(X,Z),loved(Z,Y),not(Y=Z).
possible_friend(X,Y):-friend(X,Z),friend(Z,Y),not(friend(X,Y)),not(X=Y).possible_friend(X,Y):-friend(X,Z),friend(Z,Y),not(friend(X,Y)),not(X=Y).
possible_friend(X,Y):-not(friend(X,Y)),love(Y,X).
possible_friend(X,Y):-not(friend(X,Y)),possiblelove(Y,X).
know(X,Y):-friend(X,Y).
know(X,Y):-loved(X,Y),not(friend(X,Y)).
know(X,Y):-possiblelove(X,Y),not(friend(X,Y)).
know(X,Y):-love(X,Y),not(friend(X,Y)).
know(X,Y):-uneqlove(X,Y).
know(X,Y):-uneqfriend(Y,X).
know(X,Y):-hate(Y,X).
possible_know(X,Y):-possible_friend(X,Y),not(know(X,Y)).
possible_know(X,Y):-friend(X,Z),love(Z,Y),not(know(X,Y)),not(X=Y).
possible_know(X,Y):-friend(X,Z),hate(Z,Y),not(know(X,Y)),not(X=Y).
possible_know(X,Y):-friend(X,Z),loved(Z,Y),not(know(X,Y)),not(X=Y).
possible_know(X,Y):-friend(X,Z),possiblelove(Z,Y),not(know(X,Y)),not(X=Y).
possible_know(X,Y):-friend(X,Z),dangerous_friend(Z,Y),not(know(X,Y)),not(X=Y).
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 7 Years ago.

Reply to "Re: Prolog - Relationship Analyze"

Here you can reply to the paste above

captcha