   Just a logical problem
  From these series of statements :[1]mary loves fred[2]fred hates paula[3]paula loves harry[4]harry hates mary[5]harry loves abby[6]abby hates john[7]karen loves john[8]john hates fred[9]fred loves harry[10]paula hates abbyI need to show why [10] results from 1-9. I never done these types of problemsbut I thought I should draw a graph. By doing that, I came to conclusion that[10] follows from [6]<->[8]<->[2].Thus there is a way from [2] - > [6] and thus paula hates abby.Is this correct? any alternative solutions?   
  Paula loves Harry and Harry loves Abby. Of course Paula hates Abby: She's jealous. :)Not much of a logical problem if the rules are not explained.   ;  That's easy, Paula hates Abby because she (Paula) loves Harry and harry loves Abby.As it wasn't stated that Paula is bisexual or that she is into threesomes, then she must hate Abby with all her heart!And Harry is teh winna!EDIT: Damn! Beaten! :)   ;  >> Paula loves Harry and Harry loves Abbywas that a joke?   ;  I haven't thought it throughtfuly but I'm guessing that the rule is that if a first loves a second and the second loves a third, then the first hates the third.What kind of program were you expected to write?   ;  Looks like a perfect problem for solving using Prolog to me. I haven't written Prolog in several years and don't even have it installed, so bear with me.loves(mary, fred).hates(fred, paula).loves(paula, harry).hates(harry, mary).loves(harry, abby).hates(abby, john).loves(karen, john).hates(john, fred).loves(fred, harry).loves(A, B) := loves(B, A).% The enemy of my enemy is my friend:loves(A, C) :- hates(A, B), hates(B, C), \+ hates(A, C).% A friend of my friend is my friend also:loves(A, C) :- loves(A, B), loves(B, C), \+ hates(A, C).hates(A, B) := hates(B, A).% The enemy of my friend is my enemy also:hates(A, C) :- loves(A, B), hates(B, C), \+ loves(A, C).? hates(paula, harry);Quote:Original post by iMalcLooks like a perfect problem for solving using Prolog to me. I haven't written Prolog in several years and don't even have it installed, so bear with me.*** Source Snippet Removed ***The rules you are writing in Prolog should be part of the description of the problem. None of them are obviously implied by the meanings of "love" and "hate". I can love someone that hates me. In a three-way conflict, A hates B, B hates C and C hates A. And two of my friends can hate each other.We don't have a well-posed problem, so no solution is possible.   ;  You are missing some rules.You need a "everyone who loves someone loves everyone they love" or "everyone who loves someone hates everyone that they hate" type rule to be able to do anything, otherwise there is no correlation between any two statements.