tutorial4

Document Sample

Shared by: Honey Singh
Categories
Tags
Stats
views:
55
posted:
11/12/2007
language:
English
pages:
0
Jaypee Institute of Information Technology –Noida Theory Of Computation Tutorial –04 Context Free-Grammar Note: Ask all the students to make a tutorial notebook and all the questions given in the tutorial must be solved in it. Questions in bold are to be solved in the tutorial class only. 1.Let G={V,  ,R,E) where V,  ,r are as follows V={+,*,(,),id,T,F,E}(id means identifier. = {+,*,(,),id}  R={E E+T,E T,T T*F,T F,F (E),F id} E E+T………1 E T …………….2 T T*F…………..3 T F…………….4 F (E)…………..5 F id…………….6 The symbol E,T,F ARE EXPRESSION,TERM AND FACTOR. TO GENRATE STRING (id*id+id)*(id+id) 2.Genrate context free grammer which generates a string containing only ‘a’s 3. To generate a string in which consecutive ‘b’s can occur only but only ‘a’s’ can be consecutive. 4.Give the C.F.G. for generating an alternating sequence of 0’s and 1’s. 5. To generate the string which contains at least one occurance of ‘aaa’. 6.write the C.F.G. for genrating string which contains at least 2 a’s. 7. Write the C.F.G. to genrate the variable name . The rules for the variable names are (i)They contain alphanumeric and (ii) they will start with alphabet. 8.construct a C.F.G. generating all integers (with sign).




Share This Document


Related docs
Other docs by Honey Singh
interview
Views: 1891  |  Downloads: 182
CCNA Notes page 1
Views: 339  |  Downloads: 41
j3d_tutorial_ch6
Views: 180  |  Downloads: 6
2-Datamining_Edward
Views: 125  |  Downloads: 4
Warren Buffett_27s Invisible Empire
Views: 1487  |  Downloads: 91
Shell Programming
Views: 252  |  Downloads: 14
Economics and Language - Ariel Rubinstein
Views: 227  |  Downloads: 5
interview_question_oracle
Views: 436  |  Downloads: 101
Some Useful Linux Commands
Views: 540  |  Downloads: 77
ts
Views: 111  |  Downloads: 0
by registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!