Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

03. Suppose someone has already written Prolog clauses that define the following relationships: father(X,Y) /* X is the father of Y */ mother(X,Y) /* X

image text in transcribed
03. Suppose someone has already written Prolog clauses that define the following relationships: father(X,Y) /* X is the father of Y */ mother(X,Y) /* X is the mother of Y*/ male(X) /* X is male */ female(x) /* X is female */ parent(X,Y) /* X is a parent of Y*/ diff(X,Y) /* X and Y are different */ Write Prolog clauses (rule) to define the following relationships: is_mother(X) /* X is a mother */ is_father(x) /* X is a father */ is_son(x) /* X is a son 7 sister_of(X,Y) /* X is a sister of Y*/ grandpa_of(X,Y) /* X is a grandfather of Y*/ sibling(X,Y) /* X is a sibling of Y*/ For example, we could write a rule for aunt, provided we were supplied with (or wrote) rules for female, sibling, and parent. aunt(X, Y) :- female(x), sibling(X, Z), parent(Z,Y). This could also be written: aunt(X,Y) - sister_of(X, Z), parent(Z,Y)

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

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago