如何在 Prolog 中定义相对规则?
这是我到目前为止得到的:
spouce(X,Y) :-
wife(X,Y).
spouce(X,Y) :-
husband(X,Y).
relative-by-blood(X,Y) :-
ancestor(Z,X),
ancestor(Z,Y).
relative(X,Y) :-
relative-by-blood(X,Y).
relative(X,Y) :-
spouce(X,Y).
relative(X,Y) :-
relative-by-blood(X,Z), %<- not sure what to do here.
提前致谢!