as a beginner to Prolog, I found the commutative expression in Prolog are quite not intuitive.
for example if I want to express X and Y are in one family, like:
family(X,Y) :-
married(X,Y);
relative(X,Y);
father_son(X,Y).
I should also add the following to the definition, in order to make it "commutative":
married(Y,X);
relative(Y,X);
father_son(Y,X).
But we use Prolog, because we want to write elegant code... so, I'd hope to add only one line(instead of the above three) to the original :
family(Y,X).
Here is the POINT. it leads to untermination! why is prolog no so "logical"? and is there an alternative to this neat one line expression that doesn't lead to untermination?
Nice weekends! watt