Sub.: computation theory computer dep.
Time: 70 minutes 2010-2011
Second exam
|
Q1: Consider the following regular grammar(G)
L: S ®bF S ®aS F ®? F ®bF F ®aF
(a) Write a language (L) that accepted by G
(b) Construct an FSA that accepts L.
Q2 :Below is the state transition table for NFSA
|
Old state
|
Input read
|
New state
|
|
0
|
L
|
1
|
|
0
|
a
|
0
|
|
0
|
b
|
0
|
|
0
|
b
|
2
|
|
1
|
b
|
2
|
Hint: 0 is start state and 2 is the final state
a. draw the transition diagram
b. convert NFSA into DFSA
Q3:a. Write the BNF of if statement in c languge.
b. from below Grammar
E®T|T+E
T®F|F*T
F®0|1|…|9|(E)
Write the parse tree of (3+7)*2
Q4: Fill the following blanks:
1- if : U={1,2,3,4,5,6} and A={3,5,6} then =…………….
2- An alphabet of cardinality 2 is called ……………….
3- a = 01, then a0 =…….. , a1 = 01, a2 = 0101, and a3 = 010101.
4- each Type of grammar G is defined as a mathematical system consisting of a quadruple ……………..
5- …………. is a metalanguage used to describe the grammar of a programming language
Good Luck
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .