Q:

Three Prolog questions include grandparent

This program will be tested using SWI Prolog.
Family.pl contains facts about family members, who is married to whom, sorts of things.
Rules must be added at the bottom and submit the modified file.

Write a motherInLaw(X,Y) predicate that means X is Y’s mother-in-law.
Write a grandParent(X,Y) predicate that means X is Y's Grandparent.
Write a grandMother(X,Y) predicate that means X is Y's Grandmother.

Thank you guys!
here are my own answers, could you please take a look and tell me if they are correct? Thanks
motherInLaw(X, Y) : mother(X, Z),couple(Z, Y)

grandParent(X, Y) : parent(X, Z),parent(Z, Y)

grandMother(Z, Y) : mother(X, Z),parent(Z, Y)

A:

You need to write :- instead of : and . at the end of each clause
The grandmother/2 predicate looks very strange. Actually I think the head of the clause should be grandMother(X,Y).

