Write a Prolog program that defines family relations in compliance with the following restrictions: 1. The program shall model a fragment of your own family. However, if required, you are allowed to make additions to or deletions from your family members or relations. 2. The program shall consist of only and only the procedures described below: HEAD OF PROCEDURE: EXPLANATION: father(X, Y) (X is Y’s father) mother(X, Y) (X is Y’s mother) parent(X, Y) (X is Y’s parent) brother(X, Y) (X is Y’s brother) sister(X, Y) (X is Y’s sister) uncle(X, Y) (X is Y’s uncle) grand_uncle(X, Y) (X is Y’s grand uncle) male(X) (X is male) female(X) (X is female) PS: Take one’s uncle to be a brother of his/her father or mother and one’s granduncle to be an uncle of his father or mother.
Write a Prolog
1. The program shall model a fragment of your own family. However, if required, you are allowed to make additions to or deletions from your family members or relations.
2. The program shall consist of only and only the procedures described below:
HEAD OF PROCEDURE: EXPLANATION:
father(X, Y) (X is Y’s father)
mother(X, Y) (X is Y’s mother)
parent(X, Y) (X is Y’s parent)
brother(X, Y) (X is Y’s brother)
sister(X, Y) (X is Y’s sister)
uncle(X, Y) (X is Y’s uncle)
grand_uncle(X, Y) (X is Y’s grand uncle)
male(X) (X is male)
female(X) (X is female)
PS: Take one’s uncle to be a brother of his/her father or mother and one’s granduncle to be an uncle of his father or mother.
Step by step
Solved in 2 steps