Question: Problem 1 (10 points) Consider the following context free grammar: := a b c + * expr> Answer the following with respect to this grammar:

 Problem 1 (10 points) Consider the following context free grammar: :=

a b c + * expr> Answer the following with respect to

Problem 1 (10 points) Consider the following context free grammar: := a b c + * expr> Answer the following with respect to this grammar: a. Show the parse tree for the string a:= a + b* b. Is your derivation mathematically correct? (Hint: Would your derivation evaluate a = 4 + 3 * 2 to a = 14 or a = 10) What is an Ambiguous Grammar? Is the above grammar ambiguous? Explain. Problem 2 (10 Points (a and b) Compute the weakest precondition for the following sequence of statements as used in axiomatic semantics. Show a:=(c + 2)/3 {a> 1} your work a. b. {P1} {P2} x:= 2 * (y - 4) y:= 2 * x-1 {Q} {y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!