Assignment No. 03 |
Total Marks: 15
Due Date: 09/07/2013 |
|
Instructions: Please read the following instructions carefully before submitting assignment:
Objectives:
To understand and familiarize with Prolog Language.
|
||
For any query about the assignment, contact at cs508@vu.edu.pk or through MDB. |
||
Assignment Questions |
||
Suppose you have the following observational data about students of college.
.
Question # 1 Marks 5
Write the prolog rules for the followings.
If one is fasting in Ramzan ul Mobarak then on is Adult. If one is Fasting in Ramzan ul Mobarak then one is rewarded by ALLAH KARIM. If one is non adult and fasting in Ramzan ul Mobarak then one is earning greater reward by Allah Karim. If one is adult and healthy and travelling then one can keep left fasts in travelling after Ramzan ul Mobarak If one is ill or of very old age feeble can give ransom for left fasts to needy
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.
Note: In queries where variables are used along with answer write all the possible matches either they are true or not.
|
||
BEST OF LUCK
|
Tags:
share to kerna pre ga deify warna phir marks kam aian gay. Isha Allah abi se start kertain hain.
adult(Zafar, fasting, Ramzan_Ul_Mubarak)
adult(Rizwan, fasting, Ramzan_Ul_Mubarak)
adult(Raza, fasting, Ramzan_Ul_Mubarak)
not adult(Imran, not fasting, Ramzan_Ul_Mobarak)
not adult(Saqib, not fasting, Ramzan_Ul_Mobarak)
are correct?
friends this assignment not so difficult, this link will help you understand the concepts of Facts, Rules and Queries..
it helped me
http://www.cs.trincoll.edu/~ram/cpsc352/notes/prolog/factsrules.html
yar Assignment kuch b nahe hay simple is assignment ka matlab hay kay sir rozy rakh rahay hay or un ko rozy lag rahay hay .... :p
Whats the Prolog Rules ? for above statements ?
AND
How to write Queries ?
Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.
yar koi idea share kary ga taky start kary solution :)
Take idea from this solution.
+ §ђȋήȋήğ ஜ๏๏ή + 39 thanks for sharing
Assignment No. 03 |
Total Marks: 15
Due Date: 23/01/2014 |
|
Instructions: Please read the following instructions carefully before submitting assignment:
Objectives:
To understand and familiarize with Prolog Language.
|
||
For any query about the assignment, contact at cs508@vu.edu.pk or through MDB. |
||
Assignment Questions |
||
Suppose you have the following observational data about sports students.
Above formal data help us to define the following database rules in prolog:
Plays(Nadia, BasketBall). Plays(Maheen, BasketBall). Plays(Sameena, BasketBall).
Plays(Raheel,BasketBall). Plays(Fawaz, BasketBall).
Plays(Noureen,Badminton). Plays(Fahmeeda, Badminton).
Plays(Zafar,Cricket). Plays(Fahad,Cricket). Plays(Noureen ,Cricket). Plays(Imran Khan, Cricket).
Plays( Fahad ,Badminton). Plays(Sameena, Badminton). Plays(Raheel, Badminton). Plays(Zafar, Badminton).
Question # 1 Marks 5
Write the prolog rules for the followings.
Solution:
Likes( Z,FootBall):-Plays(Z, BasketBall), Plays(Z, Badminton).
Likes(Z, Football &Polo):- PLays(Z,Cricket), Plays(Z,Badminton)
Or
Likes(Z, Football &Polo ):- Likes(Z,Football), Plays(Z,Cricket).
Likes(Z,Polo):-Plays(Z,Cricket).
Smart(Z):- Plays(Z,Cricket), Plays( Z,BasketBall).
Active(Z):-Plays(Z, BasketBall)
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.
Note: In queries where variables are used along with answer write all the possible matches either they are true or not.
Solution
?- Likes( P,FootBall) P=Sameena P=Raheel
?- Likes(Q, Football &Polo ) Q=Noureen Q=Zafar Q=Fahad
?-Likes(R,Polo) R =Imran Khan
?- Plays(Raheel,Basket Ball) Yes
?- Plays(Zafar, Cricket) , Plays(Imran Khan, Cricket). Yes
?- Plays(X, BasketBall) , Plays(X, Badminton). X=Sameena X=Raheel
|
||
BEST OF LUCK
|
Which one is correct please suggest it, time is very short?
1- fasting(adult, zafar) ?
2- adult(fasting Zafar) ?
Please help any body else whats the facts of rule ???
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post