Question
Implement the following in PROLOG, Google British royal family to add the newer generations to Figure 8.7 (e.g., William's wife and children, etc.) and then
Implement the following in PROLOG, Google "British royal family" to add the newer generations to Figure 8.7 (e.g., William's wife and children, etc.) and then do Exercise 8.14 on page 318 in PROLOG. However, you do not need to write mth cousin n times removed. You may add additional predicates if needed. Follow the PROLOG convention of only capitalizing variable names; e.g, ?- mother(X, charles). returns X = elizabeth. You should write enough predicates to deduce ?- grandchild(X, elizabeth). ?- brother_in_law(X, diana). ?- great_grandparent(X, zara). ?- ancestor(X, eugenie). as specified, plus ?- first_cousin(mia,X). Use the broad definition of ancestor, namely, "person decended from." Also, call the two Georges "king_george" and "prince_george." Hints: Remember gprolog requires that you place all statements for each predicate together. Also, be careful writing too many statements or you may cause an infinite loop, e.g., child(A, B) :- parent(B, A). parent(A, B) :- child(B, A). is true logically but may cause PROLOG to loop till stack space is exhausted.
8.14 Write axioms describing the predicates Grandchild , Greatgrandparent , Ancestor ,
Brother , Sister , Daughter , Son, FirstCousin, BrotherInLaw, SisterInLaw, Aunt, and
Uncle. Find out the proper definition of mth cousin n times removed, and write the definition in first-order logic. Now write down the basic facts depicted in the family tree in Figure 8.7. Using a suitable logical reasoning system, TELL it all the sentences you have written down, and ASK it who are Elizabeths grandchildren, Dianas brothers-in-law, Zaras great-grandparents, and Eugenies ancestors.
Gcorge Mum Spencer Kydd Elizabeth M Philip Margaret Diana Charles Anne N Mark Andrew Sarah Edward Sophic William Harry Peter Zara Beatrice Eugenie Louise James Figure 8.7 A typical family tree. The symbol"connects spouses and arrows point to children Gcorge Mum Spencer Kydd Elizabeth M Philip Margaret Diana Charles Anne N Mark Andrew Sarah Edward Sophic William Harry Peter Zara Beatrice Eugenie Louise James Figure 8.7 A typical family tree. The symbol"connects spouses and arrows point to childrenStep 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