Family tree — Probably the most common first example of a logic program is that involving a family tree. Give the following family tree (see attached screenshot) a) Build a knowledge base using the predicate parent/2, which encodes a person is the parent (biological, not by marriage) 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 Y’s mother. father(X, Y), which means X is Y’s father . grandfather(X, Y), which means X is Y’s grandfather. (Note: Y can have two grandfathers: one on the maternal side, the other on the paternal side.) grandmother(X, Y), which means X is Y’s 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.)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Family tree — Probably the most common first example of a logic program is that involving a family tree. Give the following family tree (see attached screenshot)

a) Build a knowledge base using the predicate parent/2, which encodes a person is the parent (biological, not by marriage) 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:
  1. i.   mother(X, Y), which means X is Y’s mother.
  2. father(X, Y), which means X is Y’s father .

  3. grandfather(X, Y), which means X is Y’s grandfather. (Note: Y can have two

    grandfathers: one on the maternal side, the other on the paternal side.)

  4. grandmother(X, Y), which means X is Y’s grandmother. (Note: Y can have two

    grandfathers: one on the maternal side, the other on the paternal side.)

  5. v.   siblings(X,Y). which means X and Y are siblings.
  6. 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.)
This image is a family tree depicting connections among several characters from the television series "The Simpsons" and "Futurama." It outlines the familial relationships and showcases the lineage through images and names of each character.

### Family Tree Breakdown:

1. **Top Generation:**
   - **Abraham Simpson**
   - **Mona Simpson**
   - **Clancy Bouvier**
   - **Jackie Bouvier**

2. **Middle Generation:**
   - **Herb Powell** (Child of Abraham Simpson and unidentified partner)
   - **Homer Simpson** (Child of Abraham and Mona Simpson)
   - **Marge Bouvier Simpson** (Child of Clancy and Jackie Bouvier)
   - **Patty Bouvier** (Sister of Marge; child of Clancy and Jackie Bouvier)
   - **Selma Bouvier** (Sister of Marge; child of Clancy and Jackie Bouvier)

3. **Lower Generation:**
   - **Bart Simpson** (Child of Homer Simpson and Marge Bouvier Simpson)
   - **Lisa Simpson** (Child of Homer Simpson and Marge Bouvier Simpson)
   - **Maggie Simpson** (Child of Homer Simpson and Marge Bouvier Simpson)
   - **Ling Bouvier** (Child of Selma Bouvier)

### Diagram Analysis:

The diagram uses a traditional family tree structure with horizontal lines connecting spouses and vertical lines depicting parent-child relationships. The images next to each name enhance recognition by providing visual representations of the characters. Each character's placement illustrates their generational tier within the family lineage, aiding in the understanding of both immediate and extended family relationships.
Transcribed Image Text:This image is a family tree depicting connections among several characters from the television series "The Simpsons" and "Futurama." It outlines the familial relationships and showcases the lineage through images and names of each character. ### Family Tree Breakdown: 1. **Top Generation:** - **Abraham Simpson** - **Mona Simpson** - **Clancy Bouvier** - **Jackie Bouvier** 2. **Middle Generation:** - **Herb Powell** (Child of Abraham Simpson and unidentified partner) - **Homer Simpson** (Child of Abraham and Mona Simpson) - **Marge Bouvier Simpson** (Child of Clancy and Jackie Bouvier) - **Patty Bouvier** (Sister of Marge; child of Clancy and Jackie Bouvier) - **Selma Bouvier** (Sister of Marge; child of Clancy and Jackie Bouvier) 3. **Lower Generation:** - **Bart Simpson** (Child of Homer Simpson and Marge Bouvier Simpson) - **Lisa Simpson** (Child of Homer Simpson and Marge Bouvier Simpson) - **Maggie Simpson** (Child of Homer Simpson and Marge Bouvier Simpson) - **Ling Bouvier** (Child of Selma Bouvier) ### Diagram Analysis: The diagram uses a traditional family tree structure with horizontal lines connecting spouses and vertical lines depicting parent-child relationships. The images next to each name enhance recognition by providing visual representations of the characters. Each character's placement illustrates their generational tier within the family lineage, aiding in the understanding of both immediate and extended family relationships.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Predicate
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education