Question
PROLOG: using kb below, answer a, b, c. female(mum). female(kydd). female(elizabeth). female(margaret). female(diana). female(anne). female(sarah). female(zara). female(beatrice). female(eugenie). male(george). male(spencer). male(philip). male(charles). male(mark). male(andrew). male(edward).
PROLOG: using kb below, answer a, b, c.
female(mum). female(kydd). female(elizabeth). female(margaret). female(diana). female(anne). female(sarah). female(zara). female(beatrice). female(eugenie).
male(george). male(spencer). male(philip). male(charles). male(mark). male(andrew). male(edward). male(william). male(harry). male(peter).
parent(george,elizabeth). parent(george,margaret). parent(mum,elizabeth). parent(mum,margareth). parent(spencer,diana). parent(kydd,diana). parent(elizabeth,charles). parent(elizabeth,anne). parent(elizabeth,andrew). parent(elizabeth,edward). parent(philip,charles). parent(philip,anne). parent(philip,andrew). parent(philip,edward). parent(diana,william). parent(diana,harry). parent(charles,william). parent(charles,harry). parent(anne,peter). parent(anne,zara). parent(mark,peter). parent(mark,zara). parent(andrew,beatrice). parent(andrew,eugenie). parent(sarah,beatrice). parent(sarah,eugenie).
a) Enter the information from this family tree as a set of Prolog facts using only the three predicates wife, son and daughter. Note, the females are: Mum, Kydd, Elizabeth, Margaret, Diana, Anne, Sarah, Zara, Beatrice, and Eugenie. b) Now add Prolog rules that will allow you to infer information for the predicates husband, spouse, child, parent, grandChild, greatGrandParent, brother, sister, aunt, uncle, brotherInLaw, sisterInLaw and firstCousin. You may not use any facts other than those from part (a), but you may create rules for additional predicates if you find that helpful. You may look up the definitions of terms like aunt, uncle, brother-in-law, sister-in-law, and first cousin in the dictionary, in order to be certain that you have captured their full meaning. Please attach a printout of your program to your submission. c) Test your Prolog program by asking it the following questions. Note, in some cases, it may be impossible to avoid getting the same answer more than once for a query. i) Who is Sarahs husband? ii) Who are Elizabeths grandchildren? iii) Who are Zaras great-grandparents? iv) Who are Dianas sisters-in-law? v) Who are Beatrices uncles?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started