Re: Re: Re: Re: Prolog - Relationship Analyze

From NAT, 7 Years ago, written in Prolog, viewed 1'053 times. This paste is a reply to Re: Re: Re: Prolog - Relationship Analyze from NAT - go back
URL https://code.nat.moe/view/bd92f584/diff Embed
Viewing differences between Re: Re: Re: Prolog - Relationship Analyze and Re: Re: Re: Re: Prolog - Relationship Analyze
/* Dangerous Relationship */
dangerous_couple(X,Y):-love(X,Y),love(X,Z),hate(Z,Y),not(Y=Z).
dangerous_couple(X,Y):-love(X,Y),love(Y,X),love(X,Z),not(Y=Z).
dangerous_friend(X,Y):-friend(X,Y),friend(X,Z),hate(Y,Z),not(Y=Z).
dangerous_friend(X,Y):-friend(X,Y),love(X,Z),friend(Y,Z),not(Y=Z).
dangerous_friend(X,Y):-friend(X,Y),love(X,Z),love(Y,Z),not(X=Z).
dangerous_friend(X,Y):-friend(X,Y),love(X,Z),love(Z,Y),not(Y=Z).
dangerous_love(X,Y):-couple(X,Z),love(Y,Z),not(X=Y).
dangerous_love(X,Y,Z):-couple(X,Z),love(Y,Z),not(X=Y).
dangerous_love(X,Y):-couple(X,Z),love(Y,Z),not(X=Y).
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).
enemy(X,Y,Z):-love(X,Z),not(love(Z,X)),love(Z,Y).
enemy(X,Y,Z):-loved(X,Z),not(love(Z,X)),love(Z,Y).
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).
/* Low Possible Relationship */
low_possible_boom(X,Y):-low_possible_hate(X,Y),low_possible_hate(Y,X).
low_possible_hate(X,Y):-friend(X,Z),hate(Z,Y).
low_possible_hate(X,Y):-friend(X,Z),possiblehate(Z,Y).
low_possible_hate(X,Y):-love(X,Z),hate(Z,Y).
low_possible_hate(X,Y):-love(X,Z),possiblehate(Z,Y).
low_possible_hate(X,Y):-possible_jealousy(X,Y).
low_possible_hate(X,Y):-possible_love(X,Z),hate(Z,Y).
low_possible_hate(X,Y):-possible_love(X,Z),possiblehate(Z,Y).
low_possible_help(X,Y):-possible_friend(Y,X).
low_possible_help(X,Y):-possiblelove(Y,X).
low_possible_know(X,Y):-possible_friend(X,Y),not(know(X,Y)).
low_possible_know(X,Y):-possible_know(X,Y).
low_possible_know(X,Y):-possible_know(X,Z),possible_know(Y,Z),not(X=Y),not(know(X,Y)).
low_possible_love(X,Y):-friend(X,Y),friend(X,Z),friend(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)),not(love(X,A)).
low_possible_love(X,Y):-friend(X,Y),friend(X,Z),love(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)),not(love(X,A)).
low_possible_love(X,Y):-friend(X,Y),friend(X,Z),possiblelove(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)),not(love(X,A)).
low_possible_love(X,Y):-friend(X,Z),love(Z,Y),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)).
low_possible_love(X,Y):-friend(Z,X),hate(Y,Z),not(love(Y,X)),not(love(X,A)).
low_possible_love(X,Y):-possible_love(Y,X).
low_possible_love(X,Y):-friend(X,Y),friend(X,Z),friend(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)).
low_possible_love(X,Y):-friend(Z,X),hate(Y,Z),not(love(Y,X)).
low_possible_uneqlove(X,Y):-low_possible_love(X,Y),not(love(Y,X)),not(low_possible_love(Y,X)).
low_possible_uneqlove(X,Y):-possible_uneqlove(X,Y).
low_unclear(X,Y):-friend(X,Y),love(Y,X),not(couple(X,Y)),not(unclear(X,Y)).
low_unclear(X,Y):-friend(X,Y),low_possible_love(Y,X),not(couple(X,Y)),not(unclear(X,Y)).
low_unclear(X,Y):-unclear(X,Y).
low_unclearful(X,Y):-low_unclear(Y,X),low_unclear(Z,X),not(Y=Z).
/* Misc Relationship */
boom(X,Y):-hate(X,Y),hate(Y,X).
compet(X,Y,Z):-love(X,Z),love(Y,Z),not(X=Y).
competful(X,Y):-love(Y,X),love(Z,X),not(Y=Z).
competful(X,Y):-possible_love(Y,X),love(Z,X),not(Y=Z).
competful(X,Y):-possible_love(Y,X),possible_love(Z,X),not(Y=Z).
couple(X,Y):-love(X,Y),love(Y,X).
fakefriend(X,Y):-friend(X,Y),hate(Y,X).
hate_many(X,Y,Z):-hate(X,Y),hate(X,Z),not(Y=Z).
help(X,Y):-friend(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
help(X,Y):-love(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
jealousy(X,Y):-love(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
jealousyable(X,Y,Z):-possible_love(X,Z),possible_love(Y,Z),not(X=Y).
know(X,Y):-definedknow(X,Y).
know(X,Y):-friend(X,Y).
know(X,Y):-hate(Y,X).
know(X,Y):-love(X,Y),not(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):-uneqfriend(Y,X).
know(X,Y):-uneqlove(X,Y).
misunderstood(X,Y):-friend(Y,X),love(X,Y),not(friend(X,Y)).
never(X,Y):-love(X,Y),hate(Y,X).
play(X,Y):-love(X,Y),love(X,Z),not(Y=Z).
play(X,Y):-loved(X,Y),love(X,Z),not(Y=Z).
play(X,Y):-loved(X,Y),loved(X,Z),not(Y=Z).
play(X,Y):-possiblelove(X,Y),love(X,Z),not(Y=Z).
play(X,Y):-possiblelove(X,Y),possiblelove(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)).
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)).
unclear(X,Y):-friend(X,Y),possible_love(Y,X),not(couple(X,Y)).
unclearful(X,Y):-unclear(Y,X),unclear(Z,X),not(Y=Z).
uneqfriend(X,Y):-friend(X,Y),not(friend(Y,X)).
uneqlove(X,Y):-love(X,Y),not(love(Y,X)).
uneqplove(X,Y):-possiblelove(X,Y),not(love(Y,X)),not(possiblelove(Y,X)).
very_possible_couple_low_relationship(X,Y):-low_possible_love(X,Y),low_possible_love(Y,X). 
/* Possible Relationship */
possible_boom(X,Y):-couple(X,Y),love(Y,Z),hate(X,Z).
possible_compet(X,Y,Z):-possible_love(X,Z),love(Y,Z),not(X=Y).
possible_compet(X,Y,Z):-possible_love(X,Z),possible_love(Y,Z),not(X=Y).
possible_couple(X,Y):-friend(X,Y),love(X,Y),friend(Y,X).
possible_couple(X,Y):-friend(Y,X),possible_love(X,Y).
possible_couple(X,Y):-possible_friend(X,Y),love(X,Y),possible_friend(X,Y).
possible_couple(X,Y):-possible_love(X,Y),possible_love(Y,X).
possible_dangerous_couple(X,Y):-love(X,Y),love(X,Z),possiblehate(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),friend(X,Z),possiblehate(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_dangerous_friend(X,Y):-friend(X,Y),possible_love(X,Z),friend(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),possible_love(X,Z),loved(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),possible_love(X,Z),possible_love(Z,Y),not(Y=Z).
possible_dangerous_friend(X,Y):-friend(X,Y),friend(X,Z),possiblehate(Z,Y),not(Y=Z).
possible_enemy(X,Y):-loved(X,Z),not(love(Z,X)),possible_love(Z,Y),not(X=Y).
possible_enemy(X,Y):-possible_love(X,Z),not(love(Z,X)),love(Z,Y),not(X=Y).
possible_enemy(X,Y):-possible_love(X,Z),not(love(Z,X)),possible_love(Z,Y),not(X=Y).
possible_enemy(X,Y,Z):-loved(X,Z),not(love(Z,X)),possible_love(Z,Y),not(X=Y).
possible_enemy(X,Y,Z):-possible_love(X,Z),not(love(Z,X)),love(Z,Y),not(X=Y).
possible_enemy(X,Y,Z):-possible_love(X,Z),not(love(Z,X)),possible_love(Z,Y),not(X=Y).
possible_fakefriend:-friend(X,Y),possiblehate(Y,X).
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).
possible_hate(X,Y):-friend(X,Z),hate(Z,Y),know(X,Y),not(friend(X,Y)).
possible_hate(X,Y):-friend(X,Z),hate(Z,Y),possible_know(X,Y),not(friend(X,Y)).
possible_hate(X,Y):-love(X,Z),hate(Z,Y),know(X,Y),not(love(X,Y)).
possible_hate(X,Y):-love(X,Z),hate(Z,Y),possible_know(X,Y),not(love(X,Y)).
possible_hate(X,Y):-possible_enemy(X,Y).
possible_hate(X,Y):-possible_love(X,Z),hate(Z,Y),know(X,Y),not(possiblelove(X,Y)).
possible_hate(X,Y):-possible_love(X,Z),hate(Z,Y),possible_know(X,Y),not(possiblelove(X,Y)).
possible_hate(X,Y):-possiblehate(X,Y).
possible_hate_many(X,Y,Z):-low_possible_hate(X,Y),low_possible_hate(X,Z),not(possible_hate(X,Z)),not(Y=Z).
possible_hate_many(X,Y,Z):-possible_hate(X,Y),possible_hate(X,Z),not(Y=Z).
possible_help(X,Y):-friend(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
possible_help(X,Y):-love(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
possible_help(X,Y):-possible_friend(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
possible_help(X,Y):-possiblelove(Y,X),not(possible_hate(Y,X)),not(hate(Y,X)).
possible_jealousy(X,Y):-jealousy(X,Y).
possible_jealousy(X,Y):-loved(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
possible_jealousy(X,Y):-possible_love(X,Z),not(love(Z,X)),friend(Z,Y),not(X=Y).
possible_jealousyable(X,Y,Z):-low_possible_love(X,Z),low_possible_love(Y,Z),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),hate(Z,Y),not(know(X,Y)),not(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),loved(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).
possible_know(X,Y):-friend(X,Z),possible_love(Z,Y),not(know(X,Y)),not(X=Y).
possible_know(X,Y):-know(X,Y).
possible_know(X,Y):-possible_friend(X,Y),not(know(X,Y)).
possible_love(X,Y):-friend(X,Y),friend(X,Z),love(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)).
possible_love(X,Y):-friend(X,Y),friend(X,Z),possiblelove(Z,Y),not(Y=X),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)).
possible_love(X,Y):-friend(X,Z),love(Z,Y),know(X,Y),not(hate(X,Y)),not(possiblehate(X,Y)).
possible_know(X,Y):-know(X,Y).
possible_love(X,Y):-possiblelove(X,Y).
possible_love_infer(X,Y):-possible_love(X,Y),not(possiblelove(X,Y)).
possible_realfriend(X,Y):-possible_friend(X,Y),possible_friend(Y,X).
possible_turefriend(X,Y):-possible_friend(X,Y),possible_friend(Y,X),not(love(X,Y)),not(love(Y,X)),not(possiblelove(X,Y)),not(possiblelove(Y,X)).
possible_uneqlove(X,Y):-possible_love(X,Y),not(love(Y,X)),not(possible_love(Y,X)).
possible_uneqlove(X,Y):-uneqlove(X,Y).
very_possible_couple(X,Y):-possible_love(X,Y),possible_love(Y,X).  

Reply to "Re: Re: Re: Re: Prolog - Relationship Analyze"

Here you can reply to the paste above

captcha