retagged by
2,675 views

1 Answer

Best answer
13 votes
13 votes

IF a language is Ambiguous and that cannot be written in any other simplified way ( into unambiguous language) , then language is Inherently ambiguous.

A Language is ambiguous if a string of language can be derived by more than one way and having different derivation tree.

Such as L = aibjck     i=j or j= k , i,j,k>=0 

= aibick $\bigcup$ aibjcj   

S$\rightarrow$ S1 | S2        

S1 $\rightarrow$ XC                 S2$\rightarrow$ AY

X$\rightarrow$ aXb|$\epsilon$               Y $\rightarrow$ bYc |$\epsilon$

C $\rightarrow$cC|$\epsilon$               A$\rightarrow$ aA|$\epsilon$

There is no other way to define this language , and there are strings abc, aabbcc, etc which can be derived from both  S$\rightarrow$S1 or  S $\rightarrow$s2 . So this language is inherent ambiguous.

In case of problem given

a.  L = { anbndm n,m>=0 $\bigcup$  aibjdj  i,j>=0 } which is inherently ambiguous . and strings abd,aabbdd, etc can be derived by 2 ways

b. L = { anbm m>=n m,n>=0   $\bigcup$   wbi , w $\epsilon$ (a,b)* ,i>=0 } 

which can be simplified as 

L = w , w $\epsilon$(a,b)*   into an unambiguous language

selected by

Related questions

1 votes
1 votes
1 answer
1
Mk Utkarsh asked Mar 22, 2018
1,363 views
Please post few examples of Linear Ambiguous Context Free Grammar.It would be helpful if you post grammars for famous languages.
1 votes
1 votes
1 answer
3
1 votes
1 votes
1 answer
4