
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
6
2. Construct a context-free grammar G to accept the set of strings over the alphabet {(,)} that are not balanced. Explain the role of the each nonterminal and state the language generated by each of them. Exhibit leftmost derivations for the strings w1 = ())(, w2 = ((()) and w3 = ) in your grammar G.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- QUESTION 4. rules: 1. 2. Let G= ({S}, {(,)), P, S) be a CFG, where P contains the following S→SSI(S)Se List three different strings in L(G). What is the language L(G)? (You may either give its name or characterize the strings in it.) 3. Show that the grammar G is ambiguous by constructing two different parse trees for some member of L(G). Can you revise the grammar G to make it unambiguous?arrow_forward1. Prove that the language L(G) is not regular where G is the following context-free grammar: G = ({S,A,B,C}, {a,b}, {S->bB|C, A>b|C, B->Sb, C->aAa }, S). Note: You must first determine L(G).arrow_forwardProblem 3 Show that the following language is decidable: INFINITECEG = {(G) |G is a context-free grammar such that L(G) is infinite}arrow_forward
- Is the grammar LL(1)? Why or why not? If grammar is LL(1), use your parsing table to derive the string: modifier noun verb modifierarrow_forwardQuestion 3 a) Consider the grammar E → E + E | E ∗ E | (E) | id. I. Change ambiguous grammar to non-ambiguous? II. Give a context-free grammar for generating the set of palindromes over the alphabet a,b. III. Give a context-free grammar for generating all strings over a,b such that | a |= 2∗ | barrow_forwardQuestion 2-Context-free Grammars Consider the alphabet = {A, V., (,), x, y, z) and the following grammar G = (V,E, R, F), defined by the rules: F (FAF) | (FVF) | (F) | P (a) Identify the set of variables and the set of terminal symbols of G. (b) Identify three words (of lengths between 10 and 20) that can be generated by the above grammar and show their derivations. (c) Consider a modified grammar G', where we remove the brackets '(' and ')' from the alphabet and the derivation rules. That is we set Σ'= {A, V., x, y, z) and we remove all occurrences of brackets in the derivation rules. Show that there are words that are derived ambiguously in G'arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education