NAT Lang processing:
Please explain in detail
Consider a CFG representing a phrase structure grammar for a natural language such as English, including the following rule (the period is part of the rule): S -> NP VP .
In this rule, S, NP, and VP are non-terminal symbols, but we will assume that the period is a terminal symbol specifically representing a period (as opposed to some other end-of-sentence marker). So, we can interpret this rule as stating that a sentence can have the form of a noun phrase followed by a verb phrase followed by a period. (To implement a parser for grammars with rules like this, the tokenizer would have to treat periods as separate tokens.)
Assume that you need to convert this grammar to Chomsky normal form (CNF), perhaps with the CKY parsing
Step by stepSolved in 3 steps
- Answer only E partarrow_forward5. a. Write a BNF grammar that describes the structure of a nonterminal called . Assume that contains an optional + sign followed by exactly two decimal digits, the first of which cannot be a 0. Thus 23, +91, and +40 are legal, but 9, +01, and 123 are not. b. Using your grammar from Exercise 5a, show a parse tree for the value +90.arrow_forward25 ! Required information NOTE: This is a multi-part question. Once an answer is submitted, you will be unable to return to this part. Let G=(V, T, S, P) be the phrase-structure grammar with V= {0, 1, A, S), T = [0, 1] and a set of productions P consisting of S → 1S, S→ 00A, A → OA, and A → 0. Identify the correct step to show that 111000 belongs to the language generated by G. Multiple Choice S→ OS 10S 000S-11100A → 111000 S→15 11S→ 111S→ 11100A → 111000 S→ SO → SOO → S000114000 → 111000 S→ 1S 10S→ 1015 → 11100A → 111000arrow_forward
- Topic: Parsing Problem 2. Consider the following context-free grammar What is the language L described by the grammar? Compute the first sets for S, X, and Y. You must show the iterations of the algorithm separately Compute the follow sets for S, X, and Y. You must show the iterations of the algorithm separately Construct the LL(1) parsing table for the grammar. It is enough to just show the table Show the steps in parsing the strings from Larrow_forwardQuestion 16 The given context-free grammar is ambiguous or unambiguous? Write a sentence to support your answer. X→X*X|X+X | (X) | aarrow_forwardConsider the context free grammar (CFG) with the rules, S is the start variable • A and B are variables • 0 and 1 are terminals S - A|B|0 A - S1 B - SOS1 Show that this grammar is 'Ambiguous Grammar', For example: Provide an example of a string language that contains two different leftmost derivations Please demonstrate your work, especially the derivations.arrow_forward
- You are required to give a grammar and an accepted for such a set of identifiers of a programming language language that permits only identifiers that begin with a letter , contain at least one but no more than three digits and can have any number of letters. Please define the production rules by starting S->arrow_forward4. Given the language L = {wxwR: w ∈ {a, b}*, x is a fixed terminal symbol}, answer the following questions: a) Write the context-free grammar that generates L b) Construct the pda that accepts L from the grammar of (a) c) Construct the pda that accepts L directly based on the similar skill used in wwR. d) Is this language a deterministic context-free language?arrow_forwardfill out those two table?arrow_forward
- help fill out the tablearrow_forward1. Consider the following context-free grammar with start symbol S, nonterminals {S, A, B, C}, and terminals {0,1}: SAO A→B A → C1 B→ 1 B→ E C→ 0 (a) Compute all the sets FIRST and FOLLOW necessary to implement a recursive decent parser for this grammar. However, do not list any unnecessary such a set. (b) Investigate all the combinations of sets FIRST and FOLLOW that are involved in the im- plementation of a recursive descent parser for this grammar. Explain how these com- bination make the grammar suitable or unsuitable (as the case might be) for recursive descent parsing.arrow_forwardProcess Programming Contr New Information Machine Networks Modelling Constraint Computational Learning Resor Complexity Proteins Analysis Software Algorithms Engineering Optimisation Model Foundations Constraints Applications Systems Logic Reasoning Dig Theory Data Refinement Games Search Neural Models Inferencearrow_forward
- 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