/*! 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} Q31P Say that a variable A in CFL ro... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Say that a variable A in CFLrole="math" localid="1659808454707" G is usable if it appears in some derivation of some stringw∈G . Given a CFGG and a variable A, consider the problem of testing whetherA is usable. Formulate this problem as a language and show that it is decidable.

Short Answer

Expert verified

This problem or the statement given in the question is decidable.

Step by step solution

01

Context free language

Context free language is a grammar where its language or string that formed by context free grammar is supports pushdown deterministic automata.

02

Step 2:

A variableAin Context free languageGis usable if it appears in some derivation of some string w∈G. And a Context free grammarGand a variable A,

The given grammar isambiguous context free grammar because the language and the string are formed bythe given context free grammar 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.

S→SS|TT→aTb|ab

The LHS derivation of the given grammar,

S→SS|TS→SSS→TSS→aTbS

S→aTbSS→aabbSS→aabbTS→aabbab

The RHS derivation of the given grammar,

S→SS|TS→SSS→STS→Sab

S→SabS→TabS→aTbabS→aabbab

From both the derivation from LHS or RHS the derivation evaluated is same hence, this grammar is ambiguous context free grammar.

Hence, this grammar of context free grammar is usable and this problem is decidable.

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

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.