Question: SWI-Prolog Write your prolog code. Copy-paste your queries and their outputs in the answer The family relation is given in the picture (the arrow X

SWI-Prolog

Write your prolog code.

Copy-paste your queries and their outputs in the answer

The family relation is given in the picture (the arrow X Y symbolizes that X is a parent of Y):

SWI-Prolog Write your prolog code. Copy-paste your queries and their outputs in

Define the predicate parent(X,Y) which is true when X is a parent of Y, and the predicate male(X) (female(X)) which is true when X is a male (a female). Check the following queries:

the answer The family relation is given in the picture (the arrow Note that ; enforces Prolog interpreter to look for the next success whereas terminates search for new solutions. Check now the following queries:

X Y symbolizes that X is a parent of Y): Define the Using the above predicates define the predicates: mother(X,Y) (father(X,Y)) to be true when X is a mother (a father) of Y. Check now who is a mother of jim and of joe.

(pam tom bob liz ann pat joe jim 12 | ? - "is tom male? | ? - "who is male? ? who is a parent of liz? ? "is bob a parent of pat?" ? find parent-child relationship" |? who is a grandparent of jim? 1 ? who are tom's grandchildren

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!