AI LAB Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

AI LAB Assignment

1. What is fact? Write a PROLOG program of the


Family tree as shown in figure 1,
ask the following questions and test or
validate the answers.
a) Whether Pam is the parent of Bob?
b) Whether Bob is the parent of pat?
c) Who are the bob’s children?
d) Who is the parent of Ann and Pat?

Figure: 1 (A family tree)


2. What is rule? Write a PROLOG program of the Family tree as shown in figure 1, and
also include male, female clauses in this program. Ask the following questions and test or
validate the answers.
a) Write the rule to verify whether Liz is an offspring of tom.
b) Write the rule to verify whether Ann is an offspring of tom.
c) Write the rule to verify sister relations.
3. What is rule? Write a PROLOG program of the Family tree as shown in figure 1, and
also include male, female clauses in this program. Ask the following questions and test or
validate the answers.
a) Write the rule to verify whether Pam is a grandparent of Ann.
b) Write the rule to verify whether Jim is an offspring of Liz.
c) Write the rule to verify brother relations.
4.
a) Write a PROLOG program to verify whether a line-segment is vertical or horizontal.
b) Write a PROLOG program to compute the area of a circle?
c) Write a PROLOG program to find the factorial of a number.
5.
a) Write a PROLOG program to add an item to a list and deleting an item from a list.
b) Write a PROLOG program to compute the area of a triangle?
c) Write a PROLOG program to find the GCD of two numbers.
AI LAB Assignment

6. From the following family tree find the relation parent, mother, father, sister, brother, uncle
and aunt, grandparent, grandmother and ancestor relations.

You might also like