/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q29P Show that the language A is inhe... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Show that the language A is inherently ambiguous.

A={aibjck|i=j or â¶ÄŠj=k â¶ÄŠwhere â¶ÄŠi,j,k≥0}

Short Answer

Expert verified

A={aibjck|i=j or â¶ÄŠj=k â¶ÄŠwhere â¶ÄŠi,j,k≥0}

This grammar is inherently ambiguous grammar is proved.

Step by step solution

01

Step 1:

Inherently ambiguous grammar is a language in which no unambiguous grammar is possible. It means that for all string of a language there exist more than one left most derivation or more than one right most derivation or more than one parse tree is called ambiguous grammar.

ambiguous grammar from which elimination of ambiguity is not possible is called Inherently ambiguous grammar.

02

Proving that the given grammar is inherently ambiguous grammar.

A={aibjck|i=j or â¶ÄŠj=k â¶ÄŠwhere â¶ÄŠi,j,k≥0}

Here the strings of language L(A)from the grammar A is L(A).

L(A)={abc,aabbcc,aaabbbccc}

Suppose that G=(V,T,Σ,S)is a context free grammar for Language, and let be the constant specified for graph in Ogden’s lemma.

Assume that,

p>3.

After that let’s consider the string.

z=apbpcp+p

in the given language. After that suppose mark all the positions of ‘a’ as distinguished.

Let u,v,w,x,ybe the five parts of zas specified in the Ogden’s lemma.

Show that,

v=at

x=bt, for some t.

Another string with all the positions of ‘c’ as distinguished. Using Ogden’s lemma there is a non-terminal B that in any grammar there is some string having at least two distinct derivations. So, by the definition, the language is inherently ambiguous.

It means that for all string of a language there exist more than one left most derivation or more than one right most derivation or more than one parse tree and here no unambiguous grammar is possible. and it is also specified in the Ogden’s lemma hence it is proved that the languageA={aibjck|i=j or â¶ÄŠj=k â¶ÄŠwhere â¶ÄŠi,j,k≥0} isinherently ambiguous grammar.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Let G=(V,Σ,R,⟨STMT⟩)be the following grammar.

⟨STMT⟩→⟨ASSIGN⟩|⟨IF-THEN⟩|⟨IF-THEN-ELSE⟩⟨IF-THEN⟩→ifconditionthen⟨STMT⟩⟨IF-THEN-ELSE⟩→ifconditionthen⟨STMT⟩else⟨STMT⟩⟨ASSIGN⟩→a:=1

Σ={if,condition,then,else,a:=1}V={⟨STMT⟩,⟨IF-THEN⟩,⟨IF-THEN-ELSE⟩,⟨ASSIGN⟩}

G is a natural-looking grammar for a fragment of a programming language, but G is ambiguous.

a. Show that G is ambiguous.

b. Give a new unambiguous grammar for the same language

Give context-free grammars generating the following languages.

  1. The set of strings over the alphabet {a,b} with more a’s than b’s.
  2. The complement of the languagerole="math" localid="1660717618566" {anbnn≥0}
  3. role="math" localid="1660717878385" {w#xwRisasubstringofxforw.x∈0,1*}
  4. role="math" localid="1660718125664" {x1#2#...#xkk≥1,eachxi∈a,b*,andforsomeiandj,xi=xjR}

Read the definitions of NOPREFIX ( A) and NOEXTEND (A) in Problem .

a. Show that the class of CFLs is not closed under NOPREFIX.

b. Show that the class of CFLs is not closed under NOEXTEND.

Let C=WWRW∈0,1*.. Prove that C is not a DCFL. (Hint: Suppose that when some DPDA P is started in state q with symbol x on the top of its stack, P never pops its stack below x, no matter what input string P reads from that point on. In that case, the contents of P’s stack at that point cannot affect its subsequent behaviour, so P’s subsequent behavior can depend only on q and x).

Let B=aibjcki,j,k≥0andi=jori=k. Prove that B is not a DCFL.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.