KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
Would you like to react to this message? Create an account in a few clicks or log in to continue.

KING'S IT WORLD


 
HomeHome  GalleryGallery  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  
Search
 
 

Display results as :
 
Rechercher Advanced Search
kings it world text ad
KINGSITWORLD CALENDAR
Follow me on G+
KINGSITWORLD WEATHER
Latest topics
» QURAN MAJEED KE TAFSEER
cs508 3rd assignment  solution fal 2010 Icon_minitimeMon Aug 20, 2012 2:59 am by YOUSUFHALI

» PHY301 CIRCUIT THEORY REFERENCE BOOK
cs508 3rd assignment  solution fal 2010 Icon_minitimeWed Jul 25, 2012 11:36 am by shabbir1915

» MTH202 ASSIGNMENT NO 3 SOLUVED
cs508 3rd assignment  solution fal 2010 Icon_minitimeMon Jun 11, 2012 9:51 am by jaffarhussain

» Retrieve the DTC In the Jewel Module of 1995 Ford
cs508 3rd assignment  solution fal 2010 Icon_minitimeThu May 31, 2012 11:51 am by obd2tool

» How you can Obvious the Check Engine Light on the
cs508 3rd assignment  solution fal 2010 Icon_minitimeThu May 31, 2012 11:43 am by obd2tool

» send free sms and send free sms update on facebook
cs508 3rd assignment  solution fal 2010 Icon_minitimeTue May 15, 2012 8:33 pm by rizwan269

» United Bank Limited (UBL) - Fee Deposit
cs508 3rd assignment  solution fal 2010 Icon_minitimeThu May 10, 2012 3:33 pm by irumnaz

» PHOTO MIXER SOFTWARE
cs508 3rd assignment  solution fal 2010 Icon_minitimeFri Apr 20, 2012 10:02 am by sacredwkb

» Entrepreneurship Survey
cs508 3rd assignment  solution fal 2010 Icon_minitimeThu Mar 08, 2012 2:20 pm by Admin

» Fall 2011 Semester Result Announced
cs508 3rd assignment  solution fal 2010 Icon_minitimeThu Mar 08, 2012 2:19 pm by Admin

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
kings it world text ad
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website
visitors counter
cs508 3rd assignment  solution fal 2010 Image
Powered by website analytics technology.
Keywords
MGMT611 MGT502 2011 assignment term final 2010 paper HRM611
kings it world text ad
FLAG COUNTER
free counters
LIVE TRAFFIC

 

 cs508 3rd assignment solution fal 2010

Go down 
AuthorMessage
Admin
Admin
Admin


Scorpio
Posts : 638
Points : 2155
Reputation : 19
Join date : 2010-05-15
Age : 36
Location : islamabad

cs508 3rd assignment  solution fal 2010 Empty
PostSubject: cs508 3rd assignment solution fal 2010   cs508 3rd assignment  solution fal 2010 Icon_minitimeThu Jan 06, 2011 12:53 pm

Q1: (a) How to define the list in PROLOG Language; also differentiate between facts and patterns? [3]
Answer:

PROLOG Language:

Basically prolog language is based on predicate logics which use to said as it is closed to the world of assumptions and predictions, it use to cover up knowledge and data base control in the language it does not support any distinction between input and output usually PROLOG, since they add the possibility to have a structure that does not have a predefined number of such elements.

Welcome to the Prolog book. This book can serve as a textbook or tutorial for anyone who wants to learn the Prolog programming language. No prior programming experience is required. Some basic knowledge of logic can come in handy. For those new to the subject, a short introduction to logic is given, but this is not required reading.
The first chapters of the book (under Basics) describe the central syntax and features of the language. The next section, Programming, explores additional concepts that are useful when programming in Prolog. The chapters under Basics and Programming are meant to be read in order.




list in PROLOG Language:

According to the List it is basically a structure of the form [t1;t2;::::::::::::::::;tn] where every ti is a prolog term. The first term t1 is called the head of the list. The remaining part of the list, [t2; : : : ; tn] is called the tail. The empty list is denoted by [].


