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

Show that a set is generated by a regular grammar if and only if it is a regular set.

Short Answer

Expert verified

Therefore, a set is generated by a regular grammar if and only if it is a regular set is proved as true.

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

General form

Regular expressions (Definition): The definition of a regular expression over a set I is as follows:

A regular expression is the symbol \(\emptyset \);

A regular expression is the symbol \(\lambda \);

When \(x \in I\) occurs, the symbol x is a regular expression.

When \(A\) and \(B\) are regular expressions, the symbols \(\left( {AB} \right),\left( {A \cup B} \right),\) and \({\bf{A*}}\) are also regular expressions.

Regular set: The sets represented by regular expressions are called regular sets.

Regular grammar: a phrase-structure grammar where every production is of the form \(A \to aB,A \to a,\) or \(S \to \lambda ,\) where A and B are nonterminal symbols, S is the start symbol, and a is a terminal symbol.

02

Step 2: Proof of the given statement

Given that, a regular grammar if and only if it is a regular set.

To prove: a set is generated by a regular grammar if and only if it is a regular set.

Proof:

Part (1):

Let's demonstrate how a set is generated by a regular grammar when it is regular and how it is generated by a regular grammar when it is not regular.

A should be a standard set.

Given that we can transfer all transitions to \({s_0}\) to an additional state \(s_0'\), let \(M\) be a finite-state machine that identifies A such that \({s_0}\) is never the next state for a transition.

If \(G = \left( {V,\,T,\,S,\,P} \right)\) is such that:

The symbol S is represented the start symbol \({s_0}\).

Each state of S and each input symbol of I are given symbols, forming the variable V.

P is created from M’s transitions. When state \({\bf{s}}\) changes to state t with input a and we add a production, \({A_s} \to {A_t}\). In order to determine whether there is a change from state \(s\) to the final state, we add a production \({A_s} \to a\) and input a. When \({s_0}\) is a start state, then we add a production \(S \to \lambda \).

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

Find all pairs of sets of strings A and B for which AB= {10, 111, 1010, 1000, 10111, 101000}.

Describe how productions for a grammar in extended Backus–Naur form can be translated into a set of productions for the grammar in Backus–Naur form.

This is the Backus–Naur form that describes the syntax of expressions in postfix (or reverse Polish) notation.

\(\begin{array}{c}\left\langle {{\bf{expression}}} \right\rangle {\bf{ :: = }}\left\langle {{\bf{term}}} \right\rangle {\bf{|}}\left\langle {{\bf{term}}} \right\rangle \left\langle {{\bf{term}}} \right\rangle \left\langle {{\bf{addOperator}}} \right\rangle \\{\bf{ }}\left\langle {{\bf{addOperator}}} \right\rangle {\bf{:: = + | - }}\\\left\langle {{\bf{term}}} \right\rangle {\bf{:: = }}\left\langle {{\bf{factor}}} \right\rangle {\bf{|}}\left\langle {{\bf{factor}}} \right\rangle \left\langle {{\bf{factor}}} \right\rangle \left\langle {{\bf{mulOperator}}} \right\rangle {\bf{ }}\\\left\langle {{\bf{mulOperator}}} \right\rangle {\bf{:: = *|/}}\\\left\langle {{\bf{factor}}} \right\rangle {\bf{:: = }}\left\langle {{\bf{identifier}}} \right\rangle {\bf{|}}\left\langle {{\bf{expression }}} \right\rangle \\\left\langle {{\bf{identifier}}} \right\rangle {\bf{:: = a }}\left| {{\bf{ b }}} \right|...{\bf{| z}}\end{array}\)

Show that if A is a set of strings, then\({\bf{A}}\emptyset {\bf{ = }}\emptyset {\bf{A = }}\emptyset \).

a) Explain what the productions are in a grammar if the Backus–Naur form for productions is as follows:

\(\begin{array}{*{20}{l}}{{\bf{ < expression > :: = }}\left( {{\bf{ < expression > }}} \right){\bf{ }}\left| {{\bf{ < expression > + < expression > }}} \right|}\\\begin{array}{c}{\bf{\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;}}\,\,\,\,{\bf{ < expression > * < expression > |}}\\\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{\bf{ < variable > }}\end{array}\\{\,\,\,\,\,\,\,\,\,{\bf{ < variable > :: = xly}}}\end{array}\)

b) Find a derivation tree for \(\left( {{\bf{x*y}}} \right){\bf{ + x}}\) in this grammar.

What is an unsolvable decision problem? Give an example of such a problem.

See all solutions

Recommended explanations on Math 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