Тема: Определить кто чей отец и мать
predicates
parent(symbol,symbol)
woman(symbol)
man(symbol)
father(symbol,symbol)
mother(symbol,symbol)
clauses
parent(barbara,liza).
parent(liza,alex).
parent(alex,kostya).
parent(anna,katya).
parent(katya,juli).
parent(juli,lyuda).
parent(anna,petr).
parent(petr,alex).
parent(petr,alexandr).
parent(alexandr,lyuda).
parent(sergey,katya).
parent(sergey,petr).
parent(tatiana,mihail).
parent(dmitriy,mihail).
parent(mihail,juli).
parent(valera,nikolay).
parent(nikolay,raisa).
parent(raisa,kostya).
woman(barbara).
woman(liza).
woman(anna).
woman(katya).
woman(juli).
woman(lyuda).
woman(tatiana).
woman(raisa).
man(alex).
man(kostya).
man(petr).
man(alexandr).
man(sergey).
man(mihail).
man(dmitriy).
man(valera).
man(nikolay).
father(X,Y):-
parent(X,Y),
man(X).
mother(X,Y):-
parent(X,Y),
woman(X).
goal
father(Ot,Sun),
write(Ot," father ",Sun," || ");
mother(Mam,Reb),
write(Mam," mother ",Reb,"||").