Question: In The language Java. Also use SWI-Prolog Given the datatbase of facts below, add the rules for mother(X,Y) and father (X,Y) to the database. Here,
In The language Java. Also use SWI-Prolog
Given the datatbase of facts below, add the rules for mother(X,Y) and father (X,Y) to the database. Here, for example, mother(X,Y) means X is a mother of Y. Same idea for father(X,Y).
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).
mother(X,Y) :-
So, directly above I started the mother rule giving you the left side of the rule, i.e., mother(X,Y), and you have to write the right side of the rule. Also, write the rule for father. Notice the period at the end of each element in the database and a period is also needed at the end of a rule.
After you have figured out the 2 rules enter everything above, i.e., the database consisting of all the predicates for parent and female or male, and the 2 rules, one for mother and one for father,
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
