Re: Context Free language, the language empty string (lambda)



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
.



Relevant Pages

  • Re: closure properties of regular languages
    ... language, and not just a subset, because you might find an L and R ... you can choose the string to be in your ... grammar for that language which was LL. ... able to gain a lot of insight into it. ...
    (comp.theory)
  • Re: Operator overloading in C
    ... All development of C as an independent language has ... making any changes or improvements to the standard ... The lack of a counted string data structure, ... Pointers can't be used for arg1 or arg2. ...
    (comp.std.c)
  • Re: syntax...
    ... B&D on the part of the language designer. ... probably handle concatenation of string literals by itself, ... bitwise XOR, or if not that, then exponentiation.) ...
    (comp.lang.misc)
  • Why C Is Not My Favourite Programming Language
    ... C has no string type. ... compiler take care of the rest. ... Why does any normal language ... the programmer fail. ...
    (comp.lang.c)
  • Re: Controlling Javascript from server side
    ... but five different language implementations here. ... 'true' means that the request must be handled asynchronously. ... There is exactly *no* reason for such a thing here. ... | percent-endoded string). ...
    (comp.lang.javascript)