CS402 Short Notes: For More Visit
CS402 Short Notes: For More Visit
pk
ぇ= { a , b , cd } ( Valid Alphabet)
ぇ= { a , b , ac } ( Invalid Alphabet)
QNo 6. What is ALGOL ?
Answer:ALGOL (ALGOrithmic Language) is one of several high level languages
designed specifically for programming scientific computations. It started out in the late
1950's, first formalized in a report titled ALGOL 58, and then progressed through
reports ALGOL 60, and ALGOL 68. It was designed by an international committee to
be a universal language. Their original conference, which took place in Zurich, was one
of the first formal attempts to address the issue of software portability. ALGOL's
machine independence permitted the designers to be more creative, but it made
implementation much more difficult. Although ALGOL never reached the level of
commercial popularity of FORTRAN and COBOL, it is considered the most important
language of its era in terms of its influence on later language development.
ALGOL’s lexical and syntactic structures became so popular that virtually all
languages designed since have been referred to as "ALGOL - like"; that is they have
been hierarchical in structure with nesting of both environments and control structures.
QNo7. What are the Sequential Operators? Answer:Sequencing
Operators:
Sequencing operators
a >> b Sequence Match a and b in sequence
Sequential- and
a && b
Sequential-and. Same as above, match a and b in sequence
Let our language consist of the words of length three exactly over
alphabet ┋= {a,b} then it consists of the words
L = {aaa, aab,
aba,abb,baa,bab,bba,bbb}. Its RE
We should also keep the null string in our mind. If our language generates
null string than our RE should also generate it)
For example language having all the words of even length has null string
in it as well so we can write its RE as follows
RE = ((a+b)(a+b))*
This RE also generates null string.
If a language generates all strings starting with a. then strings will
be of type a , aa, ab, aab, aaa, aba, abb,….
Here RE should start with ‘a’ and then all strings including null. So this will
be (a + b)* and complete RE is a (a+ b)*.
Similarly languages of strings ending in b will have RE (a + b)*b.
Q No.7 What is the diagrammatically difference between FA's and TG's?
The main differences between FA’s and TG’s are as follows
NFA:
be S} DC
D } AB
A} EE
| b E}a
B}c
C}d
Q No 2.In the lecture 41 's example, we have converted PDA
to conversion form and a word 'aaaabb' is derived from this
conversion form PDA. What are the derivation steps.
The PDA converted to conversion form has some specific features
that are important to understand first. These features are
The states named START, READ, HERE and ACCEPT are called
joints of the machine.
With the help of the conversion form we have been able to achieve
that POP state has only one path out of it and the path taking
(multiple paths) decisions take place only on the READ state.
The word 'aaaabb' is generated as follows from the
PDA START-POP4-PUSH $
This step pops $ and then pushes it to ensure that stack contains $ at
the beginning.
READ1-POP6-PUSH $-PUSH a
As first time after reading "a" there is $ at the top of stack so we
• Regular Languages
• Linear-bounded Automata
They differ in the following areas Complexity (or Simplicity) Power In the function that
can be computed. In the languages that can be accepted.
Question: Strings that ending in "a " and strings containing exactly one "a".
Answer:
Its means all string ending in a
e.g ┋= {a, b}
{a, aa, ba, aba, baa,…….}
Exactly a, defined over ┋=
{a, b}
{ab, ba, abb, bba,… . }
Question: What is the difference between derivation tree and total tree?
Answer: A Derivation tree is the one that shows how to derive any specific
word of the language described by CFG but Total Language Tree
Example:
Consider the following
CFG S ® XY, X ® Zb,
Y ® bW
Z ® AB, W ® Z, A ®
aA|bA|L B ®Ba|Bb|L.
Here A ® L and B ® L are null productions, while Z ® AB, W ® Z are
nullable productions.
Method:
Question: What are the difference between single 1 and 0 and double 1's and 0's?
Answer: 1. Consider the language L of strings, defined over
Join Us on http://vustudents.ning.com/
If ┋={0, 1}, having words with either 0’s or 1’s without null. The