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 G=(V,,R,S)that is generated by the CFG . Add the new rule SSSand call the resulting grammar. This grammar is supposed to generate A* .

Short Answer

Expert verified

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 language L=a

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

Note that L*={t,a,aa,aaa,}

A grammar of LisG=({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

Let be the language of properly nested parentheses. For example, (()) and ()are in, but) (is not. Show that A is in L.

A two-dimensional finite automaton (2DIM-DFA) is defined as follows. The input is an m×nrectangle, for any m,n2. The squares along the boundary of the rectangle contain the symbol # and the internal squares contain symbols over the input alphabet . The transition function δ:Q×#Q×L,R,U,Dindicates the next state and the new head position (Left, Right, Up, Down). The machine accepts when it enters one of the designated accept states. It rejects if it tries to move off the input rectangle or if it never halts. Two such machines are equivalent if they accept the same rectangles. Consider the problem of determining whether two of these machines are equivalent. Formulate this problem as a language and show that it is undecidable.

In the following solitaire game, you are given anm×m board. On each of itsm2 positions lies either a blue stone, a red stone, or nothing at all. You play by removing stones from the board until each column contains only stones of a single color and each row contains at least one stone. You win if you achieve this objective. Winning may or may not be possible, depending upon the initial configuration. LetSOLITAIRE={<G>|G is a winnable game configuration}. Prove that SOLITAIREis NP-complete.

Let J={w|eitherw=0xfor some,xATM orw=1yfor some yATM¯}. Show that neither JnorJis Turing-recognizable.

Rice’s theorem. Let P be any nontrivial property of the language of a Turing machine. Prove that the problem of determining whether a given Turing machine’s language has property P is undecidable. In more formal terms, let P be a language consisting of Turing machine descriptions where P fulfils two conditions. First, P is nontrivial—it contains some, but not all, TM descriptions. Second, P is a property of the TM’s language—whenever LM1=LM2, we haveM1P if and only iffM2P . Here, M1 and M2 are any TMs. Prove that P is an undecidable language.

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