Facts, rules, and goals.
father(terach, avraham).
father(avraham, yitzchak).
father(avraham, yishmael).
ancestor(X, Y) :- father(X, Y).
ancestor(X, Y) :- father(X, Z), ancestor(Z, Y).
try this out. how would you write a brother rule?
Wednesday, March 01, 2006
Prolog - I
Posted by joshwaxman at 4:04 AM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment