Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(15 points) Family tree Probably the most common first example of a logic program is that involving a family tree. Give the following family tree:

image text in transcribed

(15 points) Family tree Probably the most common first example of a logic program is that involving a family tree.

Give the following family tree:

a) Build a knowledge base using the predicate parent/2, which encodes a person is the parent of another person; male/1, which encodes a person is a male; and female/1, which encodes a person is a female.

b) Add the following rules to the knowledge base:

i. mother(X, Y), which means X is Ys mother.

ii. father(X, Y), which means X is Ys father .

iii. grandfather(X, Y), which means X is Ys grandfather. (Note: Y can have two grandfathers: one on the maternal side, the other on the paternal side.)

iv. grandmother(X, Y), which means X is Ys grandmother. (Note: Y can have two grandfathers: one on the maternal side, the other on the paternal side.)

v. siblings(X,Y). which means X and Y are siblings.

vi. You may add aunt, uncle and cousin.

c) Test your implementation by asking queries. Write down your query and also the result.

i. Who are the siblings of Lisa?

ii. List all the grandparents of Lisa?

iii. List all family members? (Note: Same type of facts and rules should be grouped together, otherwise, you will get discontiguous error and clauses will be ignored.)

ABRAHAM MONA CLANCY JACKIE HERB HOME MARGE PATTY SELMA BART LISA MAGGIE ING

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

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions