Write prolog program .pl. For this problem you will build a family tree in a file called
Question:
Write prolog program .pl.
For this problem you will build a family tree in a file called family.pl. The members of that family tree may be fiction or non-fiction, so long as they fulfill the requirements below.
Establish a database of facts with the members of a family tree for the following clauses:
male(X) % X is male
female(X) % X is female
father(X,Y) %X is the father of Y
mother(X,Y) %X is the mother of Y
married(X,Y) %X is married to Y
Write prolog rules to define the following relationships:
parent(X,Y) %X is the parent of Y
is_mother(X) % X is a mother
is_father(X) % X is a father
aunt(X,Y) % X is an aunt of Y
uncle(X,Y) % X is an uncle of Y
sister(X,Y) % X is a sister of Y
brother(X,Y) % X is a brother of Y
grandfather(X,Y) % X is a grandfather of Y
grandmother(X,Y) % X is a grandmother of Y
ancestor(X,Y) % X is an ancestor of Y
Please assume "traditional" definitions for the above relationships for consistency in marking. You don't have to try to deal with complicated family structures involving things like divorces and re-marriage and subsequent step-relationships. Just stick with basic definitions.
If you are in any doubt, include your assumptions in your assignment documentation.
Make sure that you have enough facts to test each relation.
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba