Re: Context Free language, the language empty string (lambda)
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Mon, 30 Apr 2007 08:38:46 -0600
cyberbloke <cyberbloke@xxxxxxxxx> wrote:
Which context free language corresponds to the language empty string
(lambda):
So you want a language that derives the empty string, and nothing else.
Just derive some things with those grammars, and see what happens.
Is the following grammar ambigious:
S-->BA|bbA
A-->Aa|a
B-->b
My answer is yes it is ambigious, can you correct me if that is
incorrect and also some explanation to understand the concept...
In order to demonstrate that a grammar is ambiguous, you need only show
two different parse trees (or two different left-most or right-most
derivations) for some string in the language. If you think it is
ambiguous, you should be able to demonstrate that by picking a string
that is derived ambiguously, and giving both ways. What is such a
string, and what are its parse trees? If you could give such a thing,
then you'd know that you are right.
Showing that a grammar is not ambiguous is a little different because
you can't try all possible strings in an infinite language. You need to
demonstrate that no possible string can have two different parse trees.
This can be difficult (it's an undecidable problem), but in most cases
that are assigned in coursework, it will just require a little thought
and experimentation. A good first step is to try to show that it's
ambiguous. If you try long enough and can't do it, then you'll probably
develop a pretty good idea of why.
--
Chris Smith
.
- References:
- Context Free language, the language empty string (lambda)
- From: cyberbloke
- Context Free language, the language empty string (lambda)
- Prev by Date: Re: Context Free Grammer
- Next by Date: Re: Context Free language, the language empty string (lambda)
- Previous by thread: Context Free language, the language empty string (lambda)
- Next by thread: Re: Context Free language, the language empty string (lambda)
- Index(es):
Relevant Pages
|