Consider the following grammar (given in Chomsky normal form): SAB ABS | b BSA | a a. The shortest string generated by this grammar is ba. The shortest strings not generated by this grammar are €, a, and b. Give the next two shortest strings generated by this grammar, and two other short strings not generated by this grammar. b. Draw the parse tree given this grammar for the string bbaaba. c. Find a long path -- eg, with 5 nonterminals -- from the root to a leaf in your parse tree. Starting at the bottom of that path, find the first nonterminal that appears twice along the path. Circle the two occurrences of the repeated nonterminal, and draw an outline around the subtree generated by the lower occurrence and an outline around the subtree generated by the upper occurrence. In accordance with the Pumping Lemma for the CFLs and given the string z = bbaaba, what are the values of the 5 substrings U, V, W, X, Y determined by the subtrees you have indicated? Be sure to give a value (even if just €) for each of the 5 variables.
Consider the following grammar (given in Chomsky normal form): SAB ABS | b BSA | a a. The shortest string generated by this grammar is ba. The shortest strings not generated by this grammar are €, a, and b. Give the next two shortest strings generated by this grammar, and two other short strings not generated by this grammar. b. Draw the parse tree given this grammar for the string bbaaba. c. Find a long path -- eg, with 5 nonterminals -- from the root to a leaf in your parse tree. Starting at the bottom of that path, find the first nonterminal that appears twice along the path. Circle the two occurrences of the repeated nonterminal, and draw an outline around the subtree generated by the lower occurrence and an outline around the subtree generated by the upper occurrence. In accordance with the Pumping Lemma for the CFLs and given the string z = bbaaba, what are the values of the 5 substrings U, V, W, X, Y determined by the subtrees you have indicated? Be sure to give a value (even if just €) for each of the 5 variables.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 35SA
Related questions
Question
Can you help me solve this problem?
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage