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

Use the results of Exercise 2.16to give another proof that every regular language is context- free, by showing how to convert a regular expression directly to an equivalent context-free grammar.

Short Answer

Expert verified

The results of exercise 2.16 show that context-free languages are closed under union, concatenation and star operation, thus every regular language is context-free.

Step by step solution

01

Define Regular languages

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 languagesL1 described as G1=(V1,S,R1,S1).

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

02

Explanation

Given a regular language L. It has been proven that every regular language has a regular expression that describes it. Let r be a regular expression that describes L. That is, let rbe such that Lr=L. Since r is a regular expression it must be of the form:

• a where a,

• localid="1662192279709" ε,

Φ, or be formed recursively from two regular expressions r1 and r2 are regular expressions

r1Ur2,

r1°r2,

r1*

For r=awherea,a grammar for,Lais G=(S,S,S,a,S) For r = ε, a grammar for For a grammar forLεisG=(S,S,Sε,S)For r=Φ,a grammar for

LεisG=(S,S,,S)

The results of exercise that context-free languages are closed under union, concatenation and star-closure, thus every regular language is context-free.

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 X be the set {1,2,3,4,5}and Y be the set {6,7,8,9,10}.The unary function f:XYand the binary function g:X×YYare described in the following tables.

g12345f(n)67676 g123456789101010101010789106789106789106789106

a. What is the value of f(2)?
b.What are the range and domain of f?
c. What is the value of g (2, 10) ?
d. What are the range and domain ofg?
e. What is the value ofg(4, f (4))?

Let

A/B={w|wxaAforsomexB}Show that ifAis context free andBis regular, thenA/Bis context free

Let F be the language of all strings over 0,1that do not contain a pair of 1s that are separated by an odd number of symbols. Give the state diagram of a DFA with five states that recognizes F . (You may find it helpful first to find a 4-state NFA for the complement of F).

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.

Give a counterexample to show that the following construction fails to prove Theorem 1.49, the closure of the class of regular languages under the star operationLet N1=Q1,Σ,δ1,q1,F1 recognize . Construct N=Q1,Σ,δ,q1,F as follows. Nis supposed to recognize A*1.

a. The states of Nare the states of N1.

b. The start state ofN is the same as the start state ofN1 .

c. . F=q1F1.The accept states are the old accept states plus its start state.

d. Defineδso that for any and any aΣε, δq,a=(δ1q,aq6F1ora6=εδ1q,aq1qF1anda=ε

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