small medium large xlarge

17 Apr 2012, 03:17
David Lindelöf (14 posts)

Reading the coloring problem in Prolog, I was wondering whether it would be possible to tell Prolog that if @different(red,green)@ then one could infer that @different(green,red)@.

However, I tried defining the rule that @different(A,B) :- different(B,A)@, but running the program then never terminates.

How could I define such a rule?

  You must be logged in to comment