34 lines
589 B
Prolog
34 lines
589 B
Prolog
:- discontiguous male/1, female/1, parent/2.
|
|
male(dicky).
|
|
male(randy).
|
|
male(mike).
|
|
male(don).
|
|
male(elmer).
|
|
female(anne).
|
|
female(rosie).
|
|
female(esther).
|
|
female(mildred).
|
|
female(greatgramma).
|
|
male(blair).
|
|
|
|
parent(don,randy).
|
|
parent(don,mike).
|
|
parent(don,anne).
|
|
parent(rosie,randy).
|
|
parent(rosie,mike).
|
|
parent(rosie,anne).
|
|
parent(elmer,don).
|
|
parent(mildred,don).
|
|
parent(esther,rosie).
|
|
parent(esther,dicky).
|
|
parent(greatgramma,esther).
|
|
parent(randy,blair).
|
|
|
|
male(mel).
|
|
male(teo).
|
|
parent(melsr,mel).
|
|
parent(melsr,teo).
|
|
|
|
father(X,Y) :- male(X),parent(X,Y).
|
|
mother(X,Y) :- female(X),parent(X,Y).
|