PREDICATES
nondeterm male(symbol)
nondeterm female(symbol)
nondeterm wife(symbol,symbol)
nondeterm mother(symbol,symbol)
nondeterm father(symbol,symbol)
nondeterm brother(symbol,symbol)
nondeterm sister(symbol,symbol)
nondeterm sonInLaw(symbol,symbol)
nondeterm brotherInLaw(symbol,symbol)
nondeterm uncle(symbol,symbol)
nondeterm sibling(symbol,symbol)
nondeterm grandson(symbol,symbol)
nondeterm grandfather(symbol,symbol)
Clauses
male(mark).
male(ahmed).
male(zeeshan).
male(summer).
female(sara).
female(sana).
wife(sara,mark).
wife(sana,ahmed).
mother(X,Y):-female(X),father(Z,Y),wife(X,Z),X<>Y.
mother(sara,sana).
father(X,Y):-male(X),mother(Z,Y),wife(Z,X),X<>Y.
brother(X,Y):-male(X),father(Z,X),father(Z,Y),X<>Y.
sister(X,Y):-female(X),father(Z,X),father(Z,Y),X<>Y.
sonInLaw(X,Y):-male(X),father(Y,Z),wife(Z,X) ; male(X),mother(Y,Z),wife(Z,X),X<>Y.
brotherInLaw(X,Y):-male(X),sister(Z,X),wife(Z,Y).
sibling(X,Y):-brother(X,Y);sister(X,Y),X<>Y.
uncle(X,Y):- sibling(X,Z),father(Z,Y),X<>Y.
grandfather(X,Y):- father(X,Z), father(Z,Y);father(X,Z), mother(Z,Y),X<>Y.
grandson(X,Y):- father(Z,X), father(Y,Z);father(Z,X), mother(Y,Z),X<>Y.
Goal
uncle(mark,sana).
我的 Prolog 给了我错误 1010。