The document outlines a lab assignment for an Artificial Intelligence course that involves creating a family tree using Prolog programming. It includes instructions for submission, a knowledge base of family relationships, and tasks such as identifying errors, generating family relation rules, and answering specific queries about the family tree. Students are required to provide source code and output screenshots for their solutions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
8 views2 pages
AI LAB 2 Assignment
The document outlines a lab assignment for an Artificial Intelligence course that involves creating a family tree using Prolog programming. It includes instructions for submission, a knowledge base of family relationships, and tasks such as identifying errors, generating family relation rules, and answering specific queries about the family tree. Students are required to provide source code and output screenshots for their solutions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
ARTIFICIAL INTELLIGENCE
Lab Assignment -2
Instructions:
1. Assignment must be uploaded in PDF with following naming convention:
“AdmNO_Name_LabAssig_1” over Classroom. 2. Prolog Programming language has to be used to solve the questions 3. The source code must be written against each question followed by output screen shot.
Questions:
Use following predicates as knowledge base to create a family tree.
parent(motilal,javaharlal). parent(motilal,vijyalakshmi). parent(motilal,krishna). parent(swarupmati,javaharlal). parent(swarupmati,vijyalakshmi). parent(swarupmati,krishna). male(motilal). female(swarupmati). male(javaharlal). female(kamla). parent(javaharlal,indira). parent(kamla,indira). female(indira). male(firoz). parent(indira,sanjay). parent(firoz,sanjay). parent(indira,rajiv). parent(firoz,rajiv). male(sanjay). female(menka). parent(sanjay,varun). parent(menka,varun). male(rajiv). female(sonia). parent(rajiv,rahul). parent(rajiv,priyanka). parent(sonia,rahul). parent(sonia,priyanka). male(varun). male(rahul). female(priyanka). female(vijyalakshmi). male(ranjit). parent(vijyalakshmi,tara). parent(vijyalakshmi,lekha). parent(vijyalakshmi,rita). parent(ranjit,tara). parent(ranjit,lekha). parent(ranjit,rita). female(tara). female(lekha). female(rita). female(krishna). 1. Identify and remove the errors/suggestions in the given knowledge base. 2. Generate rules of following relations in considering the given knowledge base: a. grandparent/2. b. brother/2. c. sister/2. d. uncle/2. e. aunt/2. f. mother/2. g. father/2. h. wife/2. i. child/2. j. son/2. k. daughter/2. 3. Answer the following queries a. Find all females in the given tree b. How many grandchild do motilal have? c. Who is/are sister of lekha? d. Who are parents of tara? e. Who are cousins of rajiv?