You are here: Home - CS508 - CS508 Assignment no 03 fall 2013 idea Solution
CS508 Assignment no 03 fall 2013 idea Solution
Assignment No. 03
Semester: Fall 2013
Modern Programming Languages (CS508)
Total Marks: 15
Due Date: 23/01/2014
Please read the following instructions carefully before submitting assignment:
You will submit your assignment before or on due date on VU-LMS.
Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
You should submit your MS Word File via assignment interface at VU-LMS.
Assignment sent via Email will not be replied and accepted/graded in any case.
If the submitted assignment does not open or file is corrupt, it will not be graded.
You will submit solution only in Microsoft Word File.
To understand and familiarize with Prolog Language.
For any query about the assignment, contact at firstname.lastname@example.org or through MDB.
Suppose you have the following observational data about sports students.
Nadia plays Basket Ball.
Maheen plays Basket Ball.
Sameena plays Basket Ball.
Raheel plays Basket Ball.
Fawaz plays Basket Ball.
Noureen plays Badminton.
Fahmeeda plays Badminton.
Zafar plays Cricket.
Fahad plays Cricket.
Noureen plays Cricket.
Imran Khan plays Cricket.
Fahad plays Badminton.
Sameena plays Badminton.
Raheel plays Badminton.
Zafar plays Badminton.
1. Now being a prolog programmer answer the following questions:
Question # 1 Marks 5
Write the prolog rules for the followings.
I. If one plays Basket Ball and Badminton then one likes Football.
II. If one plays Cricket and Badminton then one likes Football and Polo
III. If one plays only Cricket then one likes Polo.
IV. If one plays Cricket and Basket Ball then one is Smart.
V. If one plays Basket Ball then one is Active.
Question # 2 Marks 10
Write the prolog queries for the followings. These queries will be executed according to the facts and rules defined for the above given data and perform all steps to write the output of the given queries.
a. Who is P that likes Football ?
b. Who is Q that likes Football and Polo?
c. Who is R that likes polo ?
d. Does Raheel play Basket Ball?
e. Do zafar and Imran Khan play Cricket?
f. Does X play Basketball and Badminton?
Note: In queries where variables are used along with answer write all the possible matches either they are true or not.