Re: Ambuguity of CFG
- From: "J.Jongejan" <jjan@xxxxxxxxxxxxx>
- Date: Mon, 13 Feb 2006 15:19:17 +0100
stylez wrote:
Hello,Dear stylez,
I know that all simple grammars have the special property that they're
unambigous grammars. I was trying to prove by using the fact that all
DFA/NFA and R.E.s are equiv. to CFG and that they hold a single
solution and therefore create an unambigous grammar. The problem with
this statement is that not all CFG are regular, so I was wondering if
anyone had another insight on how to prove this statement so that I can
say it holds. Thank you in advance.
RE's are indeed equivalent to DFA. However, they are not equivalent
to CFG's, since the latter are equivalent to pushdown automata (PDA).
Besides that, there exist ambiguous grammars and grammars that can only be parsed nondeterministically A simple example is the following:
S -> a S a and S -> a
The automaton has to guess when the middle of the inputstring is
reached.
Regards,
Jan Jongejan.
.
- Follow-Ups:
- Re: Ambuguity of CFG
- From: beelzebub
- Re: Ambuguity of CFG
- From: jason_box
- Re: Ambuguity of CFG
- References:
- Ambuguity of CFG
- From: stylez
- Ambuguity of CFG
- Prev by Date: Re: Ambuguity of CFG
- Next by Date: Re: languages
- Previous by thread: Re: Ambuguity of CFG
- Next by thread: Re: Ambuguity of CFG
- Index(es):