Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a PROLOG program that implements a family database for your family. Save it as an ordinary text file named family pro. Your program

image text in transcribed
1. Write a PROLOG program that implements a family database for your family. Save it as an ordinary text file named family pro. Your program should implement the following facts for your immediate family, grandparents, and great-grandparents parent ofX.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 ofjoe.susic). parent ofjoe,dan). parent of(mary,susie) parent ofimary,dan). male(dan). male(joc). female(susie) femalelmary). 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 ofX,Y)malecX) daughter oftX,Y) parent oft YX),femalepX) Define the following predicates for your database. Your database should be rich enough to test all of these predicates. For example, if you are only child, you may have to make up fictitious siblings to test the sibling of predicate. father of(X,Y) Xis the father of Y mother of(x,y) X is the mother of Y son of (X,Y) Xis the son of Y daughter of(X,Y) X is the daughter of Y sibling of(X,Y) X is the sibling of Y brother of(x,Y) X is the brother of Y sister of(X,Y) X is the sister of Y grandparen of(X,Y) X is the grandparent of Y ancestor of(X,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. The ancestor of predicate can be defined handle ancestors from any generation. recursively to

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

Students also viewed these Databases questions

Question

=+j on to staff their operations in the global marketplace.

Answered: 1 week ago