Chapter 13: Q18E (page 876)
In Exercises 16–22 find the language recognized by the given deterministic finite-state automaton
Short Answer
The result is \({\bf{L(M) = \{ \lambda \} }} \ cup {\bf{\{ }}0{\bf{\} \{ 1\} }}*\)
Chapter 13: Q18E (page 876)
In Exercises 16–22 find the language recognized by the given deterministic finite-state automaton
The result is \({\bf{L(M) = \{ \lambda \} }} \ cup {\bf{\{ }}0{\bf{\} \{ 1\} }}*\)
All the tools & learning materials you need for study success - in one app.
Get started for freeQuestion:Let G = (V, T, S, P) be the phrase-structure grammar with V = {0, 1, A, B, S}, T = {0, 1}, and set of productions P consisting of S → 0A, S → 1A, A → 0B, B → 1A, B → 1.
a) Show that 10101 belongs to the language generated by G.
b) Show that 10110 does not belong to the language generated by G.
c) What is the language generated by G?
a)what is the language generated by a phrase-structure grammar G?
b)What is the language generated by the grammar Gwith vocabulary{S,0,1}, set of terminals T= {0,1}, starting symbol S, and productions S→000S, S→1?
c)Give a phrase-structure grammar that generates the set \({\bf{\{ 0}}{{\bf{1}}^{\bf{n}}}{\bf{|n = 0,1,2}}....{\bf{\} }}\).
Construct phrase-structure grammars to generate each of these sets.
a) \(\left\{ {{{\bf{1}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)
b) \(\left\{ {{\bf{1}}{{\bf{0}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)
c) \(\left\{ {{\bf{1}}{{\bf{1}}^{\bf{n}}}{\bf{|n}} \ge {\bf{0}}} \right\}\)
Give production rules in Backus–Naur form that generate all identifiers in the C programming language. In ‘C’ an identifier starts with a letter or an underscore (_) that is followed by one or more lowercase letters, uppercase letters, underscores, and digits.
Several extensions to Backus–Naur form are commonly used to define phrase-structure grammars. In one such extension, a question mark (?) indicates that the symbol, or group of symbols inside parentheses, to its left can appear zero or once (that is, it is optional), an asterisk (*) indicates that the symbol to its left can appear zero or more times, and a plus (+) indicates that the symbol to its left can appear one or more times. These extensions are part of extended Backus–Naur form (EBNF), and the symbols?, *, and + are called metacharacters. In EBNF the brackets used to denote nonterminal are usually not shown.
a)Define a phrase-structure grammar.
b)What does it mean for a string to be derivable from a string wby a phrase-structure grammar G?
What do you think about this solution?
We value your feedback to improve our textbook solutions.