Friday, July 1, 2011

Re: ::::|| VU ||:::: Need Help

 make it in ur own word
cs402 GDB
 
 
All regular languages can be generated by CFGs. Some nonregular languages can  be generated by CFGs but not all possible languages can be generated by CFG, e.g. the CFG     S --> aSb | ab generates the language {anbn:n=1,2,3, …}, which is nonregular.

 

Note: It is to be noted that for every FA, there exists a CFG that generates the language accepted by this FA.

 

 

 

a,b

 

a

 

b

 

a

 

b

 

S -

 

B+

 

A

 

Consider the language L expressed by (a+b)*aa(a+b)* i.e.the language of strings, defined over ={a,b}, containing aa. To construct the CFG corresponding to L, consider the FA accepting L, as follows

 

               

 

 

 

 

 

CFG corresponding to the above FA may be

                S --> bS | aA

                A --> aB | bS

                B --> aB | bB |

It may be noted that the number of terminals in above CFG is equal to the number of states of corresponding FA where the nonterminal S corresponds to the initial state and each transition defines a production.

 

Semi-word, Word and Theorem

 

 

Semiword

A semiword is a string of terminals (may be none) concatenated with exactly one nonterminal on the right i.e. a semiword, in general, is of the following form

               

(terminal)(terminal)… (terminal)(nonterminal)

 

word

A word is a string of terminals. is also a word.

 

Theorem

If every production in a CFG is one of the following forms

Nonterminal --> semiword

Nonterminal --> word

then the language generated by that CFG is regular.

 

 

 

 

 

A CFG is said to be a regular grammar if it generates the regular language i.e. a CFG is said to be a regular grammar in which each production is one of the two forms

                Nonterminal --> semiword

                Nonterminal --> word

 


 

Examples

The CFG  S --> aaS | bbS | is a regular grammar. It may be observed that the above CFG generates the language of strings expressed by the RE (aa+bb)*.

The CFG S --> aA|bB, A --> aS | a, B --> bS | b is a regular grammar. It may be observed that the above CFG generates the language of strings expressed by RE (aa+bb)+.  

 

Following is a method of building TG corresponding to the regular grammar.

 

 

 

 

 



On Fri, Jul 1, 2011 at 9:26 AM, GUJJAR <mc100401713@vu.edu.pk> wrote:
plz share any one GDB of cs 402

On 7/1/11, Syed Shujaat Ali <bc090202244@gmail.com> wrote:
> Please send me Solution of STA301     Assignment # 4. and solved quiz of
>  CS610 Quiz No:3
>
> MCM301 Quiz 05
>
> Also
>  Graded Discussion Boards of CS402
> thanks
>
> --
> For study materials, past papers and assignments,
> Join VU School at www.VusCool.com
> and  www.VUGuys.com
> CoooL Virtual University Students Google Group.
> To post to this group, send email to coool_vu_students@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/coool_vu_students?hl=en
>

--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and  www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment