Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Give a counter example to show that the following construction fails to prove that the class of context-free languages is closed under star. Let A be a CFL that is generated by the CFG G=(V,,R,S). Add the new ruleSSS and call the resulting grammar. This grammar is supposed to generate A*.

Short Answer

Expert verified

Answer.

The construction fails for L={a}.

Step by step solution

01

Define Context Free Language

The context free language is generated by context free grammar.These languages are accepted by Pushdown Automata. These are the superset of regular languages.

Consider context-free languages L1described as G1=(V1,S,R1,S1).

Consider context-free language L2described as G2=(V2,S,R2,S2).

02

Determine the counter example

Consider the languageL={a}.

The given grammar and the language is in context free grammar in the form of .G=(V,,R,S).

Note that L*={ε,a,aa,aaa,...}

A grammar of L is localid="1662050454885" G=({S},{a},{(Sa)},S).

The construction gives :G'=({S},{a},{(Sa),(SSS)},S).

However, L (G) does not contain ε so the construction doesn’t produce a grammar for L*.

Hence, the construction fails for L={a}.

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 Vaia!

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

This problem is inspired by the single-player game Minesweeper, generalized to an arbitrary graph. Let Gbe an undirected graph, where each node either contains a single, hidden mine or is empty. The player chooses nodes, one by one. If the player chooses a node containing a mine, the player loses. If the player chooses an empty node, the player learns the number of neighboring nodes containing mines. (A neighboring node is one connected to the chosen node by an edge.) The player wins if and when all empty nodes have been so chosen.

In the mine consistency problem, you are given a graphG along with numbers labeling some of G’s nodes. You must determine whether a placement of mines on the remaining nodes is possible, so that any node v that is labeled m has exactly m neighboring nodes containing mines. Formulate this problem as a language and show that it isNPcomplete.

If we disallow ε- in CFGs, we can simplify the DK-test. In the simplified test, we only need to check that each of DK’s accept states has a single rule. Prove that a CFG without ε- passes the simplified DK-testiff it is a DCFG.

LetMAX-CLIQUE={(G,k)|alargestcliqueinGisofsizeexactlyk}. Use the result of Problem 7.47 to show that MAX-CLIQUEis DP-complete.

Use the recursion theorem to give an alternative proof of Rice’s theorem in Problem 5.28.

For each of the following languages, give two strings that are members and two strings that are not members—a total of four strings for each part. Assume the Σ=a,balpha-alphabet in all parts.

a.a*b*b.aba*bc.a*b*d.aaa*e.Σ*aΣ*bΣ*aΣ*f.abababg.(εa)bh.(ababb)Σ*

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.

Sign-up for free