Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

parent(jill, john). parent(john, pam). parent(pam, bob). parent(tom, bob). parent(tom, liz). parent(bob, ann). parent(bob, pat). parent(pat, jim). female(jill). female(pam). male(tom). male(bob). female(liz). female(ann). female(pat). male(jim). male(john).

parent(jill, john). parent(john, pam). parent(pam, bob). parent(tom, bob). parent(tom, liz). parent(bob, ann). parent(bob, pat). parent(pat, jim). female(jill). female(pam). male(tom). male(bob). female(liz). female(ann). female(pat). male(jim). male(john). The above is the database for the prolog programs.  For program 1, write the predicates for 1) mother(X,Y) and 2) offspring(Y,X)  Here the first is interpreted as X is a mother of Y, and the second is Y is an offspring 0f X. For program 2, write the predicates for 1) sister(X, Y) and 2) ancestor(X,Y)  Here the first one is interpreted as X is a sister Y and the second one as X is an ancestor of Y. In the sister predicate you should include the following predicate different(X,Y) := not(X,Y) This will insure that a person cannot be her own sister. Of course, this predicate must also be included in the program before its used in "sister". 

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

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago

Question

6. Is all Internet training the same? Explain.

Answered: 1 week ago