Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the two context - free grammars: G 1 : num - > 1 1 | 1 0 0 1 | 1 0 1 0

Consider the two context-free grammars:
G1: num ->11|1001|10101| num 0| num num
G2: num ->11|10 num01| num 0| num num
num->00 num|1 num| e
A. Prove that all strings generated by the two grammars G1 and
G2 form (unsigned) binary numbers that are multiples of 3, and
examine whether these grammars produce all strings of nonzeros
of multiples of 3 starting with 1.
B. Prove that the two grammars G1 and G2 are ambiguous and transform them into equivalent non-ambiguous grammars.
C. Consider whether the two can be converted into equivalent LL(1) grammars by eliminating the features
that make them non-LL(1), and then checking for collisions
FIRST/FIRST and FIRST/FOLLOW.
D. For either of the two final grammars in the previous question is not LL(1),
see if by looking at a second input symbol you can resolve its conflicts so that the grammar is LL(2).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago