/* family.pl * * Example for CS 313 * * to load, use "consult(family)." or the shorthand "[family]." */ l :- consult(family). /* simple reload */ female(amy). female(anna). male(daniel). male(peter). parents(peter, amy, daniel). /* child, mother, father */ parents(anna, amy, daniel). sisterOf(X, Y) :- female(X), parents(X, Mother, Father), parents(Y, Mother, Father), X \= Y. father(X) :- male(X), parents(_, _, X). /* Try these queries: ?- sisterOf(anna, peter). ?- sisterOf(anna, amy). ?- parents(peter, X, Y). ?- sisterOf(X, anna). ?- sisterOf(X, Y). ?- father(X). */