Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please answer questions in pic, not previous answers of: ---- INFORMATION: male(dicky). male(randy). male(mike). male(don). male(elmer). female(anne). female(rosie). female(esther). female(mildred). female(greatgramma). male(blair). male(god). female(god). ...
please answer questions in pic, not previous answers of: ---- INFORMATION:
male(dicky).
male(randy).
male(mike).
male(don).
male(elmer).
female(anne).
female(rosie).
female(esther).
female(mildred).
female(greatgramma).
male(blair).
male(god).
female(god). ...
4. [201 Use Prolog (e.g., SWI-Prolog) to create a knowledge base for the family tree of Figure 1 and then ask queries about the family tree. Assume the intended interpretation of all predicates of the form p(x.y) is that "x is the p of y" George r-Kydd Elizabeth =Philip Margaret Diana=Charles Anne-Mark Andrew=Sarah E William Harry Peter Zara Beatrice Eugenie Figure 1. A typical family tree. The symbol-connects spouses and arrows point to children. 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 a) 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 Sarah's husband? ii) Who are Elizabeth's grandchildren? iii) Who are Zara's great-grandparents? iv) Who are Diana's sisters-in-law? v) Who are Beatrice's uncles? Include a printout that shows your query and the program's responses (you may simply copy this from SWI-Prolog's main window)
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