Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer questions ( a ) through ( c ) for the following grammar: val :: = number | val pair number :: = digit +

Answer questions (a) through (c) for the following grammar:
val ::= number | val pair
number ::= digit+
pair ::= number op | number pair op
op ::="+"|"-"|"*"|"/"
digit ::="0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
Also consider the following mutation, which adds an additional rule to the grammar:
pair ::= number op | number pair op | op number
1. Which of the following strings can be generated by the (unmutated) grammar?
a)42
b)42
c)4+2
d)42+
e)427-*
f)42-7*
g)42-7*+
2. Find a string that is generated by the mutated grammar, but not by the original grammar.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

What do you think of the MBO program developed by Drucker?

Answered: 1 week ago