Write a PROLOG program that implements a family database for your family. Your program should implement the following facts for your immediate family, grandparents, and great-grandparents. parent_of (X, Y). male(X). female(Y). That is, your database should consist of a number of facts about who is the parent_of of who, about which individuals are male and about which individuals are female. For example: parent_of(joe, susie). parent_of(joe, dan). parent_of (mary, susie). parent_of(mary, dan). male(dan). male (joe). female(susie). female(mary). All other predicates should be implemented as rules -- i.e., as predicates involving variables and logical implication (:-). For example, the rules for father of and daughter of would be: father_of(X, Y):- parent_of(X, Y), male(X). daughter_of(X, Y) :- parent_of(Y, X), female(X). Define the following predicates for your knowledge base. Your database should be rich enough to test all of these predicates. For example, if you are an only child, you may have to make up fictitious siblings to test the sibling_of predicate.

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

Refer to following images and provide a complete and correct program that meets the prompt!

Write a PROLOG program that implements a family database for your family. Your
program should implement the following facts for your immediate family,
grandparents, and great-grandparents.
parent_of (X, Y).
male(X).
female(Y).
That is, your database should consist of a number of facts about who is the
parent_of of who, about which individuals are male and about which individuals are
female. For example:
parent_of(joe, susie).
parent_of(joe, dan).
parent_of (mary, susie).
parent_of(mary, dan).
male(dan).
male (joe).
female(susie).
female(mary).
All other predicates should be implemented as rules -- i.e., as predicates involving
variables and logical implication (:-). For example, the rules for father of and
daughter of would be:
father of (X, Y):- parent_of(X, Y), male(X).
daughter of (X, Y) :-parent_of(Y, X), female(X).
Define the following predicates for your knowledge base. Your database should be
rich enough to test all of these predicates. For example, if you are an only child,
you may have to make up fictitious siblings to test the sibling_of predicate.
Transcribed Image Text:Write a PROLOG program that implements a family database for your family. Your program should implement the following facts for your immediate family, grandparents, and great-grandparents. parent_of (X, Y). male(X). female(Y). That is, your database should consist of a number of facts about who is the parent_of of who, about which individuals are male and about which individuals are female. For example: parent_of(joe, susie). parent_of(joe, dan). parent_of (mary, susie). parent_of(mary, dan). male(dan). male (joe). female(susie). female(mary). All other predicates should be implemented as rules -- i.e., as predicates involving variables and logical implication (:-). For example, the rules for father of and daughter of would be: father of (X, Y):- parent_of(X, Y), male(X). daughter of (X, Y) :-parent_of(Y, X), female(X). Define the following predicates for your knowledge base. Your database should be rich enough to test all of these predicates. For example, if you are an only child, you may have to make up fictitious siblings to test the sibling_of predicate.
predicate
father_of(X, Y)
mother_of(X, Y)
son_of(X, Y)
daughter_of(X, Y)
sibling_of(X, Y)
brother_of(X, Y)
sister_of(X, Y)
grandparent_of(X, Y)
ancestor_of(X, Y)
interpretation
X is the father of Y
X is the mother of Y
X is the son of Y
X is the daughter of Y
X is the sibling of Y
X is the brother of Y
X is the sister of Y
X is the grandparent of Y
X is the ancestor of Y
Some of these predicates may be defined in terms of other predicates. For
example, a sister is a female sibling and a grandparent is the parent of a parent.
When submitting your assignment include:
Your knowledge base
Your rule base
Screen shots (or the like) showing the testing of every predicate with anonymous
variables.
Transcribed Image Text:predicate father_of(X, Y) mother_of(X, Y) son_of(X, Y) daughter_of(X, Y) sibling_of(X, Y) brother_of(X, Y) sister_of(X, Y) grandparent_of(X, Y) ancestor_of(X, Y) interpretation X is the father of Y X is the mother of Y X is the son of Y X is the daughter of Y X is the sibling of Y X is the brother of Y X is the sister of Y X is the grandparent of Y X is the ancestor of Y Some of these predicates may be defined in terms of other predicates. For example, a sister is a female sibling and a grandparent is the parent of a parent. When submitting your assignment include: Your knowledge base Your rule base Screen shots (or the like) showing the testing of every predicate with anonymous variables.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Sorting
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