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 meansX
isY
’s mother-in-law.Write a
grandParent(X,Y)
predicate that meansX
isY
's Grandparent.Write a
grandMother(X,Y)
predicate that meansX
isY
'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)
Family.pl
source. - Enigmativity