Question: Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping

 Problem 5: Let Mstate be a denotational semantic mapping that takes

Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping for the following three syntax rules assuming we allow side effects, that is, assuming expressions and conditions can change the values of variables. = if then statement? else while condition> Assume we have the following mappings defined: Malue takes a syntax rule and a state and produces a numeric value (or an error condition) Mboolean takes a syntax rule and a state and produces a true / false value (or an error condition). Mname takes a syntax rule and produces a name (or an error condition). Add takes a name, a value, and a state and produces a state that adds the pair (name, value) to the state. Remove takes a name and a state and produces a state that removes any pair that contains the name as the first element. You may assume the Add and Remove mappings do not produce errors. Problem 5: Let Mstate be a denotational semantic mapping that takes a syntax rule and a state and produces a state. Define the Mstate mapping for the following three syntax rules assuming we allow side effects, that is, assuming expressions and conditions can change the values of variables. = if then statement? else while condition> Assume we have the following mappings defined: Malue takes a syntax rule and a state and produces a numeric value (or an error condition) Mboolean takes a syntax rule and a state and produces a true / false value (or an error condition). Mname takes a syntax rule and produces a name (or an error condition). Add takes a name, a value, and a state and produces a state that adds the pair (name, value) to the state. Remove takes a name and a state and produces a state that removes any pair that contains the name as the first element. You may assume the Add and Remove mappings do not produce errors

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!