This is an old revision of the document!
Predikat sister(X, Y)
velja natanko takrat, kadar je X
sestra od Y
. Primer klica:
?- sister(X, patricia). X = vanessa.
Povezave so podane s predikatom parent/2
. Predikata male/1
in female/1
določata spol vsake osebe (vozlišča).
parent(tina,william). parent(thomas,william). parent(thomas,sally). parent(thomas,jeffrey). parent(sally,andrew). parent(sally,melanie). parent(andrew,joanne). parent(jill,joanne). parent(joanne,steve). parent(william,vanessa). parent(william,patricia). parent(vanessa,susan). parent(patrick,susan). parent(patricia,john). parent(john,michael). parent(john,michelle). parent(frank,george). parent(estelle,george). parent(morty,jerry). parent(helen,jerry). parent(jerry,anna). parent(elaine,anna). parent(elaine,kramer). parent(george,kramer). parent(margaret,nevia). parent(margaret,alessandro). parent(ana,aleksander). parent(aleksandr,aleksander). parent(nevia,luana). parent(aleksander,luana). parent(nevia,daniela). parent(aleksander,daniela). male(william). male(thomas). male(jeffrey). male(andrew). male(steve). male(patrick). male(john). male(michael). male(frank). male(george). male(morty). male(jerry). male(kramer). male(aleksandr). male(alessandro). male(aleksander). female(tina). female(sally). female(melanie). female(joanne). female(jill). female(vanessa). female(patricia). female(susan). female(michelle). female(estelle). female(helen). female(elaine). female(anna). female(margaret). female(ana). female(nevia). female(luana). female(daniela).
sister(X, Y) :- parent(Z, X), parent(Z, Y), female(X), X \== Y.