in Theory of Computation retagged by
2,407 views
2 votes
2 votes
I need two proves, i am stuckhere

1.Show that every S-grammar is Unambiguous

2.Show that a RegEx can never be Inherently Ambiguous

so what to use here? Induction/Contradiction
in Theory of Computation retagged by
by
2.4k views

2 Answers

1 vote
1 vote

Both the ambiguity problem (given a CFG, whether it is ambiguous) and the inherent ambiguity problem (given a CFG, whether its language is inherently ambiguous, i.e. whether any equivalent CFG is ambiguous) are undecidable. Here are the original references:

Since S-Grammer is also a CFG the ambiguity is undecidable

it is decidable whether a regular grammar is ambiguous (the inherent ambiguity problem is not very challenging on regular grammars, since the answer is invariably "no" without even looking at the input grammar). This can be checked in O(|G|2) using a squaring construction on its associated automaton: construct the product of the automaton with itself, and see whether some state (q,q′)(q,q′) with q≠q′q≠q′ is accessible and co-accessible. The oldest reference I know for this idea is a paper by Even (1965).

4 Comments

When we say a set has a property in the sense that it's members obeys that then every subset of it also has it. For example, CFLs are acceptable by PDA. But when we say a property in terms of a set (not elements) like CFLs are closed under union, it may or may not be followed by its subsets. (DCFLs are not closed under union).

Now for the given question the argument given for S-grammar is not a valid proof. It is a CFG but that does not make its ambiguity problem undecidable. We have to explicitly prove this case for S-grammar or show that it is always unambiguous. The place to start the proof would be the properties of S-grammar.
1
1
Sir i think when we talk about ambiguity for CFG and say its undecidable we basically declare this for CFG those are not Reg grammar.
1
1
Would you like to explain your statements by taking any small regular grammar?That would make the analysis more clear.
0
0
0 votes
0 votes
1.the s grammar are of type V->TV* & for every <V,T> pair we have a unique production. clearly, this property of s grammar make it unambiguous.

2. for every regular set their exists at least one unambiguous regular grammar.

Related questions