Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions