Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How effective have these groups been in the past?

Answered: 1 week ago

Question

What are their reputations?

Answered: 1 week ago

Question

How serious a response is warranted to this situation?

Answered: 1 week ago