AI Assignment 1

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Institute of Engineering & Technology, DAVV Indore B.E. Computer Engg.

& Information Technology 4CO402 & 4IT402 Artificial Intelligence Lab Assignment #1
Q l: Genealogy Problem Problem 1.1: Build a knowledge base to represent the parent relationships that can be deduced from the tree.

Problem 1.2: Build predicates that describe the following family relationship a. Grandparent b. Mother c. Father d. Brother e. Sister f. Aunt g. Uncle h. Ancestor Consider following facts: male(tom) male( bob) male( Bil ) male( pat) male( jim ) female( pam) female( liz) female(ann)

Q2: Composers knowledge base Problem 2.1: build a knowledge base to represent the following composers and years of their birth and death using structures. Composers:

Problem 2.2: build rules, allowing to define whether or not a two lifetime overlap: Overlap (Birth 1 , Death 1, Birth 2, Death 2). Problem 2.3: build a rule, allowing to define whether or not a two composers are contemporaries: Contemporaries (Composer1, Composer2). Q3: Suppose we are working with the following knowledge base: hasWand(Harry). QuidditchPlayer(Harry). wizard (Ron). Wizard(X):- hasBroom(X),hasWand(X). hasBroom(X):- QuidditchPlayer(X). How does prolog respond to the following queries? wizard (Hermione). wizard (Harry). wizard (Y). Q4: Write prolog clauses for the following management system Edward manages Smith and Jackson Smith manages Jones. Harris and Peters. Harris manages Carter and Fletcher. Jackson Manages Harper. Pritchard and Glover PERSON Jones Carter Fletcher Peters Harper Pritchard RESPONSIBLE FOR Finance Sales Purchases Personnel Transport Communications

Glover

industrial Relations

A person is responsible for a task if he manages someone who is responsible for the task. Answer the following questions by interrogating the prolog database. Is smith responsible for transport? Who are responsible for communications? Who are responsible for sales and personnel? Q5: consider the fol1owing sentence. a. John likes all kinds of food. b. Apples are food. c. Anything anyone eat and is not killed by is food d. Bill eats peanuts and is still alive. e. Liz eats everything bill eats. 1. Translate these sentences into formulas in predicate logic and prolog clause form. 2. prove that john like dosa and liz likes peanuts. Q6: Consider the fol1owing sentence. a. Tom only like hard courses b. Management courses are easy c. All the courses in the engineering department are hard d. Computer engineering is a engineering department course 1. Translate these sentences into formulas in predicate logic and prolog clause form. 2. Prove that what course would tom like? Q7: Represent the following facts in Prolog a. Tom is a singer. b. Mia and John are married. c. Ravi is dead. d. John kills everyone who gives Mia a foot massage. e. Mia loves everyone who is a good dancer. f. Rahul eats anything that is nutritious or tasty. Q8: Given the relations father(X,y) X is the father of Y mother(X,Y) X is the mother of Y female(X) X is female male(X) X is male Define prolog relations for the following: a. sibling

b. sister c. grandson d. first cousin e. descendant Provide some facts for the father, mother, male and female predicates and then test the entire thing using prolog. Q9: Given predicates for married. female. and sibling write a rule for determining if someone is a sister-in-law: married(W.X).W is married to X. sibling(W.X).W is a sibling of X. female( W) W is a female You are to write the rule: sisterinlaw(W.X). This will give an answer of yes if W is the sister-in-law of X.

You might also like