Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All must be in prolog - Create a rule grandchild which is true when one person is the grandchild of another. ANSWER: - Create a

All must be in prolog image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
- Create a rule "grandchild which is true when one person is the grandchild of another. ANSWER: - Create a rule "descendent" which is true when one person is the descendent of another. ANSWER: 4. Having the previous tree graph, answer the provided queries using the constructed knowledge base in questions 2 and 3. ( 0.25 marks) ANSWER: - ?- cousin(A,B). ANSWER: - ?- grandchild(A, B). ANSWER: ?- descendent(A, B). ANSWER: 2. Represent the following tree graph in Prolog using the following facts: parent, male, and female. (0.25) 3. Represent the following in Prolog (0.25 marks) - Create a rule "brother" which is true when two persons are brothers. ANSWER: - Create a rule "cousin" which is true when two persons are cousins. 1. Describe the following rules ( 0.25 marks) - is_mother(Mum):-mother(Mum,Child). ANSWER: - is_father(Dad):-father(Dad,Child). ANSWER: - is_son(Son):-parent(Par,Son),male(Son). ANSWER: - sister_of(Sis,Pers):- parent(Par,Sis),parent(Par,Pers), female(Sis),not(Sis,Pers). ANSWER: 1. Describe the following rules ( 0.25 marks) - is_mother(Mum):-mother(Mum,Child). ANSWER: - is_father(Dad):-father(Dad,Child). ANSWER: - is_son(Son):-parent(Par,Son),male(Son). ANSWER: - sister_of(Sis,Pers):- parent(Par,Sis),parent(Par,Pers), female(Sis),not(Sis,Pers)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions