Declarative Prolog HW 2
Declarative Prolog HW 2
female(mary)
male(fred)
female(anne)
male(john)
male(frank)
female(redna)
While working out the questions, you can use the rules from the previous questions, if
required. (example: rule in part 30 can be used in all questions as from 31 till the end but
x childof mary
Ans: The system starts searching the database from the beginning.It finds the fact X childof mary.X is
instantiated the value “frank”.Therefore, the system outputs X = frank.It continues to search the
database until there are no more solutions.
P siblingof Q IF …………………………………………………………………[2]
A spouseof B IF …………………………………………………………………[2]
D fatherof E IF…………………………………………………………………..[2]
F grandfatherof G IF…………………………………………………………………..[3]
H sisterof L IF…………………………………………………………………..[3]