Solving deductive problems using Prolog language on SWI-Prolog tool. Build a family tree of the British NAME_1 family as shown in the image below.
Build a knowledge base describing the relationships in the figure with the following predicates:
parent(Parent,NAME_2)
male(Person)
married(Person, Person)
female(Person)
divorced(Person, Person)
Define the following predicates based on the predicate above:
NAME_3(Person,Wife) grandparent(GP,GC) sibling(Person1,Person2)
wife(Person,NAME_3) grandmother(GM,GC) brother(Person,Sibling)
father(Parent,NAME_2) grandfather(GF,GC) sister(Person,Sibling)
mother(Parent,NAME_2) grandchild(GC,GP) aunt(Person,NieceNephew)
NAME_2(NAME_2,Parent) grandson(GS,GP) uncle(Person,NieceNephew)
son(NAME_2,Parent) granddaughter(GD,GP) niece(Person,AuntUncle)
daughter(NAME_2,Parent) nephew(Person,AuntUncle)
Give a set of at least 20 questions to ask the newly constructed knowledge system, for example:
- Who is NAME_4’s mother?
- Was NAME_5 the wife of NAME_6?