Difference between facts and patterns

A fact is basically presently what it appears to be , a fact. A fact in everyday language is often a proposition like "It is sunny today'' or "It is summer.''
In Prolog such facts could be represented as follows:
'It is sunny today '.
'It is summer'.
A fact is analogous to a base case in a proof. It is a piece of information that is known and is a special case of a rule. Facts are also known as unconditional Horn Clauses. The general case of a Horn clause is:
P if Q1 and Q2 . . . and Qn
where a fact is simply P with no conditional statements Q1, Q2 . . . .
Facts are used to represent unchanging information about objects and their relationships.
Only facts in the PROLOG database can be used for problem solving.
Patterns:

Consider the following sentence : 'All men are mortal' We can express this thing in Prolog by :
mortal(X) :- human(X).
The clause can be read as 'X is mortal if X is human'.





(b): Why this symbol “|” is used in PROLOG language? [3]

Answer:

The following vertical bar ‘|’ is used in prolog language to separate the head and tail of a list.
Example:
[1 | [2, 3] ]
[1, 2, 3 | [ ] ]




(c): Write down the two types of Constant that can be defined in PROLOG language with example? [4]

Answer:
There are two types of constants in Prolog
• atoms
• numbers.
Atoms:

Well there are four types of atom


a) Alphanumeric atoms - alphabetic character sequence starting with a lower case letter. Examples: apple a1 apple_cart
b) An atom is a general-purpose name with no inherent meaning. Examples of atoms include x, blue, 'Taco', and 'some atom'.
c) Quoted atoms - sequence of characters surrounded by single quotes. Examples: ‘Apple’ ‘hello world’
d) Symbolic atoms - sequence of symbolic characters. Examples: & < > * - + >>
e) Special atoms. Examples: ! ; [ ] {}

Numbers
Numbers can be floats or integers.
Well the numbers include integers and floating point numbers. Examples: 0 1 9821 -10 1.3 -1.3E102.



Q2: Write down the drawbacks of PROLOG language. [5]

Answer:
Welcome to the Prolog book. This book can serve as a textbook or tutorial for anyone who wants to learn the Prolog programming language. No prior programming experience is required. Some basic knowledge of logic can come in handy. For those new to the subject, a short introduction to logic is given, but this is not required reading.
The first chapters of the book (under Basics) describe the central syntax and features of the language. The next section, Programming, explores additional concepts that are useful when programming in Prolog. The chapters under Basics and Programming are meant to be read in order.
The section Built-in Predicates deals with the functions available in many Prolog compilers. These and other chapters can be read in any order.
Prolog is a logical and a declarative programming language. The name itself, Prolog, is short for PROgramming in LOGic. Prolog's heritage includes the research on theorem provers and other automated deduction systems developed in the 1960s and 1970s.
Programming in Prolog is very different from programming in a traditional procedural language like Pascal where as prolog is the major example of a fourth generation programming language supporting the declarative programming paradigm.
Prolog consists of a series of rules and facts. A program is run by presenting some query and seeing if this can be proved against these known rules and facts. A programming language is a formal language for some form of problem solving. It is to be distinguished from design languages such as hardware description languages, and other descriptive languages such as document description languages (e.g. SGML and HTML) or grammars.


Well Prolog is a declarative programming language where we only specify what we need rather than how to do it. It has a simple concise syntax with built-in tree formation and backtracking which generates readable code which is easy to maintain.



Back to top Go down
 
cs508 3rd assignment solution fal 2010
Back to top 
Page 1 of 1
 Similar topics
-
» MGT501 ASSIGNMENT NO 2 SOLUTION FALL 2010
» CS101 ASSIGNMENT NO 3 SOLUTION FALL 2010
» cs201 assignment no 3 solution fall 2010
» IT430 FALL 2010 ASSIGNMENT NO 2 SOLUTION
» ISL201 ASSIGNMENT NO 2 SOLUTION FALL 2010

Permissions in this forum:You cannot reply to topics in this forum
KING'S IT WORLD :: EDUCATION :: ASSIGNMENTS-
Jump to: